wok-6.x rev 3350

Add dhcp6
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jun 11 17:11:41 2009 +0200 (2009-06-11)
parents f21f0b5b51c2
children 5da17cf52da8
files dhcp/receipt dhcp6-client/receipt dhcp6-relay/receipt dhcp6/receipt dhcp6/stuff/start-without-ipv6.u
line diff
     1.1 --- a/dhcp/receipt	Thu Jun 11 17:10:09 2009 +0200
     1.2 +++ b/dhcp/receipt	Thu Jun 11 17:11:41 2009 +0200
     1.3 @@ -16,6 +16,7 @@
     1.4  {
     1.5  	cd $src
     1.6  	./configure --prefix=/usr --infodir=/usr/share/info \
     1.7 +	--disable-dhcpv6 \
     1.8  	--sysconfdir=/etc --mandir=/usr/share/man $CONFIGURE_ARGS && \
     1.9  	make && make DESTDIR=$PWD/_pkg install
    1.10  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/dhcp6-client/receipt	Thu Jun 11 17:11:41 2009 +0200
     2.3 @@ -0,0 +1,23 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="dhcp6-client"
     2.7 +VERSION="4.1.1b1"
     2.8 +CATEGORY="network"
     2.9 +SHORT_DESC="Dynamic Host Configuration Protocol ISC client with ipv6 support."
    2.10 +MAINTAINER="pascal.bellard@slitaz.org"
    2.11 +WEB_SITE="http://www.isc.org/products/DHCP/"
    2.12 +WANTED="dhcp6"
    2.13 +DEPENDS="libcrypto"
    2.14 +CONFIG_FILES="/etc/dhclient.conf"
    2.15 +PROVIDE="dhcp-client"
    2.16 +
    2.17 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.18 +genpkg_rules()
    2.19 +{
    2.20 +	mkdir -p $fs/usr/sbin $fs/usr/bin $fs/etc
    2.21 +	cp $_pkg/etc/dhclient.conf $fs/etc
    2.22 +	cp $_pkg/../client/scripts/linux $fs/etc/dhclient-script
    2.23 +	cp $_pkg/usr/sbin/dhclient $fs/usr/sbin
    2.24 +	cp $_pkg/usr/bin/omshell $fs/usr/bin
    2.25 +}
    2.26 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/dhcp6-relay/receipt	Thu Jun 11 17:11:41 2009 +0200
     3.3 @@ -0,0 +1,19 @@
     3.4 +# SliTaz package receipt.
     3.5 +
     3.6 +PACKAGE="dhcp6-relay"
     3.7 +VERSION="4.1.1b1"
     3.8 +CATEGORY="network"
     3.9 +SHORT_DESC="Dynamic Host Configuration Protocol relay with ipv6 support."
    3.10 +MAINTAINER="pascal.bellard@slitaz.org"
    3.11 +WEB_SITE="http://www.isc.org/products/DHCP/"
    3.12 +DEPENDS="libcrypto"
    3.13 +WANTED="dhcp6"
    3.14 +PROVIDE="dhcp-relay"
    3.15 +
    3.16 +# Rules to gen a SliTaz package suitable for Tazpkg.
    3.17 +genpkg_rules()
    3.18 +{
    3.19 +	mkdir -p $fs/usr/sbin
    3.20 +	cp -a $_pkg/usr/sbin/dhcrelay $fs/usr/sbin
    3.21 +}
    3.22 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/dhcp6/receipt	Thu Jun 11 17:11:41 2009 +0200
     4.3 @@ -0,0 +1,41 @@
     4.4 +# SliTaz package receipt.
     4.5 +
     4.6 +PACKAGE="dhcp6"
     4.7 +VERSION="4.1.1b1"
     4.8 +CATEGORY="network"
     4.9 +SHORT_DESC="Dynamic Host Configuration Protocol server with ipv6 support."
    4.10 +MAINTAINER="pascal.bellard@slitaz.org"
    4.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    4.12 +WEB_SITE="http://www.isc.org/products/DHCP/"
    4.13 +WGET_URL="http://ftp.isc.org/isc/$PACKAGE/$TARBALL"
    4.14 +DEPENDS="libcrypto"
    4.15 +CONFIG_FILES="/etc/dhcpd.conf"
    4.16 +PROVIDE="dhcp"
    4.17 +
    4.18 +# Rules to configure and make the package.
    4.19 +compile_rules()
    4.20 +{
    4.21 +	cd $src
    4.22 +	for i in start-without-ipv6 ; do
    4.23 +		[ -f $i.done ] && continue
    4.24 +		patch -p1 < ../stuff/$i.u || return 1
    4.25 +		touch $i.done
    4.26 +	done
    4.27 +	./configure --prefix=/usr --infodir=/usr/share/info \
    4.28 +	--sysconfdir=/etc --mandir=/usr/share/man $CONFIGURE_ARGS && \
    4.29 +	make && make DESTDIR=$PWD/_pkg install
    4.30 +}
    4.31 +
    4.32 +# Rules to gen a SliTaz package suitable for Tazpkg.
    4.33 +genpkg_rules()
    4.34 +{
    4.35 +	mkdir -p $fs/usr/sbin $fs/etc
    4.36 +	cp $_pkg/etc/dhcpd.conf $fs/etc
    4.37 +	cp $_pkg/usr/sbin/dhcpd $fs/usr/sbin
    4.38 +	# Package all dhcp pkgs
    4.39 +	for i in $(cd $WOK; ls -d dhcp-*)
    4.40 +	do
    4.41 +		tazwok genpkg $i
    4.42 +	done
    4.43 +}
    4.44 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/dhcp6/stuff/start-without-ipv6.u	Thu Jun 11 17:11:41 2009 +0200
     5.3 @@ -0,0 +1,49 @@
     5.4 +--- dhcp-4.1.1b1/common/discover.c
     5.5 ++++ dhcp-4.1.1b1/common/discover.c
     5.6 +@@ -443,15 +443,17 @@
     5.7 + 	}
     5.8 + 
     5.9 + #ifdef DHCPv6
    5.10 +-	ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
    5.11 +-	if (ifaces->fp6 == NULL) {
    5.12 +-		log_error("Error opening '/proc/net/if_inet6' to "
    5.13 +-			  "list IPv6 interfaces; %m");
    5.14 +-		close(ifaces->sock);
    5.15 +-		ifaces->sock = -1;
    5.16 +-		fclose(ifaces->fp);
    5.17 +-		ifaces->fp = NULL;
    5.18 +-		return 0;
    5.19 ++	if (local_family == AF_INET6) {
    5.20 ++		ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
    5.21 ++		if (ifaces->fp6 == NULL) {
    5.22 ++			log_error("Error opening '/proc/net/if_inet6' to "
    5.23 ++				  "list IPv6 interfaces; %m");
    5.24 ++			close(ifaces->sock);
    5.25 ++			ifaces->sock = -1;
    5.26 ++			fclose(ifaces->fp);
    5.27 ++			ifaces->fp = NULL;
    5.28 ++			return 0;
    5.29 ++		}
    5.30 + 	}
    5.31 + #endif
    5.32 + 
    5.33 +@@ -720,7 +722,8 @@
    5.34 + 	}
    5.35 + #ifdef DHCPv6
    5.36 + 	if (!(*err)) {
    5.37 +-		return next_iface6(info, err, ifaces);
    5.38 ++		if (local_family == AF_INET6)
    5.39 ++			return next_iface6(info, err, ifaces);
    5.40 + 	}
    5.41 + #endif
    5.42 + 	return 0;
    5.43 +@@ -736,7 +739,8 @@
    5.44 + 	close(ifaces->sock);
    5.45 + 	ifaces->sock = -1;
    5.46 + #ifdef DHCPv6
    5.47 +-	fclose(ifaces->fp6);
    5.48 ++	if (local_family == AF_INET6)
    5.49 ++		fclose(ifaces->fp6);
    5.50 + 	ifaces->fp6 = NULL;
    5.51 + #endif
    5.52 + }