[Pkg-privacy-commits] [flashproxy] 03/65: add gitignore and post{inst, rm} scripts for facilitator

Ximin Luo infinity0 at moszumanska.debian.org
Fri Aug 21 13:49:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch _volatile-rc
in repository flashproxy.

commit ab92e244b4a941eb09f996bae884f98e0b956b6e
Author: Ximin Luo <infinity0 at gmx.com>
Date:   Thu Nov 21 00:01:10 2013 +0000

    add gitignore and post{inst,rm} scripts for facilitator
---
 debian/.gitignore                      | 12 ++++++
 debian/control                         |  2 +-
 debian/flashproxy-facilitator.install  |  2 +
 debian/flashproxy-facilitator.postinst | 73 ++++++++++++++++++++++++++++++++++
 debian/flashproxy-facilitator.postrm   | 54 +++++++++++++++++++++++++
 debian/rules                           |  5 ++-
 6 files changed, 146 insertions(+), 2 deletions(-)

diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644
index 0000000..ebb1360
--- /dev/null
+++ b/debian/.gitignore
@@ -0,0 +1,12 @@
+/autoreconf.*
+/*.substvars
+/*.debhelper.log
+/*.debhelper
+/files
+/tmp
+
+/flashproxy-client/
+/flashproxy-common/
+/flashproxy-facilitator/
+/flashproxy-proxy/
+/node-flashproxy/
diff --git a/debian/control b/debian/control
index b637b52..6e96c51 100644
--- a/debian/control
+++ b/debian/control
@@ -49,7 +49,7 @@ Description: Pluggable transport for ephemeral IP addresses - client transport p
 
 Package: flashproxy-facilitator
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, flashproxy-common, python, python-m2crypto
+Depends: ${misc:Depends}, ${python:Depends}, flashproxy-common, python, python-m2crypto, openssl
 Recommends: httpd-cgi | apache2
 Suggests: flashproxy-proxy
 Description: Pluggable transport for ephemeral IP addresses - facilitator
diff --git a/debian/flashproxy-facilitator.install b/debian/flashproxy-facilitator.install
index cf28976..9710595 100644
--- a/debian/flashproxy-facilitator.install
+++ b/debian/flashproxy-facilitator.install
@@ -1,5 +1,7 @@
 etc/flashproxy/reg-*
 etc/flashproxy/facilitator*
+etc/default/*
+etc/init.d/*
 usr/bin/facilitator*
 usr/lib/cgi-bin/facilitator*
 usr/share/flashproxy-facilitator/*
diff --git a/debian/flashproxy-facilitator.postinst b/debian/flashproxy-facilitator.postinst
new file mode 100644
index 0000000..a68d697
--- /dev/null
+++ b/debian/flashproxy-facilitator.postinst
@@ -0,0 +1,73 @@
+#!/bin/sh
+# postinst script for flashproxy-facilitator
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+fpfacilitatoruser=fp-facilitator
+pkgconfdir=/etc/flashproxy
+exampledir=/usr/share/doc/flashproxy-facilitator/examples
+appengineconfdir=${pkgconfdir}/reg-appspot
+appenginedir=/usr/share/flashproxy-facilitator/appengine
+
+case "$1" in
+    configure)
+        # install user
+        id -u ${fpfacilitatoruser} >/dev/null 2>&1 || { \
+        which adduser >/dev/null 2>&1 && \
+          adduser --quiet \
+            --system \
+            --group \
+            --disabled-password \
+            --home ${pkgconfdir} \
+            --no-create-home \
+            --shell /bin/false \
+            ${fpfacilitatoruser} || \
+          useradd \
+            --system \
+            --home ${pkgconfdir} \
+            -M \
+            --shell /bin/false \
+            ${fpfacilitatoruser} ; }
+        # install secrets
+        test -f ${pkgconfdir}/reg-daemon.key || { \
+          install -m 600 /dev/null ${pkgconfdir}/reg-daemon.key && \
+          openssl genrsa 2048 | tee ${pkgconfdir}/reg-daemon.key | \
+          openssl rsa -pubout > ${pkgconfdir}/reg-daemon.pub; }
+        test -f ${pkgconfdir}/reg-email.pass || { \
+          install -m 600 /dev/null ${pkgconfdir}/reg-email.pass && \
+          cat ${exampledir}/reg-email.pass > ${pkgconfdir}/reg-email.pass; }
+        # install symlinks
+        for i in fp-reg.go app.yaml; do \
+          ln -s -f ${appenginedir}/$i ${appengineconfdir}/$i; \
+        done
+    ;;
+
+    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 --git a/debian/flashproxy-facilitator.postrm b/debian/flashproxy-facilitator.postrm
new file mode 100644
index 0000000..e322aff
--- /dev/null
+++ b/debian/flashproxy-facilitator.postrm
@@ -0,0 +1,54 @@
+#!/bin/sh
+# postrm script for flashproxy-facilitator
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+pkgconfdir=/etc/flashproxy
+appengineconfdir=${pkgconfdir}/reg-appspot
+
+case "$1" in
+    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+        # remove symlinks
+        for i in fp-reg.go app.yaml; do \
+          rm -f ${appengineconfdir}/$i; \
+        done
+        if [ "$1" = "purge" ]; then
+            # remove secrets
+            for i in reg-daemon.key reg-daemon.pub reg-email.pass; do \
+              rm -f ${pkgconfdir}/$i; \
+            done
+            # remove daemon data e.g. logs
+            for name in facilitator facilitator-reg-daemon facilitator-email-poller; do
+                rm -f /var/log/${name}.log*
+                rm -f /var/run/${name}.pid
+            done
+        fi
+    ;;
+
+    *)
+        echo "postrm 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 --git a/debian/rules b/debian/rules
index 5569548..633108a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,7 +18,7 @@ override_dh_install:
 
 override_dh_auto_configure:
 	ln -sf setup-common.py setup.py
-	dh_auto_configure $(DH_facilitator) -- cgibindir=/usr/lib/cgi-bin
+	dh_auto_configure $(DH_facilitator) --enable-initscripts cgibindir=/usr/lib/cgi-bin
 
 override_dh_auto_build:
 	dh_auto_build $(DH_common)
@@ -35,6 +35,9 @@ override_dh_auto_install:
 	dh_auto_install $(DH_common)
 	dh_auto_install $(DH_client)
 	dh_auto_install $(DH_facilitator)
+	for name in facilitator facilitator-reg-daemon facilitator-email-poller; do \
+	  dh_installinit -p flashproxy-facilitator -o --name=$${name}; \
+	done
 
 override_dh_auto_clean:
 	ln -sf setup-common.py setup.py

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/flashproxy.git



More information about the Pkg-privacy-commits mailing list