diff options
Diffstat (limited to 'source/n/dhcp')
-rwxr-xr-x | source/n/dhcp/dhcp-remove-bind-tarball.sh | 49 | ||||
-rwxr-xr-x | source/n/dhcp/dhcp.SlackBuild | 30 | ||||
-rw-r--r-- | source/n/dhcp/doinst.sh | 10 |
3 files changed, 69 insertions, 20 deletions
diff --git a/source/n/dhcp/dhcp-remove-bind-tarball.sh b/source/n/dhcp/dhcp-remove-bind-tarball.sh new file mode 100755 index 00000000..5249f967 --- /dev/null +++ b/source/n/dhcp/dhcp-remove-bind-tarball.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# Copyright 2011 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +PKGNAM=dhcp +VERSION=${VERSION:-4.2.1-P1} +BUILD=${BUILD:-1} + +# This is not yet used, but eventually we would like to be able to purge +# the bundled BIND and use the system's instead. Maybe wishful thinking. + +CWD=$(pwd) +TMP=${TMP:-/tmp} + +cd $TMP +rm -rf dhcp-$VERSION +tar xvf $CWD/dhcp-$VERSION.tar.?z* || exit 1 +cd dhcp-$VERSION || exit 1 + +# good "bob" why? ... +rm -rf bind/* + +# Generate a new .xz compressed tarball in /tmp: +cd $TMP +rm -f dhcp-$VERSION.tar* +tar cf dhcp-$VERSION.tar dhcp-$VERSION +xz -9 dhcp-$VERSION.tar + +echo "$TMP/dhcp-$VERSION.tar.xz created" + diff --git a/source/n/dhcp/dhcp.SlackBuild b/source/n/dhcp/dhcp.SlackBuild index 6baf041a..c328b3cb 100755 --- a/source/n/dhcp/dhcp.SlackBuild +++ b/source/n/dhcp/dhcp.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -21,8 +21,13 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -VERSION=${VERSION:-$(echo dhcp-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-2} +PKGNAM=dhcp +# Leave this one .gz as other compressors do not help much and we can keep +# the original upstream .asc +VERSION=${VERSION:-$(basename $(echo $PKGNAM-*.tar.gz | cut -f 2- -d -) .tar.gz)} +BUILD=${BUILD:-1} + +PKG_VERSION=$(echo $VERSION | tr - _) NUMJOBS=${NUMJOBS:-" -j7 "} @@ -59,7 +64,7 @@ mkdir -p $TMP $PKG cd $TMP rm -rf dhcp-$VERSION -tar xvf $CWD/dhcp-$VERSION.tar.?z* || exit 1 +tar xvf $CWD/dhcp-$VERSION.tar.gz || exit 1 cd dhcp-$VERSION || exit 1 chown -R root:root . @@ -102,12 +107,12 @@ mv $PKG/usr/sbin/dhclient $PKG/sbin cat client/scripts/linux > $PKG/sbin/dhclient-script chmod 700 $PKG/sbin/dhclient-script +# Create the initial *.leases files: mkdir -p $PKG/var/state/dhcp -# The daemon should create these automatically as needed -#touch $PKG/var/state/dhcp/dhcpd.leases.new -#touch $PKG/var/state/dhcp/dhcpd6.leases.new -#touch $PKG/var/state/dhcp/dhclient.leases.new -#touch $PKG/var/state/dhcp/dhclient6.leases.new +touch $PKG/var/state/dhcp/dhcpd.leases.new +touch $PKG/var/state/dhcp/dhcpd6.leases.new +touch $PKG/var/state/dhcp/dhclient.leases.new +touch $PKG/var/state/dhcp/dhclient6.leases.new cat << EOF > $PKG/etc/dhcpd.conf.new # dhcpd.conf @@ -153,10 +158,5 @@ cat $CWD/slack-desc > $PKG/install/slack-desc zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $TMP/dhcp-$VERSION-$ARCH-$BUILD.txz +/sbin/makepkg -l y -c n $TMP/dhcp-$PKG_VERSION-$ARCH-$BUILD.txz -# Clean up the extra stuff: -if [ "$1" = "--cleanup" ]; then - rm -rf $TMP/dhcp-$VERSION - rm -rf $PKG -fi diff --git a/source/n/dhcp/doinst.sh b/source/n/dhcp/doinst.sh index 88d284f6..a376034a 100644 --- a/source/n/dhcp/doinst.sh +++ b/source/n/dhcp/doinst.sh @@ -13,9 +13,9 @@ config() { config etc/dhcpd.conf.new config etc/dhclient.conf.new -#config var/state/dhcp/dhcpd.leases.new -#config var/state/dhcp/dhcpd6.leases.new -#config var/state/dhcp/dhclient.leases.new -#config var/state/dhcp/dhclient6.leases.new -#rm -f var/state/dhcp/*.leases.new +config var/state/dhcp/dhcpd.leases.new +config var/state/dhcp/dhcpd6.leases.new +config var/state/dhcp/dhclient.leases.new +config var/state/dhcp/dhclient6.leases.new +rm -f var/state/dhcp/*.leases.new |