--- dhcdbd-2.0.orig/debian/dhcdbd.postinst +++ dhcdbd-2.0/debian/dhcdbd.postinst @@ -0,0 +1,60 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was installed: +# configure +# +# +# If prerm fails during upgrade or fails on failed upgrade: +# abort-upgrade +# +# If prerm fails during deconfiguration of a package: +# abort-deconfigure in-favour +# removing +# +# If prerm fails during replacement due to conflict: +# abort-remove in-favour + + +# Remove a no-longer used conffile +rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE".dpkg-remove ]; then + echo "Removing obsolete conffile $CONFFILE" + rm -f "$CONFFILE".dpkg-remove + fi +} + + +case "$1" in + configure) + # Upgrade from previous versions + if dpkg --compare-versions "$2" lt "2.0-4"; then + rm_conffile /etc/dbus-1/event.d/22dhcdbd + fi + + # finish the dhcdbd -> zzzz_dhcdbd rename on upgrades + F=/etc/dhcp3/dhclient-exit-hooks.d/dhcdbd.moved-by-preinst + if dpkg --compare-versions "$2" le-nl "2.0-2ubuntu2" && [ -e $F ]; then + rm -f $F + fi + + if [ -x "/etc/init.d/dbus" ]; then + invoke-rc.d dbus force-reload || true + fi + ;; + + abort-upgrade|abort-deconfigure|abort-remove) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 + --- dhcdbd-2.0.orig/debian/dhcdbd.manpages +++ dhcdbd-2.0/debian/dhcdbd.manpages @@ -0,0 +1 @@ +debian/dhcdbd.1 --- dhcdbd-2.0.orig/debian/control +++ dhcdbd-2.0/debian/control @@ -0,0 +1,18 @@ +Source: dhcdbd +Section: admin +Priority: optional +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Riccardo Setti +Uploaders: Sjoerd Simons , Utopia Maintenance Team , Michael Biebl +Build-Depends: debhelper (>= 5.0.0), cdbs, libdbus-1-dev (>= 0.60) +Standards-Version: 3.7.2 +XS-Vcs-Svn: svn://svn.debian.org/svn/pkg-utopia/packages/unstable/dhcdbd +XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/dhcdbd + +Package: dhcdbd +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, dhcp3-client, dbus (>= 0.60), lsb-base (>= 3.0-6) +Description: D-Bus interface to the ISC DHCP client + dhcdbd provides a D-Bus interface to dhclient, the DHCP client from ISC, + so applications such as NetworkManager can query and control dhclient. + This allows an application-neutral interface for such operations --- dhcdbd-2.0.orig/debian/dhcdbd.docs +++ dhcdbd-2.0/debian/dhcdbd.docs @@ -0,0 +1 @@ +README --- dhcdbd-2.0.orig/debian/dhcdbd.init +++ dhcdbd-2.0/debian/dhcdbd.init @@ -0,0 +1,75 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: dhcdbd +# Required-Start: $local_fs dbus +# Required-Stop: $local_fs dbus +# Should-Start: $syslog +# Should-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: DHCP D-Bus manager +# Description: dhcdbd provides a D-DBus interface to dhclient, +# the DHCP client from ISC. +### END INIT INFO +# +# DHCP D-Bus daemon +# +# Author: Michael Biebl +# + +set -e + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DESC="DHCP D-Bus daemon" +NAME="dhcdbd" +DAEMON=/usr/sbin/$NAME +DAEMON_OPTS=--system +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service. +# +d_start() { + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --exec $DAEMON -- $DAEMON_OPTS +} + +# +# Function that stops the daemon/service. +# +d_stop() { + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --oknodo --retry 60 --exec $DAEMON +} + + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + d_start + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + d_stop + log_end_msg $? + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + d_stop + d_start + log_end_msg $? + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- dhcdbd-2.0.orig/debian/rules +++ dhcdbd-2.0/debian/rules @@ -0,0 +1,17 @@ +#! /usr/bin/make -f + + +include /usr/share/cdbs/1/class/makefile.mk +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk + +DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/dhcdbd/ +DEB_MAKE_INVOKE = $(MAKE) +DEB_DH_INSTALLINIT_ARGS := -- start 24 2 3 4 5 . stop 16 0 1 6 . + +binary-install/dhcdbd:: + + install -d $(CURDIR)/debian/dhcdbd/etc/dhcp3/dhclient-exit-hooks.d/ + install -m 644 $(CURDIR)/debian/dhcdbd.dhcp3 \ + $(CURDIR)/debian/dhcdbd/etc/dhcp3/dhclient-exit-hooks.d/zzzz_dhcdbd + --- dhcdbd-2.0.orig/debian/watch +++ dhcdbd-2.0/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://people.redhat.com/dcantrel/dhcdbd/dhcdbd-([\d\.]*).tar.bz2 --- dhcdbd-2.0.orig/debian/dhcdbd.postrm +++ dhcdbd-2.0/debian/dhcdbd.postrm @@ -0,0 +1,91 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was removed: +# remove +# +# After the package was purged: +# purge +# +# After the package was upgraded: +# upgrade +# if that fails: +# failed-upgrade +# +# +# After all of the packages files have been replaced: +# disappear +# +# +# If preinst fails during install: +# abort-install +# +# If preinst fails during upgrade of removed package: +# abort-install +# +# If preinst fails during upgrade: +# abort-upgrade + + +# Undo removal of a no-longer used conffile +undo_rm_conffile() +{ + CONFFILE="$1" + + if [ ! -e "$CONFFILE" ]; then + if [ -e "$CONFFILE".dpkg-bak ]; then + echo "Restoring modified conffile $CONFFILE" + mv -f "$CONFFILE".dpkg-bak "$CONFFILE" + elif [ -e "$CONFFILE".dpkg-remove ]; then + echo "Restoring conffile $CONFFILE" + mv -f "$CONFFILE".dpkg-remove "$CONFFILE" + fi + fi +} + + +# Purge backup conffile +rm_backup_conffile() +{ + CONFFILE="$1" + if [ -e "$CONFFILE".dpkg-bak ]; then + echo "Purging backup of conffile $CONFFILE" + rm -f "$CONFFILE".dpkg-bak + fi +} + + +case "$1" in + remove) + ;; + + purge) + rm_backup_conffile /etc/dbus-1/event.d/22dhcdbd + ;; + + upgrade|failed-upgrade|disappear) + ;; + + abort-install|abort-upgrade) + # Abort upgrade from previous versions + if dpkg --compare-versions "$2" lt "2.0-4"; then + undo_rm_conffile /etc/dbus-1/event.d/22dhcdbd + fi + # do the dhcdbd -> zzzz_dhcdbd rename on upgrades + if dpkg --compare-versions "$2" le-nl "2.0-2ubuntu2"; then + F=/etc/dhcp3/dhclient-exit-hooks.d/dhcdbd + if [ -e $F.moved-by-preinst ]; then + mv -f $F.moved-by-preinst $F + fi + fi + + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- dhcdbd-2.0.orig/debian/changelog +++ dhcdbd-2.0/debian/changelog @@ -0,0 +1,262 @@ +dhcdbd (2.0-5ubuntu1) gutsy; urgency=low + + * Merge to Debian unstable. Remaining Ubuntu changes: + - debian/rules: Install dhclient-exit-hook.d script as 'zzzz_dhcdbd' + instead of 'dhcdbd', so that it is ran as last script. + Otherwise it gets called before 'zzz_avahi-autoipd' and thus + network-manager doesn't pick up the fact that + avahi-autoipd is running on the interface. + - debian/dhcdbd.{preinst,postinst,postrm}: Do the renaming on upgrades, + take care to avoid the dpkg conffile question if the script was not + modified, and gracefully handle aborted upgrades. This needs to be kept + until the next LTS. + - debian/dhcdbd.{preinst,postinst,postrm}: Change the event.d -> init.d + migration from 24dhcdbd to 22dhcdbd, since we used the latter priority + in Ubuntu. This needs to be kept until the next LTS. + + -- Martin Pitt Tue, 12 Jun 2007 15:49:57 +0200 + +dhcdbd (2.0-5) unstable; urgency=low + + * debian/patches/50-dynamic-timeout.patch + - Prevent high frequency polling in the main loop by using a + dynamic timeout. This should allow longer periods of sleep with a + dyntick enabled kernel. (Closes: #425500, #424030) + Patch by Keith Packard. + + -- Michael Biebl Tue, 22 May 2007 23:14:28 +0200 + +dhcdbd (2.0-4) unstable; urgency=low + + * Install the dhcdbd start script as regular SysV init script + - Rename debian/dhcdbd.dbus-event to debian/dhcdbd.init. + - Add proper LSB header to debian/dhcdbd.init + - debian/rules + + Don't install /etc/dbus-1/event.d/24dhcdbd anymore. + + Set DEB_DH_INSTALLINIT_ARGS to start at 24 and stop at 16. + - debian/dhcdbd.{preinst,postinst,postrm} + + Remove the old conffile /etc/dbus-1/event.d/24dhcdbd on upgrade. If it + was modified locally, rename it to *.dpkg-bak instead. + - debian/dhcdbd.prerm + + Removed. Stopping dhcdbd in prerm is now automatically added by + dh_installinit. + + -- Michael Biebl Wed, 25 Apr 2007 00:51:45 +0200 + +dhcdbd (2.0-3) unstable; urgency=low + + [ Riccardo Setti ] + * Added debian/patches/30-pid-file-mode.patch: + - Create pid file with sane mode. (thank you slomo) + * Added debian/patches/40-dbus-connection.patch: + - Unref shared connections, don't close them. (thank you slomo) + + [ Michael Biebl ] + * Add XS-Vcs-* fields to debian/control. + + -- Michael Biebl Mon, 5 Mar 2007 21:03:51 +0100 + +dhcdbd (2.0-2ubuntu4) gutsy; urgency=low + + * Remove the fixed timeout and replace it with a dynamic one + + -- Matthew Garrett Mon, 14 May 2007 20:06:20 +0100 + +dhcdbd (2.0-2ubuntu3) feisty; urgency=low + + * Rebuild for changes in the amd64 toolchain. + * Set Ubuntu maintainer address. + + -- Matthias Klose Mon, 5 Mar 2007 01:14:57 +0000 + +dhcdbd (2.0-2ubuntu2) feisty; urgency=low + + * debian/rules: Install DHCP exit hook as 'zzzz_dhcdbd', so that it is + really the last script called. Otherwise it gets called before + 'zzz_avahi-autoipd' and thus network-manager doesn't pick up the fact that + avahi-autoipd is running on the interface. + * debian/dhcdbd.{preinst,postinst,postrm}: Do the renaming on upgrades, take + care to avoid the dpkg conffile question if the script was not modified, + and gracefully handle aborted upgrades. + + -- Martin Pitt Wed, 6 Dec 2006 18:58:42 +0100 + +dhcdbd (2.0-2ubuntu1) feisty; urgency=low + + * Sync with Debian: + + debian/dhcdbd.postinst: + - move dbus event from 24 to 22 to save migration headache + + debian/patches/30-pid-file-mode.patch: + - Create pid file with sane mode + + debian/control: + - Tighten dhcp3-client dependency + * debian/patches/40-dbus-connection.patch: + + Unref shared connections, don't close them... + + -- Sebastian Dröge Wed, 29 Nov 2006 08:33:08 +0100 + +dhcdbd (2.0-2) unstable; urgency=low + + * Don't use "exit" in dhcp hook script (Closes: #392048). + * Fix a small typo in package description (Closes: #393544). + * Drop dependency on adduser and the creation of group netdev in postinst. + Not needed anymore. + * debian/dhcdbd.prerm + - Added, stop dhcdbd service on package removal. + + -- Michael Biebl Tue, 24 Oct 2006 14:14:10 +0200 + +dhcdbd (2.0-1) unstable; urgency=low + + * New upstream release. + * debian/patches/40_dbus0.9.patch + - Removed, fixed upstream. + * debian/patches/04-dhcdbd_conf_netdev_group.patch + - Removed, not actually needed. + * Improved the init script, added a dependency on lsb-base (>= 3.0-6). + * Use the term D-Bus consistently in the man page and package description. + * Updated the watch file. + + -- Michael Biebl Thu, 28 Sep 2006 19:20:10 +0200 + +dhcdbd (1.14-3) unstable; urgency=low + + * Changed a deprecated dbus function (closes: #385383) + - added 40_dbus0.9.patch + + -- Riccardo Setti Tue, 5 Sep 2006 19:42:19 +0200 + +dhcdbd (1.14-2ubuntu2) edgy; urgency=low + + * Rebuild against dbus 0.90 + * debian/patches/40_dbus0.9.patch: + + s/dbus_connection_disconnect/dbus_connection_close/g + + -- Sebastian Dröge Thu, 24 Aug 2006 17:33:56 +0200 + +dhcdbd (1.14-2ubuntu1) edgy; urgency=low + + * Merge with debian unstable, using their packaging as a base. + Remaining changes: + - move dbus event from 24 to 22 to save migration headache, + - drop netdev group, + - create pid file with useful mode. + + -- Scott James Remnant Wed, 12 Jul 2006 15:11:17 +0100 + +dhcdbd (1.14-2) unstable; urgency=low + + * Bumped Standards-Version to 3.7.2, no further changes required. + * Bumped debhelper compatibility to 5. + * Added a dependency on adduser. + + -- Michael Biebl Tue, 20 Jun 2006 22:57:04 +0200 + +dhcdbd (1.14-1) unstable; urgency=low + + * New upstream version. + * Bumped Standards-Version to 3.7.0, no further changes required. + + -- Michael Biebl Mon, 1 May 2006 23:50:10 +0200 + +dhcdbd (1.12-3) unstable; urgency=low + + * Used a more consistent naming scheme for the patches in debian/patches. + * Merged 03.dhcdbd.service.patch and 02_makefile.patch into + 02-dhcdbd_location.patch. + + -- Michael Biebl Wed, 5 Apr 2006 13:23:22 +0200 + +dhcdbd (1.12-2) unstable; urgency=low + + * NetworkManager does not start dhcdbd on its own anymore since 0.6.2. + So install a init script in dbus-1/event.d/24dhcdbd which starts before + NetworkManager. + * Update postinst to restart the service on configure. + + -- Michael Biebl Tue, 28 Mar 2006 12:42:44 +0200 + +dhcdbd (1.12-1) unstable; urgency=low + + * New upstream release + - removed 01-dbus_60.patch + + [ Michael Biebl ] + * Correctly apply the 01_fix_some_debian_path patch. + * Added a watch file. + + [ Riccardo Setti ] + * Improved description. (closes: #350888) + * modifyed dhcdbd.conf, now it will use as valid group 'netdev'. (closes: #351454) + - added debian/patches/03_dhcdbd.conf + * added the creation of netdev group in dhcdbd.postinst. + + -- Riccardo Setti Sun, 12 Feb 2006 10:37:52 +0100 + +dhcdbd (1.10-1) unstable; urgency=low + + * Initial upload to Debian (Closes: #348309) + * based on the ubuntu work + + -- Riccardo Setti Mon, 5 Jan 2006 17:11:07 +0100 + +dhcdbd (1.10-0ubuntu3) dapper; urgency=low + + * debian/control: + - Add binary dep on dbus (>= 0.60), Malone #2950. + + -- Christian Bjälevik Mon, 2 Jan 2006 13:11:07 +0100 + +dhcdbd (1.10-0ubuntu2) dapper; urgency=low + + * debian/control: + - Version Build-Dep on libdbus-1-dev to (>= 0.60). + * debian/patches/01-dbus_60: + - Add a patch to fix FTBFS. No patchsystem, only applied it. + + -- Christian Bjälevik Wed, 21 Dec 2005 19:03:12 +0100 + +dhcdbd (1.10-0ubuntu1) dapper; urgency=low + + * New upstream release + * debian/rules: + - Make us lintian clean + - Add dh_strip + + -- Christian Bjälevik Sat, 19 Nov 2005 15:54:05 +0100 + +dhcdbd (1.9-0ubuntu1) breezy; urgency=low + + * new upstream version + + -- Jan Gerber Sun, 23 Oct 2005 20:51:35 -0400 + +dhcdbd (1.8-0ubuntu1) breezy; urgency=low + + * new upstream version + - improve security with system.d/dhcdbd.conf: + allow only root,bind user to send to dhcdbd + * change DHCDBD_DHCLIENT_LEASE_DIR to point to /var/lib/dhcp3/ + * add dhcp3-client to Depends + + + -- Jan Gerber Fri, 9 Sep 2005 13:05:35 +0200 + +dhcdbd (1.6-0ubuntu2) breezy; urgency=low + + * Change definitions of lease and pid files to debian defaults + + -- Thom May Tue, 14 Jun 2005 18:04:16 +0100 + +dhcdbd (1.6-0ubuntu1) breezy; urgency=low + + * New upstream release. Add license, sort out permissions - thanks AJ for + the cluestick application. + + -- Thom May Wed, 8 Jun 2005 12:32:44 +0100 + +dhcdbd (1.5-1) breezy; urgency=low + + * First upload. + + -- Thom May Tue, 17 May 2005 12:00:46 +0000 --- dhcdbd-2.0.orig/debian/compat +++ dhcdbd-2.0/debian/compat @@ -0,0 +1 @@ +5 --- dhcdbd-2.0.orig/debian/patches/50-dynamic-timeout.patch +++ dhcdbd-2.0/debian/patches/50-dynamic-timeout.patch @@ -0,0 +1,69 @@ +diff -ur dhcdbd-2.0.bak/src/dbus_service.c dhcdbd-2.0/src/dbus_service.c +--- dhcdbd-2.0.bak/src/dbus_service.c 2007-05-14 20:02:41.000000000 +0100 ++++ dhcdbd-2.0/src/dbus_service.c 2007-05-14 20:05:23.000000000 +0100 +@@ -976,6 +976,51 @@ + twalk(cs->timeouts, process_timeout); + } + ++static float next_timeout; ++ ++static void find_timeout (const void *p, const VISIT which, const int level) { ++ DBusConnectionState *cs; ++ const void *const *tpp = p; ++ DBusConnectionTimeout *to; ++ struct timeval tv; ++ float now, then, interval, timeout; ++ ++ gettimeofday(&tv, 0L); ++ ++ if ((tpp != 0L) && (*tpp != 0L) && ((which == postorder) || (which == leaf))) { ++ to = (DBusConnectionTimeout *) * tpp; ++ cs = to->cs; ++ ++ if (!dbus_timeout_get_enabled(to->to)) ++ return; ++ ++ cs = dbus_timeout_get_data(to->to); ++ then = ((float) to->tv.tv_sec) + (((float) to->tv.tv_usec) / 1000000.0); ++ ++ if (then != 0.0) { ++ interval = ((float) dbus_timeout_get_interval(to->to)) / 1000.0; ++ now = ((float) tv.tv_sec) + (((float) tv.tv_usec) / 1000000.0); ++ ++ timeout = then + interval - now; ++ if (timeout < 0) ++ timeout = 0; ++ if (next_timeout < 0 || timeout < next_timeout) ++ next_timeout = timeout; ++ } ++ } ++} ++ ++static struct timeval *find_next_timeout (DBusConnectionState * cs, struct timeval *tv) { ++ next_timeout = 1; ++ twalk(cs->timeouts, find_timeout); ++ printf ("next timeout %f\n", next_timeout); ++ if (next_timeout == -1) ++ return NULL; ++ tv->tv_sec = next_timeout; ++ tv->tv_usec = (next_timeout - tv->tv_sec) * 1000000; ++ return tv; ++} ++ + static void set_watch_fds(DBusWatch * watch, DBusConnectionState * cs) { + uint8_t flags = dbus_watch_get_flags(watch); + int fd = dbus_watch_get_fd(watch); +@@ -1147,10 +1192,8 @@ + cs->s_w_fds = cs->w_fds; + cs->s_e_fds = cs->e_fds; + +- timeout.tv_sec = 0; +- timeout.tv_usec = 200000; +- +- if ((n_fds = select(cs->n, &(cs->s_r_fds), &(cs->s_w_fds), &(cs->s_e_fds), &timeout)) < 0) { ++ if ((n_fds = select(cs->n, &(cs->s_r_fds), &(cs->s_w_fds), ++ &(cs->s_e_fds), find_next_timeout (cs, &timeout))) < 0) { + if (errno != EINTR) { + if (cs->eh != 0L) + (*(cs->eh)) ("select failed: %d : %s", errno, strerror(errno)); +Only in dhcdbd-2.0/src: dbus_service.c.orig --- dhcdbd-2.0.orig/debian/patches/40-dbus-connection.patch +++ dhcdbd-2.0/debian/patches/40-dbus-connection.patch @@ -0,0 +1,20 @@ +--- src/dbus_service.c.old 2006-11-29 08:32:03.390681525 +0100 ++++ src/dbus_service.c 2006-11-29 08:32:18.847562363 +0100 +@@ -1216,7 +1216,7 @@ + return (cs); + + give_up: +- dbus_connection_close(connection); ++ dbus_connection_unref(connection); + dbus_shutdown(); + + return (0L); +@@ -1250,7 +1250,7 @@ + tdestroy(cs->roots, free_root); + cs->roots = 0L; + +- dbus_connection_close(cs->connection); ++ dbus_connection_unref(cs->connection); + dbus_shutdown(); + free(cs); + } --- dhcdbd-2.0.orig/debian/patches/03-remove_extended_options_from_dhcdbd.patch +++ dhcdbd-2.0/debian/patches/03-remove_extended_options_from_dhcdbd.patch @@ -0,0 +1,11 @@ +--- include/dhcdbd.h 2006-01-13 21:25:33.000000000 +0100 ++++ include/dhcdbd.h.new 2006-01-13 21:25:16.000000000 +0100 +@@ -58,7 +58,7 @@ + #define DHCDBD_DHCLIENT_CONF_SFX ".conf" + #endif + #ifndef DHCLIENT_EXTENDED_OPTION_ENVIRONMENT +-#define DHCLIENT_EXTENDED_OPTION_ENVIRONMENT 1 ++#define DHCLIENT_EXTENDED_OPTION_ENVIRONMENT 0 + #endif + + #define DHCDBD_INTERFACE_TEXT "text" --- dhcdbd-2.0.orig/debian/patches/02-dhcdbd_location.patch +++ dhcdbd-2.0/debian/patches/02-dhcdbd_location.patch @@ -0,0 +1,22 @@ +--- dhcdbd.service.orig 2005-11-17 03:36:00.000000000 +0100 ++++ dhcdbd.service 2006-01-23 17:43:27.000000000 +0100 +@@ -1,3 +1,3 @@ + [D-BUS Service] + Name=com.redhat.dhcp +-Exec=/sbin/dhcdbd ++Exec=/usr/sbin/dhcdbd +--- Makefile.orig 2006-09-28 19:49:47.000000000 +0200 ++++ Makefile 2006-09-28 19:53:15.000000000 +0200 +@@ -22,10 +22,10 @@ + -rm -f *.tar.bz2 + + install: dhcdbd +- mkdir -p $(DESTDIR)/sbin ++ mkdir -p $(DESTDIR)/usr/sbin + mkdir -p $(DESTDIR)/usr/share/dbus-1/services + mkdir -p $(DESTDIR)/etc/dbus-1/system.d +- install -m 0755 src/dhcdbd $(DESTDIR)/sbin/dhcdbd ++ install -m 0755 src/dhcdbd $(DESTDIR)/usr/sbin/dhcdbd + install -m 0644 dhcdbd.conf $(DESTDIR)/etc/dbus-1/system.d/dhcdbd.conf + install -m 0644 dhcdbd.service $(DESTDIR)/usr/share/dbus-1/services/dhcdbd.service + --- dhcdbd-2.0.orig/debian/patches/30-pid-file-mode.patch +++ dhcdbd-2.0/debian/patches/30-pid-file-mode.patch @@ -0,0 +1,11 @@ +--- src/dhcdbd.c.old 2006-11-29 08:30:41.870035929 +0100 ++++ src/dhcdbd.c 2006-11-29 08:30:51.314574140 +0100 +@@ -2830,7 +2830,7 @@ + return (1); + } + unlink (DHCDBD_PID_FILE); +- if ((fd = open (DHCDBD_PID_FILE, O_WRONLY | O_CREAT)) == -1) ++ if ((fd = open (DHCDBD_PID_FILE, O_WRONLY | O_CREAT, 0644)) == -1) + exit (errno); + l = sprintf (path, "%u", getpid ()); + l = write (fd, path, l); --- dhcdbd-2.0.orig/debian/patches/01-debian_specific_paths.patch +++ dhcdbd-2.0/debian/patches/01-debian_specific_paths.patch @@ -0,0 +1,25 @@ +--- include/dhcdbd.h.orig 2006-08-24 18:34:47.000000000 +0200 ++++ include/dhcdbd.h 2006-09-28 19:48:59.000000000 +0200 +@@ -40,11 +40,11 @@ + #endif + + #ifndef DHCDBD_DHCLIENT_LEASE_DIR +-#define DHCDBD_DHCLIENT_LEASE_DIR "/var/lib/dhclient/" ++#define DHCDBD_DHCLIENT_LEASE_DIR "/var/lib/dhcp3/" + #endif + + #ifndef DHCDBD_DHCLIENT_LEASE_PFX +-#define DHCDBD_DHCLIENT_LEASE_PFX "dhclient-" ++#define DHCDBD_DHCLIENT_LEASE_PFX "dhclient." + #endif + + #ifndef DHCDBD_DHCLIENT_LEASE_SFX +@@ -56,7 +56,7 @@ + #endif + + #ifndef DHCDBD_DHCLIENT_PID_PFX +-#define DHCDBD_DHCLIENT_PID_PFX "/var/run/dhclient-" ++#define DHCDBD_DHCLIENT_PID_PFX "/var/run/dhclient." + #endif + + #ifndef DHCDBD_DHCLIENT_PID_SFX --- dhcdbd-2.0.orig/debian/copyright +++ dhcdbd-2.0/debian/copyright @@ -0,0 +1,24 @@ +This package was debianized by Thom May on +Tue, 17 May 2005 12:00:46 +0000. + +It was downloaded from http://people.redhat.com/jvdias/dhcdbd/ + +Copyright: + +Upstream Author: Jason Vas Dias + +License: + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +On Debian GNU/Linux systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL or in the dhcdbd +source as the file LICENSE --- dhcdbd-2.0.orig/debian/dhcdbd.dhcp3 +++ dhcdbd-2.0/debian/dhcdbd.dhcp3 @@ -0,0 +1,11 @@ +# if we are called by dhcdbd, push the information acquired by dhclient back to dhcdbd +if [ -n "${dhc_dbus}" ]; then + /usr/bin/dbus-send \ + --system \ + --dest=com.redhat.dhcp \ + --type=method_call \ + /com/redhat/dhcp/$interface \ + com.redhat.dhcp.set \ + 'string:'"`env | /bin/egrep -v '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"; +fi; + --- dhcdbd-2.0.orig/debian/dhcdbd.1 +++ dhcdbd-2.0/debian/dhcdbd.1 @@ -0,0 +1,91 @@ +.\"Generated by db2man.xsl. Don't modify this, modify the source. +.de Sh \" Subsection +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Ip \" List item +.br +.ie \\n(.$>=3 .ne \\$3 +.el .ne 3 +.IP "\\$1" \\$2 +.. +.TH "DHCDBD" 1 "" "" "" +giskard@autistici\&.org Riccardo Setti Copyright \(co 2006 +.Sp +January, 16 2006 +.SH NAME +dhcdbd \- program to return dhcp configuration +.SH "SYNOPSIS" +.ad l +.hy 0 +.HP 7 +\fBdhcdbd\fR [\fB\-\-system\fR] [\fB\-\-session\fR] [\fB\-\-no\-daemon\fR] [\fB\-\-dest\fR\fIVAR\fR] [\fB\-\-path\fIVAR\fR\fR] [\fB\-\-prefix=\fIVAR\fR\fR] +.ad +.hy + +.SH "DESCRIPTION" + +.PP +\fBdhcdbd\fR is designed to be started as a D\-Bus service from a service description file, by default /usr/share/dbus\-1/services/dhcdbd\&.service; + +.PP +hence the default bus it will connect to is the "STARTER" bus, and it must be installed setuid to root\&. + +.SH "OPTIONS" + +.TP +\fB\-\-system\fR +use system bus + +.TP +\fB\-\-session\fR +use session bus + +.TP +\fB\-\-no\-daemon\fR +do not fork / daemonize: stay in foreground + +.TP +\fB\-\-dest\fR +set connection destination \- default: 'com\&.redhat\&.dhcp' + +.TP +\fB\-\-path\fR +set object path prefix \- default: '/com/redhat/dhcp' + +.TP +\fB\-\-prefix\fR +set interface prefix \- default: 'com\&.redhat\&.dhcp' + +.SH "EXAMPLES" + +.PP +Here are some examples using dbus\-send to contact dhcdbd: + +.nf + + \fB/usr/bin/dbus\-send \-\-dest=com\&.redhat\&.dhcp \-\-type=method_call \\ + \-\-print\-reply \-\-reply\-timeout=20000 \\ + /com/redhat/dhcp/eth0 \\ + com\&.redhat\&.dhcp\&.up uint32:7 uint32:2 +.PP +Brings up interface eth0, telling dhclient-script not to modify resolv.conf, +perform ifconfigs, or modify routes, but TO configure ntp.conf, ntp/step-tickers +and yp.conf. +When this interface is brought down, the lease is to be released. +.fi +.SH "SEE ALSO" +/usr/share/doc/dhcdbd/README +.SH "LICENSE" + +.PP +This manual page was written by Riccardo Setti \&. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&. + --- dhcdbd-2.0.orig/debian/dhcdbd.preinst +++ dhcdbd-2.0/debian/dhcdbd.preinst @@ -0,0 +1,76 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# Before the package is installed: +# install +# +# Before removed package is upgraded: +# install +# +# Before the package is upgraded: +# upgrade +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# abort-upgrade + + +# Prepare to remove a no-longer used conffile +prep_rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak" + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + mv -f "$CONFFILE" "$CONFFILE".dpkg-remove + fi + fi +} + +# do the dhcdbd -> zzzz_dhcdbd rename on upgrades +if [ "$1" = install ] || [ "$1" = upgrade ]; then + if dpkg --compare-versions "$2" le-nl "2.0-2ubuntu2"; then + OLD=/etc/dhcp3/dhclient-exit-hooks.d/dhcdbd + NEW=/etc/dhcp3/dhclient-exit-hooks.d/zzzz_dhcdbd + if [ -e "$OLD" ]; then + md5sum="`md5sum \"$OLD\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg -s dhcdbd | sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $OLD'{s/.* //;p}}\"`" + if [ "$md5sum" = "$old_md5sum" ]; then + mv -f "$OLD" "$OLD.moved-by-preinst" + else + mv -f "$OLD" "$NEW" + fi + fi + fi +fi + +case "$1" in + install) + ;; + + upgrade) + # Upgrade from previous versions + if dpkg --compare-versions "$2" lt "2.0-4"; then + if [ -x "/etc/dbus-1/event.d/22dhcdbd" ]; then + /etc/dbus-1/event.d/22dhcdbd stop + fi + prep_rm_conffile /etc/dbus-1/event.d/22dhcdbd + fi + ;; + + abort-upgrade) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0