[ca-certificates-java] 20/58: * debian/jks-keystore.hook: If we *don't* find libnss3 / libnss3-1d, don't remove files from the filesystem in do_cleanup(), since this has a nasty tendency of nuking system libraries. LP: #855171. * debian/preinst, debian/postinst: when upgrading from version 20110912ubuntu1, disable the buggy hook script early to prevent it from being run before our new version is configured; and re-enable the script in the postinst. LP: #855246. * Mark as Multi-Arch: foreign. * Adjust the libnss3-1d versioned dependency. * Add myself to Uploaders. * Use dh_gencontrol and dpkg-vendor to allow: - New substvar ${nss:Depends} for libnss3-1d versionning. - New @NSS_LIB@ parameter for debian/*.in files.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Wed May 31 13:13:16 UTC 2017


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

ebourg-guest pushed a commit to branch master
in repository ca-certificates-java.

commit feefb7c4493e7ce4e024838c0d5c37637c198390
Author: Damien Raude-Morvan <drazzib at debian.org>
Date:   Sat Feb 25 11:45:04 2012 +0000

    * debian/jks-keystore.hook: If we *don't* find libnss3 / libnss3-1d,
      don't remove files from the filesystem in do_cleanup(),
      since this has a nasty tendency of nuking system libraries.
      LP: #855171.
    * debian/preinst, debian/postinst: when upgrading from version
      20110912ubuntu1, disable the buggy hook script early to prevent it from
      being run before our new version is configured; and re-enable the script
      in the postinst.  LP: #855246.
    * Mark as Multi-Arch: foreign.
    * Adjust the libnss3-1d versioned dependency.
    * Add myself to Uploaders.
    * Use dh_gencontrol and dpkg-vendor to allow:
      - New substvar ${nss:Depends} for libnss3-1d versionning.
      - New @NSS_LIB@ parameter for debian/*.in files.
---
 debian/changelog                                   | 24 ++++++++++++++++++++++
 debian/control                                     |  5 +++--
 debian/{jks-keystore.hook => jks-keystore.hook.in} | 11 ++++++----
 debian/{postinst => postinst.in}                   | 12 +++++++++--
 debian/preinst                                     | 13 ++++++++++++
 debian/rules                                       | 24 ++++++++++++++++++----
 6 files changed, 77 insertions(+), 12 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c0aa673..8a0530d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,27 @@
+ca-certificates-java (20120225) UNRELEASED; urgency=low
+
+  [ Steve Langasek ]
+  * debian/jks-keystore.hook: If we *don't* find libnss3 / libnss3-1d,
+    don't remove files from the filesystem in do_cleanup(),
+    since this has a nasty tendency of nuking system libraries.
+    LP: #855171.
+  * debian/preinst, debian/postinst: when upgrading from version
+    20110912ubuntu1, disable the buggy hook script early to prevent it from
+    being run before our new version is configured; and re-enable the script
+    in the postinst.  LP: #855246.
+
+  [ Matthias Klose ]
+  * Mark as Multi-Arch: foreign.
+  * Adjust the libnss3-1d versioned dependency.
+
+  [ Damien Raude-Morvan ]
+  * Add myself to Uploaders.
+  * Use dh_gencontrol and dpkg-vendor to allow:
+    - New substvar ${nss:Depends} for libnss3-1d versionning.
+    - New @NSS_LIB@ parameter for debian/*.in files.
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Sat, 25 Feb 2012 12:40:51 +0100
+
 ca-certificates-java (20111223) unstable; urgency=low
 
   * Support new multiarch JRE packages in postinst.
diff --git a/debian/control b/debian/control
index 265f815..cb07307 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: ca-certificates-java
 Section: java
 Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
-Uploaders: Matthias Klose <doko at ubuntu.com>, Torsten Werner <twerner at debian.org>
+Uploaders: Matthias Klose <doko at ubuntu.com>, Torsten Werner <twerner at debian.org>, Damien Raude-Morvan <drazzib at debian.org>
 Build-Depends: debhelper (>= 6), default-jdk
 Standards-Version: 3.8.4
 Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/ca-certificates-java
@@ -10,7 +10,8 @@ Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/ca-certificates-java/
 
 Package: ca-certificates-java
 Architecture: all
-Depends: ca-certificates (>= 20090814), openjdk-6-jre-headless (>= 6b16-1.6.1-2) | java6-runtime-headless, ${misc:Depends}, libnss3-1d (>= 3.12.10-2~)
+Multi-Arch: foreign
+Depends: ca-certificates (>= 20090814), openjdk-6-jre-headless (>= 6b16-1.6.1-2) | java6-runtime-headless, ${misc:Depends}, ${nss:Depends}
 # We need a versioned Depends due to multiarch changes (bug #635571).
 #Recommends: libnss3-1d
 Description: Common CA certificates (JKS keystore)
diff --git a/debian/jks-keystore.hook b/debian/jks-keystore.hook.in
similarity index 81%
rename from debian/jks-keystore.hook
rename to debian/jks-keystore.hook.in
index 27c956e..4e4d534 100644
--- a/debian/jks-keystore.hook
+++ b/debian/jks-keystore.hook.in
@@ -40,12 +40,12 @@ if [ ! -f /etc/$jvm/jvm.cfg ]; then
 fi
 
 if dpkg-query --version >/dev/null; then
-    nsspkg=$(dpkg-query -L libnss3-1d | sed -n 's,\(.*\)/libnss3\.so$,\1,p')
+    nsspkg=$(dpkg-query -L @NSS_LIB@ | sed -n 's,\(.*\)/libnss3\.so$,\1,p')
     nssjdk=$(sed -n '/nssLibraryDirectory/s/.*= *\(.*\)/\1/p' $jdir/jre/lib/security/nss.cfg)
     if [ "$nsspkg" != "$nssjdk" ]; then
 	ln -sf $nsspkg/libnss3.so $nssjdk/
     fi
-    softokn3pkg=$(dpkg-query -L libnss3-1d | sed -n 's,\(.*\)/libsoftokn3\.so$,\1,p')
+    softokn3pkg=$(dpkg-query -L @NSS_LIB@ | sed -n 's,\(.*\)/libsoftokn3\.so$,\1,p')
     if [ "$softokn3pkg" != "$nssjdk" ]; then
 	ln -sf $softokn3pkg/libsoftokn3.so $nssjdk/
     fi
@@ -54,10 +54,13 @@ fi
 do_cleanup()
 {
     [ -z "$temp_jvm_cfg" ] || rm -f $temp_jvm_cfg
-    if [ "$nsspkg" != "$nssjdk" ]; then
+    if [ -n "$nsspkg" ] && [ -n "$nssjdk" ] && [ "$nsspkg" != "$nssjdk" ]
+    then
 	rm -f $nssjdk/libnss3.so
     fi
-    if [ "$softokn3pkg" != "$nssjdk" ]; then
+    if [ -n "$softokn3pkg" ] && [ -n "$nssjdk" ] \
+       && [ "$softokn3pkg" != "$nssjdk" ]
+    then
 	rm -f $nssjdk/libsoftokn3.so
     fi
 }
diff --git a/debian/postinst b/debian/postinst.in
similarity index 84%
rename from debian/postinst
rename to debian/postinst.in
index 257d308..e104456 100644
--- a/debian/postinst
+++ b/debian/postinst.in
@@ -2,6 +2,13 @@
 
 set -e
 
+# Disable a critically buggy hook script during upgrade; to be removed
+# after oneiric release
+if [ "$2" = 20110912ubuntu1 ] && [ -e /etc/ca-certificates/update.d/jks-keystore ]
+then
+	chmod +x /etc/ca-certificates/update.d/jks-keystore
+fi
+
 storepass='changeit'
 if [ -f /etc/default/cacerts ]; then
     . /etc/default/cacerts
@@ -24,7 +31,7 @@ setup_path()
 first_install()
 {
     if which dpkg-query --version >/dev/null; then
-	nsspkg=$(dpkg-query -L libnss3 | sed -n 's,\(.*\)/libnss3\.so$,\1,p')
+	nsspkg=$(dpkg-query -L @NSS_LIB@ | sed -n 's,\(.*\)/libnss3\.so$,\1,p')
 	nssjdk=$(sed -n '/nssLibraryDirectory/s/.*= *\(.*\)/\1/p' /etc/$jvm/security/nss.cfg)
 	if [ "$nsspkg" != "$nssjdk" ]; then
 	    ln -sf $nsspkg/libnss3.so $nssjdk/libnss3.so
@@ -48,7 +55,8 @@ first_install()
 do_cleanup()
 {
     [ -z "$temp_jvm_cfg" ] || rm -f $temp_jvm_cfg
-    if [ "$nsspkg" != "$nssjdk" ]; then
+    if [ -n "$nsspkg" ] && [ -n "$nssjdk" ] && [ "$nsspkg" != "$nssjdk" ]
+    then
 	rm -f $nssjdk/libnss3.so
     fi
 }
diff --git a/debian/preinst b/debian/preinst
new file mode 100644
index 0000000..2356c9a
--- /dev/null
+++ b/debian/preinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+# Disable a critically buggy hook script during upgrade; to be removed
+# after oneiric release
+if [ "$2" = 20110912ubuntu1 ] && [ -e /etc/ca-certificates/update.d/jks-keystore ]
+then
+	chmod -x /etc/ca-certificates/update.d/jks-keystore
+fi
+
+#DEBHELPER#
+
diff --git a/debian/rules b/debian/rules
index 44756f9..34d72a9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,14 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
+	SUBSTVARS = -Vnss:Depends="libnss3-1d (>= 3.12.9+ckbi-1.82-0ubuntu3~)"
+	nss_lib = libnss3
+else
+	SUBSTVARS = -Vnss:Depends="libnss3-1d (>= 3.12.10-2~)"
+	nss_lib = libnss3-1d
+endif
+
 JAVA_HOME := /usr/lib/jvm/default-java
 
 d = debian/ca-certificates-java
@@ -18,7 +26,11 @@ clean:
 	dh_testdir
 	dh_testroot
 	$(RM) build-stamp UpdateCertificates.class
-	dh_clean 
+	dh_clean
+	for f in debian/*.in; do \
+	  f2=$$(echo $$f | sed ';s/\.in$$//'); \
+	  rm -f $$f2; \
+	done
 
 install: build
 	dh_testdir
@@ -28,8 +40,12 @@ install: build
 		usr/share/ca-certificates-java \
 		etc/default \
 		etc/ssl/certs/java \
-		etc/ca-certificates/update.d \
-
+		etc/ca-certificates/update.d
+	for f in debian/*.in; do \
+	  f2=$$(echo $$f | sed 's/\.in$$//'); \
+	  sed -e 's/@NSS_LIB@/$(nss_lib)/g' \
+	    $$f > $$f2; \
+	done
 	install -m755 debian/jks-keystore.hook \
 		$(d)/etc/ca-certificates/update.d/jks-keystore
 	install -m600 debian/default \
@@ -45,7 +61,7 @@ binary-indep: build install
 	dh_compress
 	dh_fixperms
 	dh_installdeb
-	dh_gencontrol
+	dh_gencontrol -- $(SUBSTVARS)
 	dh_md5sums
 	dh_builddeb
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/ca-certificates-java.git



More information about the pkg-java-commits mailing list