source: npl/internetserver/bind/bind.SlackBuild @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 6.9 KB
Line 
1#!/bin/sh
2#DEP:openssl
3# Set initial variables:
4CWD=`pwd`
5if [ "$TMP" = "" ]; then
6  TMP=/tmp
7fi
8PKG=$TMP/package-bind
9rm -rf $PKG
10
11VERSION=9.5.1-P2
12PVER=9.5.1_P2
13ARCH=${ARCH:-i486}
14BUILD=${BUILD:-1}
15
16# Edit these library versions with each release:
17#LIBBINDVER=0.0.5
18#LIBDNSVER=20.0.2
19#LIBISCVER=9.1.5
20#LIBISCCCVER=0.2.1
21#LIBISCCFGVER=1.0.5
22#LIBLWRESVER=1.2.2
23
24# Determine major numbers:
25#LIBBINDMAJOR=`echo $LIBBINDVER | cut -f 1 -d .`
26#LIBDNSMAJOR=`echo $LIBDNSVER | cut -f 1 -d .`
27#LIBISCMAJOR=`echo $LIBISCVER | cut -f 1 -d .`
28#LIBISCCCMAJOR=`echo $LIBISCCCVER | cut -f 1 -d .`
29#LIBISCCFGMAJOR=`echo $LIBISCCFGVER | cut -f 1 -d .`
30#LIBLWRESMAJOR=`echo $LIBLWRESVER | cut -f 1 -d .`
31
32if [ "$ARCH" = "i386" ]; then
33  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
34elif [ "$ARCH" = "i486" ]; then
35  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
36elif [ "$ARCH" = "s390" ]; then
37  SLKCFLAGS="-O2"
38elif [ "$ARCH" = "x86_64" ]; then
39  SLKCFLAGS="-O2"
40fi
41
42if [ ! -d $TMP ]; then
43  mkdir -p $TMP # location to build the source
44fi
45rm -rf $PKG
46mkdir -p $PKG
47
48# Explode the package framework:
49cd $PKG
50explodepkg $CWD/_bind.tar.gz
51
52cd $TMP
53rm -rf bind-$VERSION
54tar xzvf $CWD/bind-$VERSION.tar.gz || exit 1
55cd bind-$VERSION
56
57chown -R root.root .
58find . -perm 775 -exec chmod 755 {} \;
59find . -perm 664 -exec chmod 644 {} \;
60# We want to use /var/run/named/, not just /var/run/.
61# This allows changing the ownership of that directory if we want to run
62# named as a non-root user.
63zcat $CWD/bind.var.run.named.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
64# Threads break '-u' on Linux (for now)
65CFLAGS="$SLKCFLAGS" \
66./configure \
67       --prefix=/usr \
68       --sysconfdir=/etc \
69       --localstatedir=/var \
70       --with-libtool \
71       --enable-shared \
72       --disable-threads \
73       --with-openssl=/usr \
74       $ARCH-slackware-linux || exit 1
75make -j1 || exit 1
76cat isc-config.sh > $PKG/usr/bin/isc-config.sh
77chmod 755 $PKG/usr/bin/isc-config.sh
78chown root.bin $PKG/usr/bin/isc-config.sh
79cat contrib/named-bootconf/named-bootconf.sh > $PKG/usr/sbin/named-bootconf.sh
80cd bin/check/.libs
81cat named-checkconf > $PKG/usr/sbin/named-checkconf
82cat named-checkzone > $PKG/usr/sbin/named-checkzone
83cd ../../dig/.libs
84cat dig > $PKG/usr/bin/dig
85cat host > $PKG/usr/bin/host
86cat nslookup > $PKG/usr/bin/nslookup
87cd ../../dnssec/.libs
88cat dnssec-keygen > $PKG/usr/sbin/dnssec-keygen
89# obsolete
90#cat dnssec-makekeyset > $PKG/usr/sbin/dnssec-makekeyset
91#cat dnssec-signkey > $PKG/usr/sbin/dnssec-signkey
92cat dnssec-signzone > $PKG/usr/sbin/dnssec-signzone
93cd ../../named/.libs
94#rm lwresd
95cat named > $PKG/usr/sbin/named
96( cd $PKG/usr/sbin ; ln -sf named lwresd )
97cd ../../nsupdate/.libs
98cat nsupdate > $PKG/usr/bin/nsupdate
99cd ../../rndc/.libs
100cat rndc > $PKG/usr/sbin/rndc
101cat rndc-confgen > $PKG/usr/sbin/rndc-confgen
102cd ..
103mkdir -p $PKG/usr/doc/bind-$VERSION/misc
104cat rndc.conf > $PKG/usr/doc/bind-$VERSION/misc/rndc.conf-sample
105chmod 600 $PKG/usr/doc/bind-$VERSION/misc/rndc.conf-sample
106cd ../../lib/bind9/.libs
107cp -a libbind9.so.* $PKG/usr/lib || exit 1
108#chmod 755 $PKG/usr/lib/libbind9.so.*
109#( cd $PKG/usr/lib ; rm -rf libbind9.so.${LIBBINDMAJOR} ; ln -sf libbind9.so.${LIBBINDVER} libbind.so.${LIBBINDMAJOR} )
110cd ../../dns/.libs
111cp -a libdns.so.* $PKG/usr/lib || exit 1
112#chmod 755 $PKG/usr/lib/libdns.so.${LIBDNSVER}
113#( cd $PKG/usr/lib ; rm -rf libdns.so.${LIBDNSMAJOR} ; ln -sf libdns.so.${LIBDNSVER} libdns.so.${LIBDNSMAJOR} )
114cd ../../isc/.libs
115cp -a libisc.so.* $PKG/usr/lib  || exit 1
116#chmod 755 $PKG/usr/lib/libisc.so.${LIBISCVER}
117#( cd $PKG/usr/lib ; rm -rf libisc.so.${LIBISCMAJOR} ; ln -sf libisc.so.${LIBISCVER} libisc.so.${LIBISCMAJOR} )
118cd ../../isccc/.libs
119cp -a libisccc.so.* $PKG/usr/lib || exit 1
120#chmod 755 $PKG/usr/lib/libisccc.so.${LIBISCCCVER}
121#( cd $PKG/usr/lib ; rm -rf libisccc.so.${LIBISCCCMAJOR} ; ln -sf libisccc.so.${LIBISCCCVER} libisccc.so.${LIBISCCCMAJOR} )
122cd ../../isccfg/.libs
123cp -a libisccfg.so.* $PKG/usr/lib || exit 1
124#chmod 755 $PKG/usr/lib/libisccfg.so.${LIBISCCFGVER}
125#( cd $PKG/usr/lib ; rm -rf libisccfg.so.${LIBISCCFGMAJOR} ; ln -sf libisccfg.so.${LIBISCCFGVER} libisccfg.so.${LIBISCCFGMAJOR} )
126cd ../../lwres/.libs
127cp -a liblwres.so.* $PKG/usr/lib || exit 1
128#chmod 755 $PKG/usr/lib/liblwres.so.${LIBLWRESVER}
129#( cd $PKG/usr/lib ; rm -rf liblwres.so.${LIBLWRESMAJOR} ; ln -sf liblwres.so.${LIBLWRESVER} liblwres.so.${LIBLWRESMAJOR} )
130#mkdir -p $PKG/usr/man/man{1,5,8}
131cd ../../../bin
132cat dig/dig.1 | gzip -9c > $PKG/usr/man/man1/dig.1.gz
133cat dig/host.1 | gzip -9c > $PKG/usr/man/man1/host.1.gz
134cat rndc/rndc.conf.5 | gzip -9c > $PKG/usr/man/man5/rndc.conf.5.gz
135cat check/named-checkconf.8 | gzip -9c > $PKG/usr/man/man8/named-checkconf.8.gz
136cat check/named-checkzone.8 | gzip -9c > $PKG/usr/man/man8/named-checkzone.8.gz
137cat dnssec/dnssec-keygen.8 | gzip -9c > $PKG/usr/man/man8/dnssec-keygen.8.gz
138# obsolete
139#cat dnssec/dnssec-makekeyset.8 | gzip -9c > $PKG/usr/man/man8/dnssec-makekeyset.8.gz
140#cat dnssec/dnssec-signkey.8 | gzip -9c > $PKG/usr/man/man8/dnssec-signkey.8.gz
141cat dnssec/dnssec-signzone.8 | gzip -9c > $PKG/usr/man/man8/dnssec-signzone.8.gz
142cat named/lwresd.8 | gzip -9c > $PKG/usr/man/man8/lwresd.8.gz
143cat named/named.8 | gzip -9c > $PKG/usr/man/man8/named.8.gz
144cat nsupdate/nsupdate.8 | gzip -9c > $PKG/usr/man/man8/nsupdate.8.gz
145cat rndc/rndc-confgen.8 | gzip -9c > $PKG/usr/man/man8/rndc-confgen.8.gz
146cat rndc/rndc.8 | gzip -9c > $PKG/usr/man/man8/rndc.8.gz
147cd ../doc
148mkdir -p $PKG/usr/doc/bind-$VERSION
149cp -a arm misc $PKG/usr/doc/bind-$VERSION
150cd ..
151cp -a CHANGES COPYRIGHT FAQ README $PKG/usr/doc/bind-$VERSION
152( cd $PKG/usr/doc/bind-$VERSION
153  find . -type f | xargs chmod 644
154  # This one should have the correct perms of the config file:
155  chmod 600 misc/rndc.conf-sample )
156( cd $PKG
157  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
158  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
159)
160
161# Add sample config files for a simple caching nameserver:
162
163cat $CWD/caching-example/named.conf > $PKG/etc/named.conf.new
164cat $CWD/caching-example/localhost.zone > $PKG/var/named/caching-example/localhost.zone
165cat $CWD/caching-example/named.ca > $PKG/var/named/caching-example/named.ca
166cat $CWD/caching-example/named.local > $PKG/var/named/caching-example/named.local
167
168mkdir -p $PKG/install
169cat $CWD/slack-desc > $PKG/install/slack-desc
170
171mkdir -p $PKG/service/bind
172cp $CWD/run $PKG/service/bind/run
173chmod +x $PKG/service/bind/run || exit 1
174
175rm -r $PKG/etc/rc.d
176
177# Build seperate tools package
178mkdir -p /tmp/bindtools/usr
179mv $PKG/usr/bin /tmp/bindtools/usr || exit 1
180mv $PKG/usr/lib /tmp/bindtools/usr || exit 1
181
182pushd /tmp/bindtools
183NAME=bind_tools
184makepkg -l y -c n $CWD/$NAME.pkg > /dev/null || exit 1
185echo $PVER > $CWD/$NAME.version || exit 1
186echo $ARCH > $CWD/$NAME.arch || exit 1
187popd
188
189# Build the package:
190cd $PKG
191NAME=`echo $0|cut -f2 -d'.'`
192makepkg -l y -c n $CWD/$NAME.pkg > /dev/null || exit 1
193echo $PVER > $CWD/$NAME.version || exit 1
194echo $ARCH > $CWD/$NAME.arch || exit 1
195
196
197
Note: See TracBrowser for help on using the repository browser.