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 2008 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 #pragma ident "@(#)fix-slrn-makefile 1.1 00/03/23 SMI"
35
36 VER=slrn-0.9.9
37 PROTO=${ROOT}/opt/sfw
38
39 sed "s,^MISCLIBS.*,MISCLIBS = -lnsl -lsocket,;
40 s,^SLANGINC.*,SLANGINC = ${PROTO}/include,;
41 s,^SLANGLIB.*,SLANGLIB = ${PROTO}/lib -L/opt/sfw/lib -R/opt/sfw/lib,;" \
42 < ${VER}/src/Makefile > ./foo && mv -f ./foo ${VER}/src/Makefile
43
44 #
45 # We need to fool chkslang into finding libslang when run.
46 #
47 sed "s,\$(OBJDIR)/chkslang \$(EXEC).*,LD_LIBRARY_PATH=${PROTO}/lib &,;" \
48 < ${VER}/src/Makefile > ./foo && mv -f ./foo ${VER}/src/Makefile
49
50 sed \
51 's,^#.*define.*SLRN_LIB_DIR.*\".*\",#define SLRN_LIB_DIR \"/opt/sfw/etc/slrn\",;' \
52 < ${VER}/src/slrnfeat.h > ./foo && mv -f ./foo ${VER}/src/slrnfeat.h
53
54 #
55 # Since we've changed a default setting (Away from /usr/local/lib/slrn) and
56 # the docs reference this many times, we'll stick a note at the top of the
57 # INSTALL file which explains that.
58 #
59 # XXX another possibility is to simply change references in that INSTALL file
60 # to point at the correct path, or to give up on this exercise entirely.
61 #
62 rm -f ./foo
63 cat > ./foo <<EOF
64 IMPORTANT: In this distribution, /opt/sfw/etc/slrn has been set up as the
65 location for the site-wide default slrn settings, instead of slrn's default of
66 /usr/local/lib/slrn. Place sitewide newsgroups.dsc and slrn.rc files there.
67
68 EOF
69
70 cat ${VER}/doc/INSTALL >> ./foo
71 mv -f ./foo ${VER}/doc/INSTALL
72
73 exit 0