diff -Nru ca-certificates-java-20120721/debian/ca-certificates-java.triggers ca-certificates-java-20121112+nmu1/debian/ca-certificates-java.triggers
--- ca-certificates-java-20120721/debian/ca-certificates-java.triggers	1969-12-31 16:00:00.000000000 -0800
+++ ca-certificates-java-20121112+nmu1/debian/ca-certificates-java.triggers	2012-11-12 18:03:54.000000000 -0800
@@ -0,0 +1 @@
+activate update-ca-certificates
diff -Nru ca-certificates-java-20120721/debian/changelog ca-certificates-java-20121112+nmu1/debian/changelog
--- ca-certificates-java-20120721/debian/changelog	2012-07-21 05:05:01.000000000 -0700
+++ ca-certificates-java-20121112+nmu1/debian/changelog	2012-11-13 12:58:29.000000000 -0800
@@ -1,3 +1,17 @@
+ca-certificates-java (20121112+nmu1) unstable; urgency=low
+
+  * Non-maintainer upload
+  * Fix test for dpkg-query in postinst; there was an extraneous --version
+    here. [Probably don't even need to bother to check for dpkg-query, but
+    why not.] (Closes: #690204)
+  * Library path for softokn3pkg and nsspkg is potentially wrong if there
+    are multiple different paths; fix it.
+  * Do not run the hook if ca-certificates-java has been removed but not
+    purged.
+  * Use the new trigger support provided by ca-certificates (>=20121112).
+
+ -- Don Armstrong <don@debian.org>  Mon, 12 Nov 2012 15:45:50 -0800
+
 ca-certificates-java (20120721) unstable; urgency=low
 
   * Fix jks-keystore and postinst to work on multi-arch system.
diff -Nru ca-certificates-java-20120721/debian/control ca-certificates-java-20121112+nmu1/debian/control
--- ca-certificates-java-20120721/debian/control	2012-06-08 15:05:19.000000000 -0700
+++ ca-certificates-java-20121112+nmu1/debian/control	2012-11-13 12:57:13.000000000 -0800
@@ -15,7 +15,7 @@
 Package: ca-certificates-java
 Architecture: all
 Multi-Arch: foreign
-Depends: ca-certificates (>= 20090814),
+Depends: ca-certificates (>= 20121112),
          ${jre:Depends} | java6-runtime-headless,
          ${misc:Depends},
          ${nss:Depends}
diff -Nru ca-certificates-java-20120721/debian/jks-keystore.hook.in ca-certificates-java-20121112+nmu1/debian/jks-keystore.hook.in
--- ca-certificates-java-20120721/debian/jks-keystore.hook.in	2012-07-21 04:30:21.000000000 -0700
+++ ca-certificates-java-20121112+nmu1/debian/jks-keystore.hook.in	2012-11-12 16:50:31.000000000 -0800
@@ -25,7 +25,7 @@
 }
 
 echo ""
-if [ "$cacerts_updates" != yes ] || [ "$CACERT_UPDATES" = disabled ]; then
+if [ "$cacerts_updates" != yes ] || [ "$CACERT_UPDATES" = disabled ] || [ ! -e $JAR ]; then
     echo "updates of cacerts keystore disabled."
     exit 0
 fi
@@ -53,12 +53,12 @@
 fi
 
 if dpkg-query --version >/dev/null; then
-    nsspkg=$(dpkg-query -L "$(nsslib_name)" | sed -n 's,\(.*\)/libnss3\.so$,\1,p')
+    nsspkg=$(dpkg-query -L "$(nsslib_name)" | sed -n 's,\(.*\)/libnss3\.so$,\1,p'|head -n 1)
     nssjdk=$(sed -n '/nssLibraryDirectory/s/.*= *\(.*\)/\1/p' /etc/${jvm%-$arch}/security/nss.cfg)
     if [ -n "$nsspkg" ] && [ -n "$nssjdk" ] && [ "$nsspkg" != "$nssjdk" ]; then
         ln -sf $nsspkg/libnss3.so $nssjdk/libnss3.so
     fi
-    softokn3pkg=$(dpkg-query -L "$(nsslib_name)" | sed -n 's,\(.*\)/libsoftokn3\.so$,\1,p')
+    softokn3pkg=$(dpkg-query -L "$(nsslib_name)" | sed -n 's,\(.*\)/libsoftokn3\.so$,\1,p'|head -n 1)
     if [ -n "$softokn3pkg" ] && [ -n "$nssjdk" ] && [ "$softokn3pkg" != "$nssjdk" ]; then
         ln -sf $softokn3pkg/libsoftokn3.so $nssjdk/libsoftokn3.so
     fi
diff -Nru ca-certificates-java-20120721/debian/postinst.in ca-certificates-java-20121112+nmu1/debian/postinst.in
--- ca-certificates-java-20120721/debian/postinst.in	2012-07-21 04:30:13.000000000 -0700
+++ ca-certificates-java-20121112+nmu1/debian/postinst.in	2012-11-12 16:44:54.000000000 -0800
@@ -38,8 +38,8 @@
 
 first_install()
 {
-    if which dpkg-query --version >/dev/null; then
-    nsspkg=$(dpkg-query -L "$(nsslib_name)" | sed -n 's,\(.*\)/libnss3\.so$,\1,p')
+    if which dpkg-query >/dev/null; then
+    nsspkg=$(dpkg-query -L "$(nsslib_name)" | sed -n 's,\(.*\)/libnss3\.so$,\1,p'|head -n 1)
     nssjdk=$(sed -n '/nssLibraryDirectory/s/.*= *\(.*\)/\1/p' /etc/${jvm%-$arch}/security/nss.cfg)
     if [ -n "$nsspkg" ] && [ -n "$nssjdk" ] && [ "$nsspkg" != "$nssjdk" ]; then
         ln -sf $nsspkg/libnss3.so $nssjdk/libnss3.so
