summaryrefslogtreecommitdiff
path: root/source/n/dhcp/dhcp.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/dhcp/dhcp.SlackBuild')
-rwxr-xr-xsource/n/dhcp/dhcp.SlackBuild30
1 files changed, 15 insertions, 15 deletions
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