On Wed, 01 Dec 2010 17:07:15 +0100, Alexander Reichle-Schmehl wrote:

> I think the attached patch solves this problem, by not installing
> /etc/default/hylafax via the package, but instead installing this file
> to /usr/share/hylafax, and then using ucf to install it to /etc/default.
> 
> For that I had to rename debian/hylafax-server.hylafax.default to avoid
> it being installed by dh_installinit, which clutters the attached a bit.

Looks good to me, I'd just make 2 small changes.
Attached is a second version and the relevant diff between the patches.
 
> PS: Oh, and ignore the changelog; I don't intend to NMU it.

PS: Ignore my -4.2 changelog, it's just artificical for getting a
separated debdiff from the -4.1 diff I sent to #604221.

I'm willing to upload an NMU for both bugs but since the maintainer
has already replied to my first patch in #604221 I'd like to give him
a bit time.

Cheers,
gregor

-- 
 .''`.   http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4
 : :' :  Debian GNU/Linux user, admin, & developer - http://www.debian.org/
 `. `'   Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
   `-    NP: Dido: Afraid to Sleep
diff -u hylafax-6.0.5/debian/hylafax-server.postrm hylafax-6.0.5/debian/hylafax-server.postrm
--- hylafax-6.0.5/debian/hylafax-server.postrm	2010-12-01 16:28:22.000000000 +0100
+++ hylafax-6.0.5/debian/hylafax-server.postrm	2010-12-07 18:30:10.000000000 +0100
@@ -26,19 +26,15 @@
 
     [ -d /var/spool/hylafax/bin ] && rmdir /var/spool/hylafax/bin
 
-    for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist;  do
-        rm -f /etc/default/hylafax$ext
-    done
- 
-    # remove the configuration file itself
-    rm -f /etc/default/hylafax
+    # remove the configuration file
+    rm -f /etc/default/hylafax*
 
     # and finally clear it out from the ucf database
     if which ucf >/dev/null; then
         ucf --purge /etc/default/hylafax
     fi    
     if which ucfr >/dev/null; then
-        ucfr --purge foo /etc/default/hylafax
+        ucfr --purge hylafax-server /etc/default/hylafax
     fi    
 
 fi
diff -Nru hylafax-6.0.5/debian/changelog hylafax-6.0.5/debian/changelog
--- hylafax-6.0.5/debian/changelog	2010-12-07 17:42:55.000000000 +0100
+++ hylafax-6.0.5/debian/changelog	2010-12-07 18:27:19.000000000 +0100
@@ -1,3 +1,13 @@
+hylafax (2:6.0.5-4.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Use ucf to install /etc/default/hylafax (Closes: #603429)
+    * Also added ucf as dependency for hylafax-server
+    * Don't install /etc/default/hylafax via debhelper, as previous version
+      might already have been changed
+
+ -- Alexander Reichle-Schmehl <toli...@debian.org>  Wed, 01 Dec 2010 16:28:35 +0100
+
 hylafax (2:6.0.5-4.1) UNRELEASED; urgency=low
 
   * Non-maintainer upload.
diff -Nru hylafax-6.0.5/debian/control hylafax-6.0.5/debian/control
--- hylafax-6.0.5/debian/control	2010-10-12 12:25:38.000000000 +0200
+++ hylafax-6.0.5/debian/control	2010-12-07 18:23:48.000000000 +0100
@@ -11,7 +11,7 @@
 Package: hylafax-server
 Architecture: any
 Section: comm
-Depends: ${shlibs:Depends}, ${misc:Depends}, libtiff-tools (>= 3.6.1-3), hylafax-client (= ${binary:Version}), bsd-mailx | mailx, psmisc, sed (>= 4.1.2), ghostscript, adduser, lsb-base (>= 3.0-6), exim4-daemon-light | mail-transport-agent
+Depends: ${shlibs:Depends}, ${misc:Depends}, libtiff-tools (>= 3.6.1-3), hylafax-client (= ${binary:Version}), bsd-mailx | mailx, psmisc, sed (>= 4.1.2), ghostscript, adduser, lsb-base (>= 3.0-6), exim4-daemon-light | mail-transport-agent, ucf
 Suggests: mgetty, psrip
 Conflicts: mgetty-fax, capi4hylafax (<< 1:01.02.03-4)
 Description: Flexible client/server fax software - server daemons
diff -Nru hylafax-6.0.5/debian/hylafax-server.hylafax.default hylafax-6.0.5/debian/hylafax-server.hylafax.default
--- hylafax-6.0.5/debian/hylafax-server.hylafax.default	2010-08-13 23:11:55.000000000 +0200
+++ hylafax-6.0.5/debian/hylafax-server.hylafax.default	1970-01-01 01:00:00.000000000 +0100
@@ -1,56 +0,0 @@
-# default settings for hylafax server
-
-# try to check for the correct USE_FAXGETTY value
-if grep -E '^[^#]*:respawn:/usr/sbin/fax(getty|modem).*$' /etc/inittab >/dev/null 2>&1 || grep -E '^exec[ \t]*/usr/sbin/fax(getty|modem)' /etc/init/*.conf >/dev/null 2>&1
-then
-	USE_FAXGETTY=init
-else
-	USE_FAXGETTY=yes
-fi
-
-# Arguments for faxgetty command. At least -D should be specified
-# as explained in debian bug #462459.
-FAXGETTYARGS="-D"
-
-# In a send only installation you may want to use faxgetty
-# or faxmodem on lines already configured with faxaddmodem.
-# faxgetty is the new default, faxmodem the old one.
-# For a better understanding of the difference between faxmodem
-# and faxgetty, see http://www.hylafax.org/archive/1999-09/msg00043.php
-#
-# In a send/receive installation you must use faxgetty.
-#
-# To use faxmodem change the following variable value to "no". 
-#
-# You may also prefer to run faxmodem/faxgetty via inittab instead of
-# running it here from a script. In this case set its value as
-# "init".
-# USE_FAXGETTY=yes 
-
-#
-# Uncomment this line once hylafax has been fully configured and/or
-# you want to enable the server.
-#
-# RUN_HYLAFAX=1
-
-#
-# If you need to bind hylafax to one address only, just uncomment
-# this variable and change the value using your preferred IP.
-#
-# BINDTO="-l 127.0.0.1"
-
-#
-# The following variables are automatically assigned by running
-# the faxsetup utility. If you leave them commented out then
-# faxsetup values are used. You may specify here the values to
-# use.
-# 
-# OLDPROT="-o 4557"
-# NEWPROT="-i 4559"
-# SNPP="-s 444"
-
-#
-# hfaxd may be run from inetd while faxq should still be executed
-# by the init script. If you run hfax via inetd or xinetd then
-# uncomment the following line
-# HFAXD_FROM_INET=true
diff -Nru hylafax-6.0.5/debian/hylafax-server.hylafax.default-maintainer hylafax-6.0.5/debian/hylafax-server.hylafax.default-maintainer
--- hylafax-6.0.5/debian/hylafax-server.hylafax.default-maintainer	1970-01-01 01:00:00.000000000 +0100
+++ hylafax-6.0.5/debian/hylafax-server.hylafax.default-maintainer	2010-12-07 18:23:48.000000000 +0100
@@ -0,0 +1,56 @@
+# default settings for hylafax server
+
+# try to check for the correct USE_FAXGETTY value
+if grep -E '^[^#]*:respawn:/usr/sbin/fax(getty|modem).*$' /etc/inittab >/dev/null 2>&1 || grep -E '^exec[ \t]*/usr/sbin/fax(getty|modem)' /etc/init/*.conf >/dev/null 2>&1
+then
+	USE_FAXGETTY=init
+else
+	USE_FAXGETTY=yes
+fi
+
+# Arguments for faxgetty command. At least -D should be specified
+# as explained in debian bug #462459.
+FAXGETTYARGS="-D"
+
+# In a send only installation you may want to use faxgetty
+# or faxmodem on lines already configured with faxaddmodem.
+# faxgetty is the new default, faxmodem the old one.
+# For a better understanding of the difference between faxmodem
+# and faxgetty, see http://www.hylafax.org/archive/1999-09/msg00043.php
+#
+# In a send/receive installation you must use faxgetty.
+#
+# To use faxmodem change the following variable value to "no". 
+#
+# You may also prefer to run faxmodem/faxgetty via inittab instead of
+# running it here from a script. In this case set its value as
+# "init".
+# USE_FAXGETTY=yes 
+
+#
+# Uncomment this line once hylafax has been fully configured and/or
+# you want to enable the server.
+#
+# RUN_HYLAFAX=1
+
+#
+# If you need to bind hylafax to one address only, just uncomment
+# this variable and change the value using your preferred IP.
+#
+# BINDTO="-l 127.0.0.1"
+
+#
+# The following variables are automatically assigned by running
+# the faxsetup utility. If you leave them commented out then
+# faxsetup values are used. You may specify here the values to
+# use.
+# 
+# OLDPROT="-o 4557"
+# NEWPROT="-i 4559"
+# SNPP="-s 444"
+
+#
+# hfaxd may be run from inetd while faxq should still be executed
+# by the init script. If you run hfax via inetd or xinetd then
+# uncomment the following line
+# HFAXD_FROM_INET=true
diff -Nru hylafax-6.0.5/debian/hylafax-server.postinst hylafax-6.0.5/debian/hylafax-server.postinst
--- hylafax-6.0.5/debian/hylafax-server.postinst	2010-12-07 17:49:51.000000000 +0100
+++ hylafax-6.0.5/debian/hylafax-server.postinst	2010-12-07 18:23:48.000000000 +0100
@@ -277,7 +277,11 @@
 	if [ "$RET" = "true" ]; then
 		# removed redirect to /dev/null so that user knows that
 		# hylafax is actually restarting
-		sed -i -e 's/# RUN_HYLAFAX=1/RUN_HYLAFAX=1/' /etc/default/hylafax
+		tmpfile=$(mktemp)
+		sed -e 's/# RUN_HYLAFAX=1/RUN_HYLAFAX=1/' < /usr/share/hylafax/hylafax.default-maintainer > $tmpfile
+		ucf --debconf-ok $tmpfile /etc/default/hylafax
+		ucfr hylafax-server /etc/default/hylafax
+		rm -f $tmpfile
 #		invoke-rc.d hylafax stop || true
 
 		# Added || true in order to complete the installation even if something goes
diff -Nru hylafax-6.0.5/debian/hylafax-server.postrm hylafax-6.0.5/debian/hylafax-server.postrm
--- hylafax-6.0.5/debian/hylafax-server.postrm	2009-12-28 20:05:40.000000000 +0100
+++ hylafax-6.0.5/debian/hylafax-server.postrm	2010-12-07 18:30:10.000000000 +0100
@@ -25,4 +25,16 @@
     done
 
     [ -d /var/spool/hylafax/bin ] && rmdir /var/spool/hylafax/bin
+
+    # remove the configuration file
+    rm -f /etc/default/hylafax*
+
+    # and finally clear it out from the ucf database
+    if which ucf >/dev/null; then
+        ucf --purge /etc/default/hylafax
+    fi    
+    if which ucfr >/dev/null; then
+        ucfr --purge hylafax-server /etc/default/hylafax
+    fi    
+
 fi
diff -Nru hylafax-6.0.5/debian/rules hylafax-6.0.5/debian/rules
--- hylafax-6.0.5/debian/rules	2010-10-12 13:17:47.000000000 +0200
+++ hylafax-6.0.5/debian/rules	2010-12-07 18:23:48.000000000 +0100
@@ -116,6 +116,8 @@
 	cp -p debian/lintian.override.hylafax-server \
 		$(d_server)/usr/share/lintian/overrides/$(p_server)
 
+	cp debian/hylafax-server.hylafax.default-maintainer $(d_server)/usr/share/hylafax/hylafax.default-maintainer
+
 	install --mode=a+rx -p debian/copy_configuration_from_spool $(d_server)/usr/lib/hylafax/bin/
 
 override_dh_installman:
@@ -163,7 +165,8 @@
 		var/spool/hylafax/etc var/spool/hylafax/recvq var/spool/hylafax/status var/spool/hylafax/sendq \
 		var/spool/hylafax/doneq var/spool/hylafax/docq var/spool/hylafax/tmp var/spool/hylafax/pollq \
 		usr/share/man/man5 usr/share/man/man8 \
-		usr/share/lintian/overrides
+		usr/share/lintian/overrides \
+		usr/share/hylafax
 	dh_installdirs -p$(p_client) \
 		etc/hylafax \
 		usr/bin \

Attachment: signature.asc
Description: Digital signature

Reply via email to