[pkg-wpa-devel] r1433 - in /hostapd/trunk/debian: README.Debian README.source changelog control default examples hostapd.lintian-overrides ifupdown.sh init.d install preinst rules

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Sun Nov 1 11:48:04 UTC 2009


Author: kelmo-guest
Date: Sun Nov  1 11:48:04 2009
New Revision: 1433

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1433
Log:
DO NOT UPLOAD

* Support the status command in init.d script. Depend on lsb-base (>=
  3.2-13) for status_of_proc. Patch thanks to Peter Eisentraut.
  (Closes: #535633)
* Add debian/README.source to describe use of quilt patch system.
* Increase Standards-Version to 3.8.3.
* Reduce debian/rules by tweaking the sequence of a few things and
  using the --sourcedirectory option of dh in debhelper (>= 7.3.7~).
  Build-Depend on that debhelper version.
* No longer install /etc/hostapd/hostapd.conf per default as there are
  no sane defaults. Instead provide the configuration as an example
  only and take care to remove previously installed conffiles which
  remain unedited on upgrade.
* Clean up init.d script a bit by using existance of hostapd daemon
  configuration file as defined in /etc/default/hostapd as conditional
  for starting instead of magic RUN_DAEMON variable.
* Update README.Debian to contain information about the example
  hostapd.conf file.

Added:
    hostapd/trunk/debian/README.source
    hostapd/trunk/debian/preinst   (with props)
Removed:
    hostapd/trunk/debian/hostapd.lintian-overrides
Modified:
    hostapd/trunk/debian/README.Debian
    hostapd/trunk/debian/changelog
    hostapd/trunk/debian/control
    hostapd/trunk/debian/default
    hostapd/trunk/debian/examples
    hostapd/trunk/debian/ifupdown.sh
    hostapd/trunk/debian/init.d
    hostapd/trunk/debian/install
    hostapd/trunk/debian/rules

Modified: hostapd/trunk/debian/README.Debian
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/README.Debian?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/README.Debian (original)
+++ hostapd/trunk/debian/README.Debian Sun Nov  1 11:48:04 2009
@@ -2,11 +2,21 @@
 ------------------
 
 This package provides two methods for managing hostapd process(es); an
-initscript and an ifupdown hook. Both methods require you understand and
-customize the default configuraion file (/etc/hostapd/hostapd.conf) to
+initscript and an ifupdown hook. Both methods require creation of a
+hostapd daemon configuration file (eg. /etc/hostapd/hostapd.conf) to
 function correctly.
 
-To use the initscript method see /etc/default/hostapd.
+An example hostapd.conf may be used as a template but _must_ be edited
+to suit your local configuration. An example is located at:
+  /usr/share/doc/hostapd/examples/hostapd.conf.gz
+
+To use the example as a template:
+  # zcat /usr/share/doc/hostapd/examples/hostapd.conf.gz > \
+  	/etc/hostapd/hostapd.conf
+  # $EDITOR /etc/hostapd/hostapd.conf
+
+To use the initscript method of starting a hostapd daemon see
+/etc/default/hostapd.
 
 To use the ifupdown method, the path to hostapd configuration file can
 be specified in a network interfaces configuration stanza in
@@ -19,7 +29,7 @@
 The hostapd process will be started in the pre-up phase of ifup, and be
 terminated in the post-down phase of ifdown.
 
- -- Kel Modderman <kel at otaku42.de>  Sun, 06 Jan 2008 16:27:01 +1000
+ -- Kel Modderman <kel at otaku42.de>  Tue, 27 Oct 2009 12:03:01 +1000
 
 Please note:
 * If you want to use hostapd with a Prism2/2.5/3 card in WPA mode, you'll need

Added: hostapd/trunk/debian/README.source
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/README.source?rev=1433&op=file
==============================================================================
--- hostapd/trunk/debian/README.source (added)
+++ hostapd/trunk/debian/README.source Sun Nov  1 11:48:04 2009
@@ -1,0 +1,57 @@
+This package uses quilt to manage all modifications to the upstream
+source.  Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+To configure quilt to use debian/patches instead of patches, you want
+either to export QUILT_PATCHES=debian/patches in your environment
+or use this snippet in your ~/.quiltrc:
+
+    for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do
+        if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then
+                export QUILT_PATCHES=debian/patches
+        fi
+    done
+
+To get the fully patched source after unpacking the source package, cd to
+the root level of the source package and run:
+
+    quilt push -a
+
+The last patch listed in debian/patches/series will become the current
+patch.
+
+To add a new set of changes, first run quilt push -a, and then run:
+
+    quilt new <patch>
+
+where <patch> is a descriptive name for the patch, used as the filename in
+debian/patches.  Then, for every file that will be modified by this patch,
+run:
+
+    quilt add <file>
+
+before editing those files.  You must tell quilt with quilt add what files
+will be part of the patch before making changes or quilt will not work
+properly.  After editing the files, run:
+
+    quilt refresh
+
+to save the results as a patch.
+
+Alternately, if you already have an external patch and you just want to
+add it to the build system, run quilt push -a and then:
+
+    quilt import -P <patch> /path/to/patch
+    quilt push -a
+
+(add -p 0 to quilt import if needed). <patch> as above is the filename to
+use in debian/patches.  The last quilt push -a will apply the patch to
+make sure it works properly.
+
+To remove an existing patch from the list of patches that will be applied,
+run:
+
+    quilt delete <patch>
+
+You may need to run quilt pop -a to unapply patches first before running
+this command.

Modified: hostapd/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/changelog?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/changelog (original)
+++ hostapd/trunk/debian/changelog Sun Nov  1 11:48:04 2009
@@ -1,3 +1,27 @@
+hostapd (1:0.6.9-4) unstable; urgency=low
+
+  DO NOT UPLOAD
+  
+  * Support the status command in init.d script. Depend on lsb-base (>=
+    3.2-13) for status_of_proc. Patch thanks to Peter Eisentraut.
+    (Closes: #535633)
+  * Add debian/README.source to describe use of quilt patch system.
+  * Increase Standards-Version to 3.8.3.
+  * Reduce debian/rules by tweaking the sequence of a few things and
+    using the --sourcedirectory option of dh in debhelper (>= 7.3.7~).
+    Build-Depend on that debhelper version.
+  * No longer install /etc/hostapd/hostapd.conf per default as there are
+    no sane defaults. Instead provide the configuration as an example
+    only and take care to remove previously installed conffiles which
+    remain unedited on upgrade.
+  * Clean up init.d script a bit by using existance of hostapd daemon
+    configuration file as defined in /etc/default/hostapd as conditional
+    for starting instead of magic RUN_DAEMON variable.
+  * Update README.Debian to contain information about the example
+    hostapd.conf file.
+
+ -- Kel Modderman <kel at otaku42.de>  Sun, 01 Nov 2009 21:46:41 +1000
+
 hostapd (1:0.6.9-3) unstable; urgency=low
 
   * Change Maintainer to pkg-wpa-devel team and add Reinhard and myself
@@ -14,11 +38,8 @@
     drivers. Thanks to Jan Braunisch for noticing.
   * Also remove reference to the Prism54 driver in package long
     description, we do not support it.
-  * Support the status command in init.d script. Depend on lsb-base (>=
-    3.2-13) for status_of_proc. Patch thanks to Peter Eisentraut.
-    (Closes: #535633)
-
- -- Kel Modderman <kel at otaku42.de>  Sat, 17 Oct 2009 22:58:56 +1000
+
+ -- Kel Modderman <kel at otaku42.de>  Sun, 17 May 2009 04:35:12 +1000
 
 hostapd (1:0.6.9-2) unstable; urgency=low
 

Modified: hostapd/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/control?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/control (original)
+++ hostapd/trunk/debian/control Sun Nov  1 11:48:04 2009
@@ -2,9 +2,14 @@
 Section: net
 Priority: optional
 Maintainer: Debian/Ubuntu wpasupplicant Maintainers <pkg-wpa-devel at lists.alioth.debian.org>
-Uploaders: Faidon Liambotis <paravoid at debian.org>, Reinhard Tartler <siretart at tauware.de>, Kel Modderman <kel at otaku42.de>
-Build-Depends: debhelper (>= 7.0.50), quilt (>= 0.46-7), libssl-dev, libnl-dev (>= 1.1)
-Standards-Version: 3.8.1
+Uploaders: Faidon Liambotis <paravoid at debian.org>,
+ Reinhard Tartler <siretart at tauware.de>,
+ Kel Modderman <kel at otaku42.de>
+Build-Depends: debhelper (>= 7.3.7~),
+ quilt (>= 0.46-7~),
+ libssl-dev,
+ libnl-dev (>= 1.1)
+Standards-Version: 3.8.3
 Homepage: http://w1.fi/
 Vcs-Svn: svn://svn.debian.org/pkg-wpa/hostapd/trunk
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/

Modified: hostapd/trunk/debian/default
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/default?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/default (original)
+++ hostapd/trunk/debian/default Sun Nov  1 11:48:04 2009
@@ -1,24 +1,20 @@
 # Defaults for hostapd initscript
+#
+# See /usr/share/doc/hostapd/README.Debian for information about alternative
+# methods of managing hostapd.
+#
+# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
+# file and hostapd will be started during system boot. An example configuration
+# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
+#
+#DAEMON_CONF=""
 
-# See /usr/share/doc/hostapd/README.Debian for information
-# about alternative methods of managing hostapd.
-
-# Uncomment the following line to run hostapd on startup
-# WARNING! Depending on your configuration,
-#          you may lose access via your wireless interface.
-#
-#RUN_DAEMON="yes"
-
-# Uncomment the following line, and provide the absolute
-# path to one or more configuration files to be used by the
-# hostapd daemon. If left commented, the daemon will use 
-# /etc/hostapd/hostapd.conf
-#
-#DAEMON_CONF="/etc/hostapd/hostapd.conf"
-
-# Additional daemon options
+# Additional daemon options to be appended to hostapd command:-
 # 	-d   show more debug messages (-dd for even more)
 # 	-K   include key data in debug messages
 # 	-t   include timestamps in some debug messages
 #
-#DAEMON_OPTS="-dd"
+# Note that -B (daemon mode) and -P (pidfile) options are automatically
+# configured by the init.d script and must not be added to DAEMON_OPTS.
+#
+#DAEMON_OPTS=""

Modified: hostapd/trunk/debian/examples
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/examples?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/examples (original)
+++ hostapd/trunk/debian/examples Sun Nov  1 11:48:04 2009
@@ -1,4 +1,5 @@
 hostapd/hostapd.accept
+hostapd/hostapd.conf
 hostapd/hostapd.deny
 hostapd/hostapd.eap_user
 hostapd/hostapd.radius_clients

Modified: hostapd/trunk/debian/ifupdown.sh
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/ifupdown.sh?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/ifupdown.sh (original)
+++ hostapd/trunk/debian/ifupdown.sh Sun Nov  1 11:48:04 2009
@@ -32,6 +32,13 @@
 HOSTAPD_PNAME="hostapd"
 HOSTAPD_PIDFILE="/var/run/hostapd.$IFACE.pid"
 
+HOSTAPD_OMIT_PIDFILE=
+if [ -d /lib/init/rw/sendsigs.omit.d/ ]; then
+	HOSTAPD_OMIT_PIDFILE="/lib/init/rw/sendsigs.omit.d/hostapd.$IFACE.pid"
+elif [ -d /var/run/sendsigs.omit.d/ ]; then
+	HOSTAPD_OMIT_PIDFILE="/var/run/sendsigs.omit.d/hostapd.$IFACE.pid"
+fi
+
 if [ ! -x "$HOSTAPD_BIN" ]; then
 	exit 0
 fi
@@ -57,14 +64,13 @@
 	esac
 }
 
-# adapted from wpasupplicant: /etc/wpa_supplicant/functions.sh
 test_hostapd_pidfile () {
-	if [ -n "$HOSTAPD_BIN" ] && [ -f "$HOSTAPD_PIDFILE" ]; then
+	if [ -n "$1" ] && [ -f "$2" ]; then
 		if start-stop-daemon --stop --quiet --signal 0 \
-			--exec "$HOSTAPD_BIN" --pidfile "$HOSTAPD_PIDFILE"; then
+			--exec "$1" --pidfile "$2"; then
 			return 0
 		else
-			rm -f "$HOSTAPD_PIDFILE"
+			rm -f "$2"
 			return 1
 		fi
 	else
@@ -73,25 +79,34 @@
 }
 
 init_hostapd () {
-	local HOSTAPD_OPTIONS
 	HOSTAPD_OPTIONS="-B -P $HOSTAPD_PIDFILE $HOSTAPD_CONF"
+	HOSTAPD_MESSAGE="$HOSTAPD_BIN $HOSTAPD_OPTIONS"
 	
-	if ! test_hostapd_pidfile; then
-		hostapd_msg verbose "$HOSTAPD_BIN $HOSTAPD_OPTIONS"
-		start-stop-daemon --start --oknodo --quiet \
-			--exec "$HOSTAPD_BIN" --pidfile "$HOSTAPD_PIDFILE" -- $HOSTAPD_OPTIONS > "$TO_NULL"
-		return "$?"
+	test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" && return 0
+
+	hostapd_msg verbose "$HOSTAPD_MESSAGE"
+	start-stop-daemon --start --oknodo --quiet --exec "$HOSTAPD_BIN" \
+		--pidfile "$HOSTAPD_PIDFILE" -- $HOSTAPD_OPTIONS > "$TO_NULL"
+
+	if [ "$?" -eq 0]; then
+		[ "$HOSTAPD_OMIT_PIDFILE" ] && \
+			cat "$HOSTAPD_PIDFILE" > "$HOSTAPD_OMIT_PIDFILE"
+		return 0
 	fi
 
-	return 0
+	return 1
 }
 
 kill_hostapd () {
-	if test_hostapd_pidfile; then
-		hostapd_msg verbose "stopping hostapd via pidfile \"$HOSTAPD_PIDFILE\""
-		start-stop-daemon --stop --oknodo --quiet \
-			--exec "$HOSTAPD_BIN" --pidfile "$HOSTAPD_PIDFILE" > "$TO_NULL"
-	fi
+	HOSTAPD_MESSAGE="stopping $HOSTAPD_PNAME via pidfile: $HOSTAPD_PIDFILE"
+
+	test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" || return 0
+	
+	hostapd_msg verbose "$HOSTAPD_MESSAGE"
+	start-stop-daemon --stop --oknodo --quiet --exec "$HOSTAPD_BIN" \
+		--pidfile "$HOSTAPD_PIDFILE" > "$TO_NULL"
+	
+	[ "$HOSTAPD_OMIT_PIDFILE" ] && rm -f "$HOSTAPD_OMIT_PIDFILE"
 }
 
 case "$MODE" in 

Modified: hostapd/trunk/debian/init.d
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/init.d?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/init.d (original)
+++ hostapd/trunk/debian/init.d Sun Nov  1 11:48:04 2009
@@ -14,20 +14,16 @@
 ### END INIT INFO
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/hostapd
+DAEMON_SBIN=/usr/sbin/hostapd
+DAEMON_DEFS=/etc/default/hostapd
+DAEMON_CONF=
 NAME=hostapd
 DESC="advanced IEEE 802.11 management"
 PIDFILE=/var/run/hostapd.pid
 
-test -x $DAEMON || exit 0
-
-if [ -s /etc/default/hostapd ] ; then
-	. /etc/default/hostapd
-fi
-
-if [ -z "$DAEMON_CONF" ]; then
-	DAEMON_CONF=/etc/hostapd/hostapd.conf
-fi
+[ -x "$DAEMON_SBIN" ] || exit 0
+[ -s "$DAEMON_DEFS" ] && . /etc/default/hostapd
+[ -r "$DAEMON_CONF" ] || exit 0
 
 DAEMON_OPTS="-B -P $PIDFILE $DAEMON_OPTS $DAEMON_CONF"
 
@@ -35,29 +31,21 @@
 
 case "$1" in
   start)
-	log_daemon_msg "Starting $DESC"
-	if [ "$RUN_DAEMON" != "yes" ]; then
-		log_progress_msg "disabled via /etc/default/hostapd"
-		log_end_msg 0
-		exit 0
-	fi
-	log_progress_msg "$NAME"
-	start-stop-daemon --start --oknodo --quiet \
-		--exec $DAEMON --pidfile $PIDFILE -- $DAEMON_OPTS > /dev/null
+	log_daemon_msg "Starting $DESC" "$NAME"
+	start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_SBIN" \
+		--pidfile "$PIDFILE" -- $DAEMON_OPTS >/dev/null
 	log_end_msg "$?"
 	;;
   stop)
-	log_daemon_msg "Stopping $DESC"
-	log_progress_msg "$NAME"
-	start-stop-daemon --stop --oknodo --quiet \
-		--exec $DAEMON --pidfile $PIDFILE
+	log_daemon_msg "Stopping $DESC" "$NAME"
+	start-stop-daemon --stop --oknodo --quiet --exec "$DAEMON_SBIN" \
+		--pidfile "$PIDFILE"
 	log_end_msg "$?"
 	;;
   reload)
-  	log_daemon_msg "Reloading $DESC"
-	log_progress_msg "$NAME"
-	start-stop-daemon --stop --signal HUP \
-		--exec $DAEMON --pidfile $PIDFILE
+  	log_daemon_msg "Reloading $DESC" "$NAME"
+	start-stop-daemon --stop --signal HUP --exec "$DAEMON_SBIN" \
+		--pidfile "$PIDFILE"
 	log_end_msg "$?"
 	;;
   restart|force-reload)
@@ -66,7 +54,7 @@
 	$0 start
 	;;
   status)
-	status_of_proc $DAEMON $NAME
+	status_of_proc "$DAEMON_SBIN" "$NAME"
 	exit $?
 	;;
   *)

Modified: hostapd/trunk/debian/install
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/install?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/install (original)
+++ hostapd/trunk/debian/install Sun Nov  1 11:48:04 2009
@@ -1,4 +1,3 @@
 hostapd/hostapd      usr/sbin/
 hostapd/hostapd_cli  usr/bin/
-hostapd/hostapd.conf etc/hostapd/
 debian/ifupdown.sh   etc/hostapd/

Added: hostapd/trunk/debian/preinst
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/preinst?rev=1433&op=file
==============================================================================
--- hostapd/trunk/debian/preinst (added)
+++ hostapd/trunk/debian/preinst Sun Nov  1 11:48:04 2009
@@ -1,0 +1,30 @@
+#!/bin/sh
+
+set -e
+
+rm_conffile() {
+	local PKGNAME="$1"
+	local CONFFILE="$2"
+
+	[ -e "$CONFFILE" ] || return 0
+
+	local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
+	local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
+		sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+	if [ "$md5sum" = "$old_md5sum" ]; then
+		echo "Removing obsolete conffile $CONFFILE ..."
+		rm -f "$CONFFILE"
+	fi
+}
+
+case "$1" in
+	install|upgrade)
+		if dpkg --compare-versions "$2" le "1:0.6.9-3"; then
+			rm_conffile hostapd /etc/hostapd/hostapd.conf
+		fi
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0

Propchange: hostapd/trunk/debian/preinst
------------------------------------------------------------------------------
    svn:executable = *

Modified: hostapd/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-wpa/hostapd/trunk/debian/rules?rev=1433&op=diff
==============================================================================
--- hostapd/trunk/debian/rules (original)
+++ hostapd/trunk/debian/rules Sun Nov  1 11:48:04 2009
@@ -8,32 +8,27 @@
 	CFLAGS += -O2
 endif
 
-DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+BUILD_DOT_CONFIG := debian/config/$(DEB_HOST_ARCH_OS)
 
-ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
-	CONFIG := debian/config/kfreebsd
-else
-	CONFIG := debian/config/linux
-endif
-
-%:
-	dh --with quilt $@
-
+### start dh overrides
 override_dh_auto_build:
-	cp -v $(CONFIG) hostapd/.config
+	cp --remove-destination $(BUILD_DOT_CONFIG) hostapd/.config
 	$(MAKE) -C hostapd all
 
-override_dh_auto_clean:
-	$(MAKE) -C hostapd clean
-	rm -f hostapd/.config
+override_dh_auto_install:
+	$(info Skip dh_auto_install ...)
+
+override_dh_clean:
+	dh_clean hostapd/.config
 
 override_dh_fixperms:
+	dh_fixperms
 	chmod 0755 debian/hostapd/etc/hostapd/ifupdown.sh
-	chmod 0600 debian/hostapd/etc/hostapd/hostapd.conf
-	# Patch hostapd.conf to refer to /etc/hostapd/*
-	sed -i 's#/etc/hostapd\.#/etc/hostapd/hostapd.#g' \
-		debian/hostapd/etc/hostapd/hostapd.conf
-	dh_fixperms -Xetc/hostapd/hostapd.conf
 
 override_dh_installchangelogs:
 	dh_installchangelogs hostapd/ChangeLog
+### end dh overrides
+
+%:
+	+dh $@ --with quilt --sourcedirectory=hostapd --buildsystem=makefile




More information about the Pkg-wpa-devel mailing list