Sorry, I forgot to sent it :-/

It's a global patch I'm working on with Helmut, who kindly accepted to
sponsor me, and Wouter, who is the official package maintainer. Main
discussion thread can be viewed here [1], which is the bug I was fixing
first.

This mail is sent to each impacted bug reports.

The patch attached covers bugs #760414, #767676, #769331, #769670 and
possibly #755866.

The patch has been succesfully tested with piuparts and packages, both
source and binary, has been built with pbuilder.

Here are the details off the modifications, per bug:

- #760414
  Remove minified JS files. Add patch to remove references to
  minified JS files in tools/rdm/Makefile.am

- #767676
  Remove debconf calls from ola-rdm-tests postinst

- #769331
  Ship /etc/ola within ola & ola-rdm-tests packages

- #769670 (and possibly #755866)
  Add a patch which fix failing test when running in pbuilder

I'm waiting for the approval of Helmut and Wouter to upload source
package to mentors.

Regards,
Jean Baptiste

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767676

On 24/11/2014 20:46, gregor herrmann wrote:
> On Sat, 22 Nov 2014 11:40:06 +0100, Jean Baptiste Favre wrote:
> 
>> tags 769670 + patch
>> thanks
> 
> Hm? Where is the patch? :)
> 
> Cheers,
> gregor

diff -Nru ola-0.9.1/debian/changelog ola-0.9.1+dfsg1/debian/changelog
--- ola-0.9.1/debian/changelog	2014-08-17 10:07:29.000000000 +0200
+++ ola-0.9.1+dfsg1/debian/changelog	2014-11-22 00:03:06.000000000 +0100
@@ -1,3 +1,23 @@
+ola (0.9.1+dfsg1-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload
+  * Remove debconf calls from ola-rdm-tests postinst (Closes: #767676)
+  * Ship /etc/ola within ola & ola-rdm-tests packages (Closes: #769331)
+  * Add a patch which fix failing test when running in pbuilder
+    (Closes: #769670)
+  * Remove minified JS files. Add patch to remove references to
+    minified JS files in tools/rdm/Makefile.am (Closes: #760414)
+  * Fix other important issues:
+    - Remove the check for $RUN_DAEMON from both init scripts olad and
+      rdm_test_server (Package maintainer disagree about this way of
+      controling service)
+    - Remove ola-rdm-tests postinst since its only purpose was to provide
+      /etc/default/ola-rdm-tests
+    - Add postrm scripts for packages ola & ola-rdm-tests to fully remove
+      configuration files so that piuparts tests can pass
+
+ -- Jean Baptiste Favre <deb...@jbfavre.org>  Sun, 16 Nov 2014 17:44:18 +0100
+
 ola (0.9.1-1) unstable; urgency=low
 
   * New upstream release
diff -Nru ola-0.9.1/debian/ola.dirs ola-0.9.1+dfsg1/debian/ola.dirs
--- ola-0.9.1/debian/ola.dirs	2014-04-21 08:19:26.000000000 +0200
+++ ola-0.9.1+dfsg1/debian/ola.dirs	2014-11-22 00:03:06.000000000 +0100
@@ -1,3 +1,4 @@
+etc/ola
 usr/bin
 usr/lib
 usr/share/olad/www
diff -Nru ola-0.9.1/debian/ola.olad.init ola-0.9.1+dfsg1/debian/ola.olad.init
--- ola-0.9.1/debian/ola.olad.init	2014-08-17 09:17:40.000000000 +0200
+++ ola-0.9.1+dfsg1/debian/ola.olad.init	2014-11-22 00:03:06.000000000 +0100
@@ -16,16 +16,11 @@
 PIDFILE=/var/run/$NAME.pid
 DESC="OLA daemon"
 USER=olad
+DAEMON_ARGS="--syslog --log-level 3 --config-dir /etc/ola"
 
 # Reads config file (will override defaults above)
 [ -r /etc/default/ola ] && . /etc/default/ola
 
-if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then
-  DAEMON_ARGS="--syslog --log-level 3  --config-dir  /etc/ola"
-elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then
-  echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola\" to change this." >&2
-fi
-
 [ -x "$DAEMON" ] || exit 0
 
 . /lib/lsb/init-functions
diff -Nru ola-0.9.1/debian/ola.postinst ola-0.9.1+dfsg1/debian/ola.postinst
--- ola-0.9.1/debian/ola.postinst	2014-08-17 09:17:40.000000000 +0200
+++ ola-0.9.1+dfsg1/debian/ola.postinst	2014-11-22 00:03:06.000000000 +0100
@@ -8,13 +8,8 @@
 groups olad | grep plugdev > /dev/null || adduser olad plugdev
 
 # setup the config dir
-CONF_DIR=/etc/ola
-if [ ! -d ${CONF_DIR} ]; then
-  mkdir -p ${CONF_DIR};
-  chown -R olad:olad ${CONF_DIR};
-  chmod g+s ${CONF_DIR};
-fi;
-
+chown -R olad:olad /etc/ola;
+chmod g+s /etc/ola;
 
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
diff -Nru ola-0.9.1/debian/ola.postrm ola-0.9.1+dfsg1/debian/ola.postrm
--- ola-0.9.1/debian/ola.postrm	1970-01-01 01:00:00.000000000 +0100
+++ ola-0.9.1+dfsg1/debian/ola.postrm	2014-11-22 00:03:06.000000000 +0100
@@ -0,0 +1,25 @@
+#!/bin/sh
+# postrm script for ola
+
+set -e
+
+case "$1" in
+  purge)
+    if [ -f /etc/default/ola ]; then
+      rm -f /etc/default/ola
+    fi
+  ;;
+
+  remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+  ;;
+
+  *)
+    echo "postrm called with unknown argument \`$1'" >&2
+    exit 1
+  ;;
+
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Nru ola-0.9.1/debian/ola-rdm-tests.dirs ola-0.9.1+dfsg1/debian/ola-rdm-tests.dirs
--- ola-0.9.1/debian/ola-rdm-tests.dirs	2014-04-21 08:19:26.000000000 +0200
+++ ola-0.9.1+dfsg1/debian/ola-rdm-tests.dirs	2014-11-22 00:03:06.000000000 +0100
@@ -1,3 +1,4 @@
+etc/ola
 usr/bin
 usr/lib
 usr/share
diff -Nru ola-0.9.1/debian/ola-rdm-tests.postinst ola-0.9.1+dfsg1/debian/ola-rdm-tests.postinst
--- ola-0.9.1/debian/ola-rdm-tests.postinst	2014-04-21 08:19:26.000000000 +0200
+++ ola-0.9.1+dfsg1/debian/ola-rdm-tests.postinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,64 +0,0 @@
-#!/bin/sh -e
-# postinst script for ola-rdm-tests
-
-conffile="/etc/default/ola-rdm-tests"
-
-update_config_file() {
-  db_field=$1
-  config_field=$2
-
-  RET=false
-  db_get $db_field
-  if [ -n "$RET" ] ; then
-    if grep -q "^$config_field" $conffile ; then
-      # keep any admin changes, while replacing the variable content
-      sed "s/^[ ]*$config_field=\".*\"/$config_field=\"$RET\"/" < $conffile > $conffile.new && 
-      mv $conffile.new $conffile
-    else
-      echo "$config_field=\"$RET\"" >> $conffile
-    fi
-  fi
-}
-
-# Source debconf library -- we have a Depends line
-# to make sure it is there...
-. /usr/share/debconf/confmodule
-db_version 2.0
-
-case "$1" in
-  configure)
-  if [ -f $conffile ] ; then
-    sed -i -e 's/^[ ]*DAEMON/RUN_DAEMON/g' $conffile
-  else
-    cat << EOF > $conffile
-# Defaults for ola-rdm-tests initscript (/etc/init.d/ola-rdm-tests)
-# This is a POSIX shell fragment
-
-# [automatically edited by postinst, do not change line format ]
-
-# ola-rdm-tests daemon switch. If set to true, rdm_test_server.py will run.
-RUN_DAEMON="true"
-EOF
-  fi
-
-  update_config_file ola-rdm-tests/daemon RUN_DAEMON
-
-  db_stop
-  ;;
-
-  abort-upgrade|abort-remove|abort-deconfigure)
-  ;;
-
-  *)
-    echo "postinst called with unknown argument \`$1'" >&2
-    exit 1
-  ;;
-esac
-
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff -Nru ola-0.9.1/debian/ola-rdm-tests.postrm ola-0.9.1+dfsg1/debian/ola-rdm-tests.postrm
--- ola-0.9.1/debian/ola-rdm-tests.postrm	1970-01-01 01:00:00.000000000 +0100
+++ ola-0.9.1+dfsg1/debian/ola-rdm-tests.postrm	2014-11-22 00:03:06.000000000 +0100
@@ -0,0 +1,25 @@
+#!/bin/sh
+# postrm script for ola-rdm-tests
+
+set -e
+
+case "$1" in
+  purge)
+    if [ -f /etc/default/ola-rdm-tests ]; then
+      rm -f /etc/default/ola-rdm-tests
+    fi
+  ;;
+
+  remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+  ;;
+
+  *)
+    echo "postrm called with unknown argument \`$1'" >&2
+    exit 1
+  ;;
+
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Nru ola-0.9.1/debian/ola-rdm-tests.rdm_test_server.init ola-0.9.1+dfsg1/debian/ola-rdm-tests.rdm_test_server.init
--- ola-0.9.1/debian/ola-rdm-tests.rdm_test_server.init	2014-08-17 09:17:40.000000000 +0200
+++ ola-0.9.1+dfsg1/debian/ola-rdm-tests.rdm_test_server.init	2014-11-22 00:03:06.000000000 +0100
@@ -17,16 +17,11 @@
 PIDFILE=/var/run/$CMD.pid
 DESC="OLA RDM Test Server"
 USER=olad
+DAEMON_ARGS="--world-writeable"
 
 # Reads config file (will override defaults above)
 [ -r /etc/default/ola-rdm-tests ] && . /etc/default/ola-rdm-tests
 
-if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then
-  DAEMON_ARGS="--world-writeable"
-elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then
-  echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola-rdm-tests\" to change this." >&2
-fi
-
 [ -x "$DAEMON" ] || exit 0
 
 . /lib/lsb/init-functions
diff -Nru ola-0.9.1/debian/patches/include_lo_when_looking_for_network_interface.patch ola-0.9.1+dfsg1/debian/patches/include_lo_when_looking_for_network_interface.patch
--- ola-0.9.1/debian/patches/include_lo_when_looking_for_network_interface.patch	1970-01-01 01:00:00.000000000 +0100
+++ ola-0.9.1+dfsg1/debian/patches/include_lo_when_looking_for_network_interface.patch	2014-11-22 00:03:06.000000000 +0100
@@ -0,0 +1,22 @@
+Description: Include lo interface lookup for InterfacePicker.
+ Package tests fails when running in pbuilder because InterfacePickerTest does not find
+ any suitable network interface.
+ pbuilder creates a new network namespace (using "unshare -n" from util-linux) and runs
+ the build with just lo being available.
+ Removing false flag passed to picker->GetInterfaces() allows to include lo in search,
+ thus allowing tests to complete.
+Author: Jean Baptiste Favre <deb...@jbfavre.org>
+Last-Update: 2014-11-21
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/common/network/InterfacePickerTest.cpp
++++ b/common/network/InterfacePickerTest.cpp
+@@ -63,7 +63,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(Interfac
+  */
+ void InterfacePickerTest::testGetInterfaces() {
+   auto_ptr<InterfacePicker> picker(InterfacePicker::NewPicker());
+-  vector<Interface> interfaces = picker->GetInterfaces(false);
++  vector<Interface> interfaces = picker->GetInterfaces(true);
+   OLA_ASSERT_TRUE(interfaces.size() > 0);
+ 
+   vector<Interface>::iterator iter;
diff -Nru ola-0.9.1/debian/patches/remove_minified_js_files.patch ola-0.9.1+dfsg1/debian/patches/remove_minified_js_files.patch
--- ola-0.9.1/debian/patches/remove_minified_js_files.patch	1970-01-01 01:00:00.000000000 +0100
+++ ola-0.9.1+dfsg1/debian/patches/remove_minified_js_files.patch	2014-11-22 00:03:06.000000000 +0100
@@ -0,0 +1,14 @@
+Index: ola-0.9.1/tools/rdm/Makefile.am
+===================================================================
+--- ola-0.9.1.orig/tools/rdm/Makefile.am	2014-06-21 22:39:56.000000000 +0200
++++ ola-0.9.1/tools/rdm/Makefile.am	2014-11-21 23:40:19.013472735 +0100
+@@ -17,9 +17,7 @@
+ testserver_static_files = \
+     static/MIT-LICENSE.txt \
+     static/common.css \
+-    static/jquery-1.7.2.min.js \
+     static/jquery-ui-1.8.21.custom.css \
+-    static/jquery-ui-1.8.21.custom.min.js \
+     static/rdm_tests.js \
+     static/rdmtests.html \
+     static/ui.multiselect.css \
diff -Nru ola-0.9.1/debian/patches/series ola-0.9.1+dfsg1/debian/patches/series
--- ola-0.9.1/debian/patches/series	2014-04-21 11:13:06.000000000 +0200
+++ ola-0.9.1+dfsg1/debian/patches/series	2014-11-22 10:51:44.000000000 +0100
@@ -1 +1,3 @@
+remove_minified_js_files.patch
 debian-changes
+include_lo_when_looking_for_network_interface.patch
diff -Nru ola-0.9.1/debian/README.source ola-0.9.1+dfsg1/debian/README.source
--- ola-0.9.1/debian/README.source	1970-01-01 01:00:00.000000000 +0100
+++ ola-0.9.1+dfsg1/debian/README.source	2014-11-22 10:40:24.000000000 +0100
@@ -0,0 +1,20 @@
+The upstream version of this package provides 2 minified javascript files
+without providing the unminified ones:
+
+tools/rdm/static/jquery-1.7.2.min.js
+tools/rdm/static/jquery-ui-1.8.21.custom.min.js
+
+In order to comply with Debian Free Software Guidelines (DFSG) [1] #2, theses
+files are to be removed from upstream source using debian/repack.sh script.
+Usage:
+
+./debian/repack.sh --upstream-version <version> <filename>
+
+For example, assuming upstream version is 0.9.1, you should run
+
+./debian/repack.sh --upstream-version 0.9.1 ../ola_0.9.1.orig.tar.gz
+
+You then obtain ../ola_0.9.1+dfsg1.orig.tar.gz which you can use as upstream
+package to build binary packages.
+
+[1] https://www.debian.org/social_contract.en.html#guidelines
diff -Nru ola-0.9.1/debian/repack.sh ola-0.9.1+dfsg1/debian/repack.sh
--- ola-0.9.1/debian/repack.sh	1970-01-01 01:00:00.000000000 +0100
+++ ola-0.9.1+dfsg1/debian/repack.sh	2014-11-22 00:09:52.000000000 +0100
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Repackage upstream source to exclude non-distributable files.
+# Should be called as "repack sh --upstream-source <version> <file>
+# (for example, via uscan).
+
+set -e
+set -u
+
+if [ $# -ne 3 ]; then
+        echo "Usage: $0 --upstream-source <version> <file>"
+        exit 1
+fi
+
+OPT_VERSION=$2
+OPT_FILE=$3
+TMPDIR=`mktemp -d`
+trap "rm -rf $TMPDIR" QUIT INT EXIT
+
+echo "Repackaging $OPT_FILE"
+
+orig_file_path=$(readlink --canonicalize $OPT_FILE)
+package_name=$(dpkg-parsechangelog | sed -n 's/^Source: //p')
+dfsg_directory=${package_name}_${OPT_VERSION}+dfsg1
+dfsg_file_path=$(dirname ${orig_file_path})/${dfsg_directory}.orig.tar.gz
+
+zcat "${orig_file_path}" | \
+tar --wildcards \
+    --delete '*min.js' | \
+gzip -c > $dfsg_file_path
+
+echo "File $OPT_FILE repackaged successfully to $dfsg_file_path"

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to