[Pkg-fedora-ds-maintainers] [libapache2-mod-nss] 156/156: postinst, postrm: Create the nssdb on postinst, clear on postrm.

Timo Aaltonen tjaalton-guest at moszumanska.debian.org
Wed Jul 2 13:55:38 UTC 2014


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

tjaalton-guest pushed a commit to branch master
in repository libapache2-mod-nss.

commit 1e38cf7d0655d71d26dcf47a04ef41321c58ec64
Author: Timo Aaltonen <tjaalton at ubuntu.com>
Date:   Wed Jul 2 16:55:08 2014 +0300

    postinst, postrm: Create the nssdb on postinst, clear on postrm.
---
 debian/changelog                   |  1 +
 debian/libapache2-mod-nss.postinst | 18 ++++++++++++++++++
 debian/libapache2-mod-nss.postrm   | 14 ++++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a16e731..5458fed 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,7 @@ libapache2-mod-nss (1.0.8+git20140226-1) UNRELEASED; urgency=medium
   * rules: Disable tests, too many fedoraisms.
   * manpages: Install manpages for nss_pcache and gencert.
   * rules: Add a symlink to libnssckbi.so to the nssdb.
+  * postinst, postrm: Create the nssdb on postinst, clear on postrm.
 
  -- Timo Aaltonen <tjaalton at ubuntu.com>  Wed, 02 Jul 2014 09:43:00 +0300
 
diff --git a/debian/libapache2-mod-nss.postinst b/debian/libapache2-mod-nss.postinst
new file mode 100644
index 0000000..dccc887
--- /dev/null
+++ b/debian/libapache2-mod-nss.postinst
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+CERTDIR=/etc/apache2/nssdb
+
+if [ "$1" = configure ]; then
+    if [ ! -e $CERTDIR/key4.db ]; then
+        /usr/share/libapache2-mod-nss/gencert \
+		$CERTDIR > $CERTDIR/install.log 2>&1
+        echo "libapache2-mod-nss certificate database generated."
+    fi
+
+    # Make sure that the database ownership is setup properly.
+    find $CERTDIR -user root -name "*.db" -exec /bin/chgrp www-data {} \;
+    find $CERTDIR -user root -name "*.db" -exec /bin/chmod g+r {} \;
+fi
+
+#DEBHELPER#
diff --git a/debian/libapache2-mod-nss.postrm b/debian/libapache2-mod-nss.postrm
new file mode 100644
index 0000000..3fb1de9
--- /dev/null
+++ b/debian/libapache2-mod-nss.postrm
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+
+CERTDIR=/etc/apache2/nssdb
+
+if [ "$1" = purge ]; then
+    for i in cert9.db key4.db install.log pkcs11.txt; do
+        rm -f $CERTDIR/$i
+    done
+    echo "libapache2-mod-nss certificate database cleared."
+fi
+
+#DEBHELPER#
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-fedora-ds/libapache2-mod-nss.git



More information about the Pkg-fedora-ds-maintainers mailing list