Dibbler is an IPv6 DHCP package

Signed-off-by: Remy Bohmer <li...@bohmer.net>
Signed-off-by: Bart vdr. Meulen <bartvdrmeu...@gmail.com>
---
 patches/dibbler-0.7.3/fix-cross-compile.patch    |   38 +++++
 patches/dibbler-0.7.3/initd-startup-script.patch |  171 ++++++++++++++++++++++
 patches/dibbler-0.7.3/merge-dns-search.patch     |   28 ++++
 patches/dibbler-0.7.3/series                     |    3 +
 rules/dibbler.in                                 |   68 +++++++++
 rules/dibbler.make                               |  116 +++++++++++++++
 rules/initmethod-bbinit.in                       |   18 +++
 rules/initmethod-bbinit.make                     |   18 +++
 8 files changed, 460 insertions(+), 0 deletions(-)
 create mode 100644 patches/dibbler-0.7.3/fix-cross-compile.patch
 create mode 100644 patches/dibbler-0.7.3/initd-startup-script.patch
 create mode 100644 patches/dibbler-0.7.3/merge-dns-search.patch
 create mode 100644 patches/dibbler-0.7.3/series
 create mode 100644 rules/dibbler.in
 create mode 100644 rules/dibbler.make

diff --git a/patches/dibbler-0.7.3/fix-cross-compile.patch 
b/patches/dibbler-0.7.3/fix-cross-compile.patch
new file mode 100644
index 0000000..58a26cf
--- /dev/null
+++ b/patches/dibbler-0.7.3/fix-cross-compile.patch
@@ -0,0 +1,38 @@
+---
+ Makefile           |    1 +
+ Port-linux/utils.c |    3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+ 
+Index: dibbler-0.7.3/Port-linux/utils.c
+===================================================================
+--- dibbler-0.7.3.orig/Port-linux/utils.c
++++ dibbler-0.7.3/Port-linux/utils.c
+@@ -14,6 +14,7 @@
+  * Rani Assaf <r...@magic.metawire.com> 980929:       resolve addresses
+  */
+ 
++#define GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+@@ -26,7 +27,7 @@
+ #include <arpa/inet.h>
+ #include <resolv.h>
+ #include <asm/types.h>
+-#include <linux/pkt_sched.h>
++/*#include <linux/pkt_sched.h>*/
+ #include <time.h>
+ #include <sys/time.h>
+ 
+Index: dibbler-0.7.3/Makefile
+===================================================================
+--- dibbler-0.7.3.orig/Makefile
++++ dibbler-0.7.3/Makefile
+@@ -428,6 +428,7 @@ install: 
+       $(INSTALL) -m 644 doc/dibbler-devel.pdf 
$(INST_DOCDIR)/dibbler/dibbler-devel.pdf
+       @echo "[INSTALL] CHANGELOG"
+       $(INSTALL) -m 644 CHANGELOG $(INST_DOCDIR)/dibbler/changelog
++      @rm -f $(INST_DOCDIR)/dibbler/changelog.gz
+       gzip -9 $(INST_DOCDIR)/dibbler/changelog
+ 
+ DIR=`basename $(PWD)`
diff --git a/patches/dibbler-0.7.3/initd-startup-script.patch 
b/patches/dibbler-0.7.3/initd-startup-script.patch
new file mode 100644
index 0000000..2e3fc34
--- /dev/null
+++ b/patches/dibbler-0.7.3/initd-startup-script.patch
@@ -0,0 +1,171 @@
+---
+ dibbler-client.init |   50 +++++++++++++++++++++++++++++++++++++++++++++
+ dibbler-relay.init  |   50 +++++++++++++++++++++++++++++++++++++++++++++
+ dibbler-server.init |   50 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 150 insertions(+)
+
+Index: dibbler-0.7.3/dibbler-client.init
+===================================================================
+--- /dev/null
++++ dibbler-0.7.3/dibbler-client.init
+@@ -0,0 +1,50 @@
++#! /bin/sh
++#
++# Starts/stops dibbler-client
++#
++
++PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
++DAEMON=/usr/sbin/dibbler-client
++NAME=dibbler-client
++DESC="DHCPv6 client"
++DAEMON_OPTS=run
++
++test -x $DAEMON || exit 0
++
++# Include dibbler defaults if available
++if [ -f /etc/default/dibbler ] ; then
++      . /etc/default/dibbler
++fi
++
++set -e
++
++case "$1" in
++  start)
++      echo -n "Starting $DESC: "
++      $DAEMON start 2>&1 > /dev/null
++      echo "$NAME."
++      ;;
++  stop)
++      echo -n "Stopping $DESC: "
++      ($DAEMON stop 2>&1 > /dev/null; true)
++      echo "$NAME."
++      ;;
++  status)
++      echo "Status $DESC: $NAME"
++      $DAEMON status
++      ;;
++  restart|force-reload)
++      echo -n "Restarting $DESC: "
++      ($DAEMON stop 2>&1 > /dev/null; true)
++      sleep 1
++      $DAEMON start 2>&1 > /dev/null
++      echo "$NAME."
++      ;;
++  *)
++      N=/etc/init.d/$NAME
++      echo "Usage: $N {start|stop|restart|force-reload}" >&2
++      exit 1
++      ;;
++esac
++
++exit 0
+Index: dibbler-0.7.3/dibbler-relay.init
+===================================================================
+--- /dev/null
++++ dibbler-0.7.3/dibbler-relay.init
+@@ -0,0 +1,50 @@
++#! /bin/sh
++#
++# Starts/stops dibbler-relay
++#
++
++PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
++DAEMON=/usr/sbin/dibbler-relay
++NAME=dibbler-relay
++DESC="DHCPv6 relay"
++DAEMON_OPTS=run
++
++test -x $DAEMON || exit 0
++
++# Include dibbler defaults if available
++if [ -f /etc/default/dibbler ] ; then
++      . /etc/default/dibbler
++fi
++
++set -e
++
++case "$1" in
++  start)
++      echo -n "Starting $DESC: "
++      $DAEMON start 2>&1 > /dev/null
++      echo "$NAME."
++      ;;
++  stop)
++      echo -n "Stopping $DESC: "
++      ($DAEMON stop 2>&1 > /dev/null; true)
++      echo "$NAME."
++      ;;
++  status)
++      echo "Status $DESC: $NAME"
++      $DAEMON status
++      ;;
++  restart|force-reload)
++      echo -n "Restarting $DESC: "
++      ($DAEMON stop 2>&1 > /dev/null; true)
++      sleep 1
++      $DAEMON start 2>&1 > /dev/null
++      echo "$NAME."
++      ;;
++  *)
++      N=/etc/init.d/$NAME
++      echo "Usage: $N {start|stop|restart|force-reload}" >&2
++      exit 1
++      ;;
++esac
++
++exit 0
+Index: dibbler-0.7.3/dibbler-server.init
+===================================================================
+--- /dev/null
++++ dibbler-0.7.3/dibbler-server.init
+@@ -0,0 +1,50 @@
++#! /bin/sh
++#
++# Starts/stops dibbler-client
++#
++
++PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
++DAEMON=/usr/sbin/dibbler-server
++NAME=dibbler-server
++DESC="DHCPv6 server"
++DAEMON_OPTS=run
++
++test -x $DAEMON || exit 0
++
++# Include dibbler defaults if available
++if [ -f /etc/default/dibbler ] ; then
++      . /etc/default/dibbler
++fi
++
++set -e
++
++case "$1" in
++  start)
++      echo -n "Starting $DESC: "
++      $DAEMON start 2>&1 > /dev/null
++      echo "$NAME."
++      ;;
++  stop)
++      echo -n "Stopping $DESC: "
++      ($DAEMON stop 2>&1 > /dev/null; true)
++      echo "$NAME."
++      ;;
++  status)
++      echo "Status $DESC: $NAME"
++      $DAEMON status
++      ;;
++  restart|force-reload)
++      echo -n "Restarting $DESC: "
++      ($DAEMON stop 2>&1 > /dev/null; true)
++      sleep 1
++      $DAEMON start 2>&1 > /dev/null
++      echo "$NAME."
++      ;;
++  *)
++      N=/etc/init.d/$NAME
++      echo "Usage: $N {start|stop|restart|force-reload}" >&2
++      exit 1
++      ;;
++esac
++
++exit 0
diff --git a/patches/dibbler-0.7.3/merge-dns-search.patch 
b/patches/dibbler-0.7.3/merge-dns-search.patch
new file mode 100644
index 0000000..22ba2a5
--- /dev/null
+++ b/patches/dibbler-0.7.3/merge-dns-search.patch
@@ -0,0 +1,28 @@
+---
+ Port-linux/lowlevel-options-linux.c |   13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+Index: dibbler-0.7.3/Port-linux/lowlevel-options-linux.c
+===================================================================
+--- dibbler-0.7.3.orig/Port-linux/lowlevel-options-linux.c
++++ dibbler-0.7.3/Port-linux/lowlevel-options-linux.c
+@@ -199,11 +199,14 @@ int domain_add(const char* ifname, int i
+       return LOWLEVEL_ERROR_FILE;
+     while (fgets(buf,511,f)) {
+       if ( (!found) && (strstr(buf, "search")) ) {
+-          if (strlen(buf))
+-              buf[strlen(buf)-1]=0;
+-          fprintf(f2, "%s %s\n", buf, domain);
+-          found = 1;
+-          continue;
++          if (!strstr(buf,domain)) {
++              if (strlen(buf))
++                  buf[strlen(buf)-1]=0;
++              fprintf(f2, "%s %s\n", buf, domain);
++              found = 1;
++              continue;
++          }
++
+       }
+       fprintf(f2,"%s",buf);
+     }
diff --git a/patches/dibbler-0.7.3/series b/patches/dibbler-0.7.3/series
new file mode 100644
index 0000000..502edb0
--- /dev/null
+++ b/patches/dibbler-0.7.3/series
@@ -0,0 +1,3 @@
+merge-dns-search.patch
+initd-startup-script.patch
+fix-cross-compile.patch
diff --git a/rules/dibbler.in b/rules/dibbler.in
new file mode 100644
index 0000000..f3b2a8a
--- /dev/null
+++ b/rules/dibbler.in
@@ -0,0 +1,68 @@
+## SECTION=networking
+
+menuconfig DIBBLER
+       tristate
+       prompt "dibbler (DHCPv6)              "
+       help
+         Dibbler is a portable DHCPv6 implementation.
+         It supports stateful (i.e. IPv6 address granting) as well as
+         stateless (i.e. option granting) autoconfiguration for IPv6.
+
+if DIBBLER
+
+config DIBBLER_SERVER
+       bool
+       prompt "Install server"
+       help
+         The Dibbler server supports both stateful (i.e. IPv6 address
+         granting) as well as stateless (i.e. options granting)
+         auto-configuration modes of the DHCPv6 protocol. Relays are also
+         supported. This package allows IPv6 hosts to be automatically
+         configured on the network.
+
+config DIBBLER_SERVER_STARTSCRIPT
+       bool
+       default y
+       prompt "install /etc/init.d/dibbler-server"
+       depends on DIBBLER_SERVER
+       help
+         Install the startup script for bbinit.
+
+config DIBBLER_CLIENT
+       bool
+       prompt "Install client"
+       help
+         The Dibbler client supports both stateful (i.e. IPv6 address
+         granting) as well as stateless (i.e. option granting)
+         auto-configuration modes of the DHCPv6 protocol. Besides basic
+         capabilities, it supports various DHCPv6 extensions, for instance
+         option renewal. Installing Dibbler allows obtaining IPv6 addresses and
+         options from a DHCPv6 server.
+
+config DIBBLER_CLIENT_STARTSCRIPT
+       bool
+       default y
+       prompt "install /etc/init.d/dibbler-client"
+       depends on DIBBLER_CLIENT
+       help
+         Install the startup script for bbinit.
+
+config DIBBLER_RELAY
+       bool
+       prompt "Install relay"
+       help
+         Relays are used as proxies between servers and clients. Their main
+         advantage is the ability to support multiple remote links using only
+         one server. Installing Dibbler relay allows serving multiple, not
+         physically connected, links with one DHCPv6 server.
+
+config DIBBLER_RELAY_STARTSCRIPT
+       bool
+       default y
+       prompt "install /etc/init.d/dibbler-relay"
+       depends on DIBBLER_RELAY
+       help
+         Install the startup script for bbinit.
+
+endif
+
diff --git a/rules/dibbler.make b/rules/dibbler.make
new file mode 100644
index 0000000..f8eb1f3
--- /dev/null
+++ b/rules/dibbler.make
@@ -0,0 +1,116 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2010 by Remy Bohmer <li...@bohmer.net>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_DIBBLER) += dibbler
+
+#
+# Paths and names
+#
+DIBBLER_VERSION        := 0.7.3
+DIBBLER                := dibbler-$(DIBBLER_VERSION)
+DIBBLER_SUFFIX := tar.gz
+DIBBLER_URL    := 
http://klub.com.pl/dhcpv6/dibbler/$(DIBBLER)-src.$(DIBBLER_SUFFIX)
+DIBBLER_SOURCE := $(SRCDIR)/$(DIBBLER)-src.$(DIBBLER_SUFFIX)
+DIBBLER_DIR    := $(BUILDDIR)/$(DIBBLER)
+DIBBLER_LICENSE        := GPLv2
+
+# ----------------------------------------------------------------------------
+# Get
+# ----------------------------------------------------------------------------
+
+$(DIBBLER_SOURCE):
+       @$(call targetinfo)
+       @$(call get, DIBBLER)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+DIBBLER_MAKE_ENV := $(CROSS_ENV_CC) $(CROSS_ENV_CXX)
+DIBBLER_MAKE_PAR := NO
+
+#
+# autoconf
+#
+# Remove the pre-configure of a sub-component, so configure is
+# called in make for correct cross-compilation
+$(STATEDIR)/dibbler.prepare:
+       @$(call targetinfo)
+       @rm -f $(DIBBLER_DIR)/poslib/config.h
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+DIBBLER_INSTALL_OPT := \
+       INST_WORKDIR=$(DIBBLER_PKGDIR)/var/lib/dibbler \
+       INST_MANDIR=$(DIBBLER_PKGDIR)/usr/share/man \
+       INST_DOCDIR=$(DIBBLER_PKGDIR)/usr/share/doc \
+       INST_BINDIR=$(DIBBLER_PKGDIR)/usr/sbin \
+       INST_CONFDIR=$(DIBBLER_PKGDIR)/etc/dibbler \
+       install
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/dibbler.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init,  dibbler)
+       @$(call install_fixup, dibbler,PACKAGE,dibbler)
+       @$(call install_fixup, dibbler,PRIORITY,optional)
+       @$(call install_fixup, dibbler,VERSION,$(DIBBLER_VERSION))
+       @$(call install_fixup, dibbler,SECTION,base)
+       @$(call install_fixup, dibbler,AUTHOR,"Remy Bohmer <li...@bohmer.net>")
+       @$(call install_fixup, dibbler,DEPENDS,)
+       @$(call install_fixup, dibbler,DESCRIPTION,missing)
+
+       @$(call install_copy, dibbler, 0, 0, 0755, /etc/dibbler)
+       @$(call install_copy, dibbler, 0, 0, 0755, /var/lib/dibbler)
+       @$(call install_copy, dibbler, 0, 0, 0755, /var/log/dibbler)
+
+ifdef PTXCONF_DIBBLER_SERVER
+       @$(call install_copy, dibbler, 0, 0, 0755, -, /usr/sbin/dibbler-server)
+       @$(call install_copy, dibbler, 0, 0, 0644, -, /etc/dibbler/server.conf)
+       @$(call install_alternative, dibbler, 0, 0, 0644 
/etc/dibbler/server-stateless.conf)
+endif
+
+ifdef PTXCONF_DIBBLER_SERVER_STARTSCRIPT
+       @$(call install_copy, dibbler, 0, 0, 0755, 
$(DIBBLER_DIR)/dibbler-server.init, /etc/init.d/dibbler-server)
+endif
+
+ifdef PTXCONF_DIBBLER_CLIENT
+       @$(call install_copy, dibbler, 0, 0, 0755, -, /usr/sbin/dibbler-client)
+       @$(call install_alternative, dibbler, 0, 0, 0644, 
/etc/dibbler/client.conf)
+       @$(call install_alternative, dibbler, 0, 0, 0644, 
/etc/dibbler/client-stateless.conf)
+endif
+
+ifdef PTXCONF_DIBBLER_CLIENT_STARTSCRIPT
+       @$(call install_copy, dibbler, 0, 0, 0755, 
$(DIBBLER_DIR)/dibbler-client.init, /etc/init.d/dibbler-client)
+endif
+
+ifdef PTXCONF_DIBBLER_RELAY
+       @$(call install_copy, dibbler, 0, 0, 0755, -, /usr/sbin/dibbler-relay)
+       @$(call install_alternative, dibbler, 0, 0, 0644, -, 
/etc/dibbler/relay.conf)
+endif
+
+ifdef PTXCONF_DIBBLER_RELAY_STARTSCRIPT
+       @$(call install_copy, dibbler, 0, 0, 0755, 
$(DIBBLER_DIR)/dibbler-relay.init, /etc/init.d/dibbler-relay)
+endif
+
+       @$(call install_finish, dibbler)
+       @$(call touch)
+
+# vim: syntax=make
diff --git a/rules/initmethod-bbinit.in b/rules/initmethod-bbinit.in
index a7f1147..967d02e 100644
--- a/rules/initmethod-bbinit.in
+++ b/rules/initmethod-bbinit.in
@@ -303,6 +303,24 @@ config INITMETHOD_BBINIT_LINK_SYSCTL
        prompt "sysctl"
        default "S17sysctl"
 
+config INITMETHOD_BBINIT_LINK_DIBBLER_SERVER
+        string
+        depends on DIBBLER_SERVER_STARTSCRIPT
+        prompt "dibbler-server"
+        default "S27dibbler-server"
+
+config INITMETHOD_BBINIT_LINK_DIBBLER_CLIENT
+        string
+        depends on DIBBLER_CLIENT_STARTSCRIPT
+        prompt "dibbler-client"
+        default "S27dibbler-client"
+
+config INITMETHOD_BBINIT_LINK_DIBBLER_RELAY
+        string
+        depends on DIBBLER_RELAY_STARTSCRIPT
+        prompt "dibbler-relay"
+        default "S27dibbler-relay"
+
 endmenu
 
 endif
diff --git a/rules/initmethod-bbinit.make b/rules/initmethod-bbinit.make
index d435fcb..04dfd00 100644
--- a/rules/initmethod-bbinit.make
+++ b/rules/initmethod-bbinit.make
@@ -369,6 +369,24 @@ ifneq ($(call 
remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_SYSCTL)),)
                /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_SYSCTL))
 endif
 
+ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_SERVER)),)
+        @$(call install_link, initmethod-bbinit, \
+                ../init.d/dibbler-server, \
+                /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_SERVER))
+endif
+
+ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_CLIENT)),)
+        @$(call install_link, initmethod-bbinit, \
+                ../init.d/dibbler-client, \
+                /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_CLIENT))
+endif
+
+ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_RELAY)),)
+        @$(call install_link, initmethod-bbinit, \
+                ../init.d/dibbler-relay, \
+                /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_RELAY))
+endif
+
 ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_FAKE_OVERLAYFS)),)
        @$(call install_link, initmethod-bbinit, \
                ../init.d/fake-overlayfs, \
-- 
1.7.0.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to