New fix-slrn-makefile
1 #!/bin/sh
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #
23
24
25 #
26 # Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
27 # Use is subject to license terms.
28 #
29 # fix slrn's makefile, slrnfeat.h and INSTALL document to make some sense
30 # after running configure. In particular we discard slrn's default location
31 # for the site-wide config file (/usr/local/lib/slrn) and place it in
32 # /opt/sfw/etc
33 #
34
35 VER=slrn-0.9.9p1
36 PROTO=${ROOT}/opt/sfw
37
38 sed "s,^MISCLIBS.*,MISCLIBS = -lnsl -lsocket,;
39 s,^SLANGINC.*,SLANGINC = ${PROTO}/include,;
40 s,^SLANGLIB.*,SLANGLIB = ${PROTO}/lib -L/opt/sfw/lib -R/opt/sfw/lib,;" \
41 < ${VER}/src/Makefile > ./foo && mv -f ./foo ${VER}/src/Makefile
42
43 #
44 # We need to fool chkslang into finding libslang when run.
45 #
46 sed "s,\$(OBJDIR)/chkslang \$(EXEC).*,LD_LIBRARY_PATH=${PROTO}/lib &,;" \
47 < ${VER}/src/Makefile > ./foo && mv -f ./foo ${VER}/src/Makefile
48
49 sed \
50 's,^#.*define.*SLRN_LIB_DIR.*\".*\",#define SLRN_LIB_DIR \"/opt/sfw/etc/slrn\",;' \
51 < ${VER}/src/slrnfeat.h > ./foo && mv -f ./foo ${VER}/src/slrnfeat.h
52
53 #
54 # Since we've changed a default setting (Away from /usr/local/lib/slrn) and
55 # the docs reference this many times, we'll stick a note at the top of the
56 # INSTALL file which explains that.
57 #
58 # XXX another possibility is to simply change references in that INSTALL file
59 # to point at the correct path, or to give up on this exercise entirely.
60 #
61 rm -f ./foo
62 cat > ./foo <<EOF
63 IMPORTANT: In this distribution, /opt/sfw/etc/slrn has been set up as the
64 location for the site-wide default slrn settings, instead of slrn's default of
65 /usr/local/lib/slrn. Place sitewide newsgroups.dsc and slrn.rc files there.
66
67 EOF
68
69 cat ${VER}/doc/INSTALL >> ./foo
70 mv -f ./foo ${VER}/doc/INSTALL
71
72 exit 0