pz2.js is available in a separate package pazpar2-js.
authorAdam Dickmeiss <adam@indexdata.dk>
Sat, 13 Sep 2008 06:51:23 +0000 (08:51 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Sat, 13 Sep 2008 06:51:23 +0000 (08:51 +0200)
The Java Script librar pz2.js is now available as a separate package.
This was done becuase pz2.js is a architecture independent package and
because it may exist without pazpar2 itself which may run on a different
host.

debian/ap2pazpar2-js.cfg [new file with mode: 0644]
debian/ap2pazpar2.cfg
debian/control
debian/pazpar2-js.dirs [new file with mode: 0644]
debian/pazpar2-js.postinst [new file with mode: 0644]
debian/pazpar2-js.postrm [new file with mode: 0644]
debian/rules

diff --git a/debian/ap2pazpar2-js.cfg b/debian/ap2pazpar2-js.cfg
new file mode 100644 (file)
index 0000000..99ee4f9
--- /dev/null
@@ -0,0 +1,3 @@
+Alias /pazpar2 /usr/share/pazpar2
+
+
index 9ce2faf..93f8a3e 100644 (file)
@@ -8,6 +8,3 @@ ProxyVia Off
 
 ProxyPass /pazpar2/search.pz2 http://localhost:8004/search.pz2
 
-Alias /pazpar2 /usr/share/pazpar2/
-
-
index 2f13119..175e8bc 100644 (file)
@@ -18,6 +18,18 @@ Description: High-performance metaseacher
  service which, by default, makes Pazpar2 operate as HTTP server on port
  8004.
 
+Package: pazpar2-js
+Architecture: all
+Depends: apache2.2-common
+Description: Java Script utilities
+ Pazpar2 is a high-performance, user interface-independent, data
+ model-independent metasearching middleware featuring merging, relevance
+ ranking, record sorting, and faceted results.
+ .
+ This package includes the Java Script library pz2.js. It also adds an
+ Alias for Apache2 so that this library and other demo portals are
+ available.
+
 Package: pazpar2-doc
 Section: doc
 Architecture: all
@@ -41,7 +53,7 @@ Description: Apache2 configuration for Pazpar2
 
 Package: pazpar2-test1
 Architecture: all
-Depends: pazpar2, pazpar2-apache2
+Depends: pazpar2-apache2, pazpar2-js
 Description: Pazpar2 portal test1
  Pazpar2 is a high-performance, user interface-independent, data
  model-independent metasearching middleware featuring merging, relevance
@@ -53,7 +65,7 @@ Description: Pazpar2 portal test1
 
 Package: pazpar2-jsdemo
 Architecture: all
-Depends: pazpar2, pazpar2-apache2
+Depends: pazpar2-apache2, pazpar2-js
 Description: Pazpar2 demo using the pz2.js library
  Pazpar2 is a high-performance, user interface-independent, data
  model-independent metasearching middleware featuring merging, relevance
diff --git a/debian/pazpar2-js.dirs b/debian/pazpar2-js.dirs
new file mode 100644 (file)
index 0000000..3a79cea
--- /dev/null
@@ -0,0 +1,2 @@
+usr/share/pazpar2/js
+etc/pazpar2
diff --git a/debian/pazpar2-js.postinst b/debian/pazpar2-js.postinst
new file mode 100644 (file)
index 0000000..2e91299
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+if [ "$1" != "configure" ]; then
+    exit 0
+fi
+
+reload_apache()
+{
+    if apache2ctl configtest 2>/dev/null; then
+       invoke-rc.d apache2 force-reload || true
+    else
+       echo "Your apache2 configuration is broken, so we're not restarting it for you."
+    fi
+}
+
+if [ -e /etc/apache2/apache2.conf ]; then
+    if [ -d /etc/apache2/conf.d ]; then
+       ln -sf /etc/pazpar2/ap2pazpar2-js.cfg /etc/apache2/conf.d/pazpar2-js
+    fi
+    
+    reload_apache
+fi
+exit 0
diff --git a/debian/pazpar2-js.postrm b/debian/pazpar2-js.postrm
new file mode 100644 (file)
index 0000000..cbfc288
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh -e
+
+case "$1" in
+    purge|remove)
+        WEBSERVERS="apache2"
+        for apache in $WEBSERVERS; do
+            if [ -f "/etc/$apache/conf.d/pazpar2-js" ]; then
+                echo "Removing pazpar2-js configuration file for $apache.."
+                rm -f /etc/$apache/conf.d/pazpar2-js
+                if [ -f "/var/run/$apache.pid" ]; then
+                    invoke-rc.d $apache reload
+                fi
+            fi
+        done
+        ;;
+    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+        ;;
+
+    *)
+        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
+
index 32fb674..0854b6e 100755 (executable)
@@ -92,6 +92,13 @@ binary-arch: build install
        cp www/jsdemo/*.html $(CURDIR)/debian/pazpar2-jsdemo/usr/share/pazpar2/jsdemo/
        cp www/jsdemo/*.js $(CURDIR)/debian/pazpar2-jsdemo/usr/share/pazpar2/jsdemo/
        cp www/jsdemo/*.gif $(CURDIR)/debian/pazpar2-jsdemo/usr/share/pazpar2/jsdemo/
+       cp www/jsdemo/*.css $(CURDIR)/debian/pazpar2-jsdemo/usr/share/pazpar2/jsdemo/
+       # pazpar2-js package
+       cp $(CURDIR)/debian/ap2pazpar2-js.cfg $(CURDIR)/debian/pazpar2-js/etc/pazpar2
+       mv $(CURDIR)/debian/pazpar2/usr/share/pazpar2/js/pz2.js $(CURDIR)/debian/pazpar2-js/usr/share/pazpar2/js/
+
+       # rest
+
        dh_installchangelogs NEWS
        dh_installdocs
        dh_installexamples