[Pkg-ocaml-maint-commits] [SCM] approx upstream and debian packaging branch, master, updated. upstream/3.5-103-g447143e

Eric Cooper ecc at cmu.edu
Wed Mar 11 20:14:52 UTC 2009


The following commit has been merged in the master branch:
commit 774a7bd239227f591abf6294e3f7baaadc115ae9
Author: Eric Cooper <ecc at cmu.edu>
Date:   Sun Mar 8 18:10:40 2009 -0400

    update packaging for new version of approx invoked by inetd

diff --git a/debian/approx.default b/debian/approx.default
deleted file mode 100644
index 5353b0b..0000000
--- a/debian/approx.default
+++ /dev/null
@@ -1,4 +0,0 @@
-# Default settings for approx, included by the /etc/init.d/approx shell script
-
-# Uncomment and edit this definition to have approx use a proxy server
-#export http_proxy=HOST:PORT
diff --git a/debian/approx.init b/debian/approx.init
deleted file mode 100644
index 437e5e8..0000000
--- a/debian/approx.init
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:          approx
-# Required-Start:    $local_fs $remote_fs $network
-# Required-Stop:     $local_fs $remote_fs $network
-# Should-Start:      $syslog $time
-# Should-Stop:       $syslog $time
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: approx caching proxy server
-# Description:       Debian init script to start or stop the approx
-#                    caching proxy server for Debian archive files
-### END INIT INFO
-
-# Author: Eric Cooper <ecc at cmu.edu>
-
-PATH=/usr/sbin:/usr/bin:/sbin:/bin
-DESC="proxy server for Debian archive files"
-NAME=approx
-DAEMON=/usr/sbin/$NAME
-SCRIPTNAME=/etc/init.d/$NAME
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Read configuration variable file if it is present
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-# Define LSB log_* functions
-. /lib/lsb/init-functions
-
-case "$1" in
-  start)
-	log_daemon_msg "Starting $DESC" "$NAME"
-	start-stop-daemon --start --quiet --exec $DAEMON
-	log_end_msg $?
-	;;
-  stop)
-	log_daemon_msg "Stopping $DESC" "$NAME"
-	start-stop-daemon --stop --quiet --exec $DAEMON
-	log_end_msg $?
-	;;
-  restart|force-reload)
-	$0 stop
-	sleep 1
-	$0 start
-	;;
-  *)
-	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
-	exit 1
-	;;
-esac
-
-exit 0
diff --git a/debian/approx.postinst b/debian/approx.postinst
index e4d0ff3..bb84f08 100644
--- a/debian/approx.postinst
+++ b/debian/approx.postinst
@@ -4,15 +4,6 @@ if [ "$1" != "configure" ]; then
     exit 0
 fi
 
-# print the value set for the key ($1) or the specified default ($2) if not set
-# warning: don't insert any whitespace between the double and single quotes!
-
-approx_config() {
-    key="$1"
-    default="$2"
-    awk 'BEGIN { found = 0 } $1 == "'$key'" { found = 1; print $2; exit } END { if (!found) print "'$default'" }' /etc/approx/approx.conf
-}
-
 # add the approx user
 adduser --quiet --system --group --no-create-home --home /var/cache/approx approx
 
@@ -22,31 +13,18 @@ if [ ! -d /var/cache/approx ]; then
     chown approx:approx /var/cache/approx
 fi
 
-# make sure the cache is owned by the approx user and group
-if dpkg --compare-versions "$oldversion" lt 2.07; then
-    chown -R approx:approx /var/cache/approx/.
-fi
+# add entry to /etc/inetd.conf
+update-inetd --add '9999\t\tstream\ttcp\tnowait\tapprox\t/usr/sbin/approx'
 
-# check for non-standard cache location
-cache=$(approx_config cache /var/cache/approx)
-if dpkg --compare-versions "$oldversion" lt 1.13 && [ "$cache" != /var/cache/approx ]; then
-    cat >&2 <<EOF
-Warning: the location of the cache can no longer be set in approx.conf
-         (you appear to have it set to $cache).
-         See /usr/share/doc/approx/NEWS.Debian.gz for details.
-EOF
+# remove unused init script
+if [ -f /etc/init.d/approx ]; then
+    rm -f /etc/init.d/approx
+    update-rc.d approx remove >/dev/null
 fi
 
-# check for potential conflict with apt-proxy
-port=$(approx_config port 9999)
-if [ -x /usr/sbin/apt-proxy ] && [ "$port" = 9999 ]; then
-    cat >&2 <<EOF
-Warning: apt-proxy appears to be installed also.
-         For compatibility with client sources.list files,
-         approx uses the same port (9999) by default.
-         Please stop or remove apt-proxy, or configure
-         one of them to listen on a different port.
-EOF
+# remove unused defaults file
+if [ -f /etc/default/approx ]; then
+    rm -f /etc/default/approx
 fi
 
 #DEBHELPER#
diff --git a/debian/approx.postrm b/debian/approx.postrm
index 1edfc66..23a4d14 100644
--- a/debian/approx.postrm
+++ b/debian/approx.postrm
@@ -1,13 +1,23 @@
 #!/bin/sh -e
 
-if [ "$1" = "purge" ]; then
-    rm -rf /var/cache/approx
-    if [ -x "$(command -v deluser)" -a -x "$(command -v delgroup)" ]; then
-	deluser --quiet --system approx || true
-	delgroup --quiet --system approx || true
-    else
-	echo >&2 "not removing approx user/group: deluser/delgroup command not found"
+remove_inetd() {
+    if [ -x "$(command -v update-inetd)" ]; then
+        update-inetd --remove /usr/sbin/approx
     fi
-fi
+}
+
+remove_cache() {
+    rm -rf /var/cache/approx
+}
+
+case "$1" in
+    remove)
+        remove_inetd
+        ;;
+    purge)
+        remove_inetd
+        remove_cache
+        ;;
+esac
 
 #DEBHELPER#
diff --git a/debian/changelog b/debian/changelog
index bab5b43..48ca25a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+approx (4.0-1) unstable; urgency=low
+
+  * New upstream version
+  * Change approx to run under inetd (closes: #517217, #479493)
+  * Update packaging for OCaml 3.11 (closes: #518727)
+  * Revert to dropping privileges in gc, update, and import
+    (closes: #510761)
+
+ -- Eric Cooper <ecc at cmu.edu>  Sun, 08 Mar 2009 15:07:56 -0400
+
 approx (3.5-1) unstable; urgency=low
 
   * New upstream version
diff --git a/debian/control b/debian/control
index bae097b..da49a31 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Eric Cooper <ecc at cmu.edu>
 Uploaders: Sylvain Le Gall <gildor at debian.org>, Ralf Treinen <treinen at debian.org>
 DM-Upload-Allowed: yes
-Build-Depends: debhelper (>= 7.0), cdbs, dh-ocaml, ocaml-nox (>= 3.11), ocaml-best-compilers, libnethttpd-ocaml-dev (>= 2.2.9), libpcre-ocaml-dev (>= 5.15), libsha-ocaml-dev (>= 1.5), libsyslog-ocaml-dev (>= 1.4), libwrap0-dev
+Build-Depends: debhelper (>= 7.0), cdbs, dh-ocaml, ocaml-nox (>= 3.11), ocaml-best-compilers, libnethttpd-ocaml-dev (>= 2.2.9), libpcre-ocaml-dev (>= 5.15), libsha-ocaml-dev (>= 1.5), libsyslog-ocaml-dev (>= 1.4)
 Standards-Version: 3.8.0
 Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/approx.git
 Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/approx.git
@@ -12,7 +12,7 @@ Homepage: http://git.debian.org/?p=pkg-ocaml-maint/packages/approx.git
 
 Package: approx
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${F:OCamlDeps}, lsb-base (>= 3.2), adduser, bzip2, curl
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${F:OCamlDeps}, lsb-base (>= 3.2), adduser, bzip2, curl, update-inetd
 Description: caching proxy server for Debian archive files
  Approx is an HTTP-based Debian archive server.
  It fetches packages from remote repositories on demand,
@@ -31,6 +31,3 @@ Description: caching proxy server for Debian archive files
  Approx can be used as a replacement for apt-proxy,
  with no need to modify clients' /etc/apt/sources.list files,
  or as an alternative to apt-cacher.
- .
- Approx is intended to be robust, simple, and efficient.
- It is written in OCaml (Objective Caml).
diff --git a/debian/mkversion.pl b/debian/mkversion.pl
deleted file mode 100644
index 27f374e..0000000
--- a/debian/mkversion.pl
+++ /dev/null
@@ -1,31 +0,0 @@
-use strict;
-use warnings;
-
-$ENV{PATH} = "/usr/bin";
-
-my $name = undef;
-my $number = undef;
-
-sub parse_changelog() {
-    open(CHANGELOG, "-|", "dpkg-parsechangelog") or exit 1;
-    while (<CHANGELOG>) {
-	$name = $1 if /^Source:\s+(\S+)/;
-	$number = $1 if /^Version:\s+(\S+)/;
-    }
-    close(CHANGELOG);
-    defined $name or die "$0: package name not found in changelog\n";
-    defined $number or die "$0: version number not found in changelog\n";
-}
-
-sub write_version() {
-    my $t = localtime;
-    print <<EOF;
-(* Generated by $0 on $t *)
-
-let name = "$name"
-let number = "$number"
-EOF
-}
-
-parse_changelog();
-write_version();
diff --git a/debian/rules b/debian/rules
index b1edfab..057a7f8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,9 +12,3 @@ ifeq ($(OCAML_HAVE_OCAMLOPT),no)
     libdeps := $(patsubst %,lib%-ocaml$(comma),$(libs_with_stubs))
     DEB_DH_GENCONTROL_ARGS += -VF:OCamlDeps="ocaml-base-nox-$(OCAML_ABI), $(libdeps)"
 endif
-
-configure/approx::
-	/usr/bin/perl debian/mkversion.pl > version.ml
-
-clean::
-	rm -f version.ml

-- 
approx upstream and debian packaging



More information about the Pkg-ocaml-maint-commits mailing list