source: npl/internetserver/bind/bind.SlackBuild.orig @ 76ea60c

Last change on this file since 76ea60c was ebc5ae5, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

upgraded dhcpd to 4.3.6 for better ipv6 support

  • Property mode set to 100755
File size: 5.0 KB
RevLine 
[ebc5ae5]1#!/bin/sh
2
3# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016  Patrick J. Volkerding, Sebeka, MN, USA
4# All rights reserved.
5#
6# Redistribution and use of this script, with or without modification, is
7# permitted provided that the following conditions are met:
8#
9# 1. Redistributions of this script must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11#
12#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
13#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
15#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
18#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23
24PKGNAM=bind
25VERSION=${VERSION:-9.11.0-P2}
26BUILD=${BUILD:-1}
27
28# Automatically determine the architecture we're building on:
29if [ -z "$ARCH" ]; then
30  case "$( uname -m )" in
31    i?86) export ARCH=i586 ;;
32    arm*) export ARCH=arm ;;
33    # Unless $ARCH is already set, use uname -m for all other archs:
34       *) export ARCH=$( uname -m ) ;;
35  esac
36fi
37
38NUMJOBS=${NUMJOBS:-" -j7 "}
39
40CWD=$(pwd)
41TMP=/bind-$(mcookie)
42PKG=$TMP/package-${PKGNAM}
43rm -rf $PKG
44mkdir -p $TMP $PKG/etc/default
45
46if [ "$ARCH" = "i586" ]; then
47  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
48  LIBDIRSUFFIX=""
49elif [ "$ARCH" = "s390" ]; then
50  SLKCFLAGS="-O2"
51  LIBDIRSUFFIX=""
52elif [ "$ARCH" = "x86_64" ]; then
53  SLKCFLAGS="-O2 -fPIC"
54  LIBDIRSUFFIX="64"
55fi
56
57cd $TMP
58rm -rf ${PKGNAM}-${VERSION}
59tar xvf $CWD/${PKGNAM}-$VERSION.tar.gz || exit 1
60cd ${PKGNAM}-$VERSION || exit 1
61
62# Remove use of SO_BSDCOMPAT which has been obsolete since the 2.2.x kernel
63# series, and generates warnings under 2.6.x kernels.  This _might_ be fixed
64# upstream already, but an explicit #undef SO_BSDCOMPAT does not hurt:
65zcat $CWD/bind.so_bsdcompat.diff.gz | patch -p1 --verbose || exit
66
67# Make sure ownerships and permissions are sane:
68chown -R root:root .
69find . \
70 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
71 -exec chmod 755 {} \; -o \
72 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
73 -exec chmod 644 {} \;
74
75# Configure:
76CFLAGS="$SLKCFLAGS" \
77./configure \
78  --prefix=/usr \
79  --libdir=/usr/lib${LIBDIRSUFFIX} \
80  --sysconfdir=/etc \
81  --localstatedir=/var \
82  --with-libtool \
83  --with-idn=/usr \
84  --mandir=/usr/man \
85  --enable-shared \
86  --disable-static \
87  --enable-threads \
88  --with-openssl=/usr \
89  --build=$ARCH-slackware-linux || exit 1
90
91# Build and install:
92make $NUMJOBS || make || exit 1
93make install DESTDIR=$PKG || exit 1
94
95# We like symlinks.
96( cd $PKG/usr/sbin
97  ln -sf named lwresd
98)
99
100# We like a lot of symlinks.
101( cd $PKG/usr/man/man3
102  sh $CWD/3link.sh
103)
104
105# Install init script:
106mkdir -p $PKG/etc/rc.d
107cp -a $CWD/rc.bind $PKG/etc/rc.d/rc.bind.new
108chmod 644 $PKG/etc/rc.d/rc.bind.new
109
110# Add /var/run/named directory:
111mkdir -p $PKG/var/run/named
112
113# Fix library perms:
114chmod 755 $PKG/usr/lib${LIBDIRSUFFIX}/*
115
116# Strip binaries:
117find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
118  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
119
120# Symlink hardlinked man pages:
121( cd $PKG/usr/man/man1
122  ln -sf isc-config.sh.1 bind9-config.1
123)
124
125# Compress manual pages:
126find $PKG/usr/man -type f -exec gzip -9 {} \;
127for i in $( find $PKG/usr/man -type l ) ; do
128  ln -s $( readlink $i ).gz $i.gz
129  rm $i
130done
131
132# Add a documentation directory:
133mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
134cp -a \
135  CHANGES COPYRIGHT FAQ* README* \
136  doc/arm doc/misc \
137  $PKG/usr/doc/${PKGNAM}-$VERSION
138
139# This one should have the correct perms of the config file:
140#chmod 644 $PKG/usr/doc/${PKGNAM}-$VERSION/misc/rndc.conf-sample
141
142# One format of this is plenty.  Especially get rid of the bloated PDF.
143( cd $PKG/usr/doc/bind-$VERSION/arm
144  rm -f Makefile* *.pdf *.xml README.SGML latex-fixup.pl
145)
146
147# Add sample config files for a simple caching nameserver:
148mkdir -p $PKG/var/named/caching-example
149cat $CWD/caching-example/named.conf > $PKG/etc/named.conf.new
150cat $CWD/caching-example/localhost.zone > $PKG/var/named/caching-example/localhost.zone
151cat $CWD/caching-example/named.local > $PKG/var/named/caching-example/named.local
152cat $CWD/caching-example/named.root > $PKG/var/named/caching-example/named.root
153# This name is deprecated, but having it here doesn't hurt in case
154# an old configuration file wants it:
155cat $CWD/caching-example/named.root > $PKG/var/named/caching-example/named.ca
156
157mkdir -p $PKG/install
158zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
159cat $CWD/slack-desc > $PKG/install/slack-desc
160
161cd $PKG
162/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$(echo $VERSION | tr - _)-$ARCH-$BUILD.txz
163
Note: See TracBrowser for help on using the repository browser.