[med-svn] r2508 - in trunk/packages/agdbnet/trunk/debian: . patches

tille at alioth.debian.org tille at alioth.debian.org
Thu Sep 18 07:59:20 UTC 2008


Author: tille
Date: 2008-09-18 07:59:19 +0000 (Thu, 18 Sep 2008)
New Revision: 2508

Added:
   trunk/packages/agdbnet/trunk/debian/patches/10_apache_is_web-data.patch
   trunk/packages/agdbnet/trunk/debian/prerm
Modified:
   trunk/packages/agdbnet/trunk/debian/config
   trunk/packages/agdbnet/trunk/debian/control
   trunk/packages/agdbnet/trunk/debian/dirs
   trunk/packages/agdbnet/trunk/debian/patches/series
   trunk/packages/agdbnet/trunk/debian/postinst
   trunk/packages/agdbnet/trunk/debian/postrm
   trunk/packages/agdbnet/trunk/debian/rules
Log:
Use dbconfig-common to install references database


Modified: trunk/packages/agdbnet/trunk/debian/config
===================================================================
--- trunk/packages/agdbnet/trunk/debian/config	2008-09-17 17:11:13 UTC (rev 2507)
+++ trunk/packages/agdbnet/trunk/debian/config	2008-09-18 07:59:19 UTC (rev 2508)
@@ -9,6 +9,23 @@
 . /usr/share/debconf/confmodule
 db_version 2.0
 
+# Try to enforce a yes to first question whether we want dbconfig-common
+# automatism, because we really want it ...
+db_set ${pkg}/dbconfig-install "true" || true
+db_go || true
+# unfortunately neither this nor setting dbc_authmethod_user
+# prevents dbconfig-common from asking about these values again :-((
+
+dbc_dbuser='www-data'
+dbc_dbname='refs'
+dbc_authmethod_user="ident"
+
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
+    . /usr/share/dbconfig-common/dpkg/config.pgsql
+    dbc_go ${pkg} $@
+fi
+
 # Check whether there is an xmlname stored in debconf database
 # Yes, debconf is no registry, but the real place of the real
 # information is stored in the configfile /etc/agdbnet/${xmlname}

Modified: trunk/packages/agdbnet/trunk/debian/control
===================================================================
--- trunk/packages/agdbnet/trunk/debian/control	2008-09-17 17:11:13 UTC (rev 2507)
+++ trunk/packages/agdbnet/trunk/debian/control	2008-09-18 07:59:19 UTC (rev 2508)
@@ -13,7 +13,7 @@
 Package: agdbnet
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, emboss, blast2, postgresql-8.3,
- libcgi-pm-perl, libdbd-pg-perl, libxml-perl
+ libcgi-pm-perl, libdbd-pg-perl, libxml-perl, dbconfig-common
 Description: antigen sequence database software for web-based bacterial typing
  AgdbNet facilitates simultaneous BLAST querying of multiple loci using
  either nucleotide or peptide sequences.  Databases are described by XML

Modified: trunk/packages/agdbnet/trunk/debian/dirs
===================================================================
--- trunk/packages/agdbnet/trunk/debian/dirs	2008-09-17 17:11:13 UTC (rev 2507)
+++ trunk/packages/agdbnet/trunk/debian/dirs	2008-09-18 07:59:19 UTC (rev 2508)
@@ -1 +1,2 @@
-/etc/agdbnet
+etc/agdbnet
+usr/share/dbconfig-common/data/agdbnet/install

Added: trunk/packages/agdbnet/trunk/debian/patches/10_apache_is_web-data.patch
===================================================================
--- trunk/packages/agdbnet/trunk/debian/patches/10_apache_is_web-data.patch	                        (rev 0)
+++ trunk/packages/agdbnet/trunk/debian/patches/10_apache_is_web-data.patch	2008-09-18 07:59:19 UTC (rev 2508)
@@ -0,0 +1,76 @@
+Apache runs as user www-data on Debian systems - so replace any
+occurence of system user apache by www-data
+--- agdbnet_v1.0.0.orig/cgi-bin/agcurate.pl
++++ agdbnet_v1.0.0/cgi-bin/agcurate.pl
+@@ -80,7 +80,7 @@
+ 		$system{'port'} = 5432;
+ 	}
+ 	if ( !$system{'user'} ) {
+-		$system{'user'} = 'apache';
++		$system{'user'} = 'www-data';
+ 	}
+ 	if ( !$system{'pass'} ) {
+ 		$system{'pass'} = 'remote';
+--- agdbnet_v1.0.0.orig/cgi-bin/agdbnet.pl
++++ agdbnet_v1.0.0/cgi-bin/agdbnet.pl
+@@ -157,7 +157,7 @@
+ 		$system{'port'} = 5432;
+ 	}
+ 	if ( !$system{'user'} ) {
+-		$system{'user'} = 'apache';
++		$system{'user'} = 'www-data';
+ 	}
+ 	if ( !$system{'pass'} ) {
+ 		$system{'pass'} = 'remote';
+--- agdbnet_v1.0.0.orig/examples/poravr.xml
++++ agdbnet_v1.0.0/examples/poravr.xml
+@@ -131,7 +131,7 @@
+ <field type="text" length="256">description</field>
+ </auxtable>
+ 
+-<extisolates dbase="nm_isolates" host="localhost" port="5432" user="apache" pass="remote" view="isolates" fullname="PubMLST isolates" url="http://pubmlst.org/cgi-bin/mlstdbnet/mlstdbnet.pl?file=pub-nm_isolates.xml&amp;page=straininfo&amp;id=\?">PubMLST
++<extisolates dbase="nm_isolates" host="localhost" port="5432" user="www-data" pass="remote" view="isolates" fullname="PubMLST isolates" url="http://pubmlst.org/cgi-bin/mlstdbnet/mlstdbnet.pl?file=pub-nm_isolates.xml&amp;page=straininfo&amp;id=\?">PubMLST
+ <field type="int" length="5" userupdate="no" comments="primary key">id</field>
+ <field type="text" length="20" comments="Original strain name as supplied by sender">strain</field>
+ <field type="text" required="no" maindisplay="no" length="20"
+--- agdbnet_v1.0.0.orig/installation.html
++++ agdbnet_v1.0.0/installation.html
+@@ -38,9 +38,9 @@
+ <li>Create the SQL file to generate the database using the xml2sql.pl script found in the scripts directory.  First make sure that the XML has a valid syntax by running the script as below:<br />
+ <p />
+ <p class="code">./xml2sql.pl database.xml</p>
+-where 'database.xml' is the XML file you created above (change the filename as appropriate).  If the script does not produce an error message, generate your SQL file as follows - substitute the name of the web server user account for 'apache':<br />
++where 'database.xml' is the XML file you created above (change the filename as appropriate).  If the script does not produce an error message, generate your SQL file as follows - substitute the name of the web server user account for 'www-data':<br />
+ <p />
+-<p class="code">./xml2sql.pl -u apache database.xml > database.sql</p></li>
++<p class="code">./xml2sql.pl -u www-data database.xml > database.sql</p></li>
+ <li>Create the database - you may need to log in with an account with permissions to create new databases, e.g. 'postgres':<br />
+ <p />
+ <p class="code">createdb database</p>
+@@ -60,4 +60,4 @@
+ </ol>
+ 
+ </body>
+-</html>
+\ No newline at end of file
++</html>
+--- agdbnet_v1.0.0.orig/scripts/xml2sql.pl
++++ agdbnet_v1.0.0/scripts/xml2sql.pl
+@@ -45,7 +45,7 @@
+ 	$webuser = $opts{'u'};
+ }
+ else {
+-	$webuser = 'apache';
++	$webuser = 'www-data';
+ }
+ my $instance = $ARGV[0];
+ if ( !$instance ) {
+--- agdbnet_v1.0.0.orig/setup/refs.sql
++++ agdbnet_v1.0.0/setup/refs.sql
+@@ -23,4 +23,4 @@
+ PRIMARY KEY (pmid)
+ );
+ 
+-GRANT SELECT ON authors,refs TO apache;
+\ No newline at end of file
++GRANT SELECT ON authors,refs TO "www-data";

Modified: trunk/packages/agdbnet/trunk/debian/patches/series
===================================================================
--- trunk/packages/agdbnet/trunk/debian/patches/series	2008-09-17 17:11:13 UTC (rev 2507)
+++ trunk/packages/agdbnet/trunk/debian/patches/series	2008-09-18 07:59:19 UTC (rev 2508)
@@ -3,3 +3,4 @@
 10_preconf.patch
 10_moreinfo.patch
 10_config_location.patch
+10_apache_is_web-data.patch

Modified: trunk/packages/agdbnet/trunk/debian/postinst
===================================================================
--- trunk/packages/agdbnet/trunk/debian/postinst	2008-09-17 17:11:13 UTC (rev 2507)
+++ trunk/packages/agdbnet/trunk/debian/postinst	2008-09-18 07:59:19 UTC (rev 2508)
@@ -1,7 +1,5 @@
 #!/bin/sh
 # postinst script for agdbnet
-#
-# see: dh_installdeb(1)
 
 set -e
 
@@ -11,6 +9,12 @@
 . /usr/share/debconf/confmodule
 db_version 2.0
 
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
+    . /usr/share/dbconfig-common/dpkg/postinst.pgsql
+    dbc_go ${pkg} $@
+fi
+
 db_get ${pkg}/xmlname
 XMLNAME=${RET}
 

Modified: trunk/packages/agdbnet/trunk/debian/postrm
===================================================================
--- trunk/packages/agdbnet/trunk/debian/postrm	2008-09-17 17:11:13 UTC (rev 2507)
+++ trunk/packages/agdbnet/trunk/debian/postrm	2008-09-18 07:59:19 UTC (rev 2508)
@@ -1,12 +1,19 @@
 #!/bin/sh
 # postrm script for agdbnet
-#
-# see: dh_installdeb(1)
 
 set -e
 
 pkg=agdbnet
 
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+# source dbconfig-common shell library, and call the hook function 
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
+    . /usr/share/dbconfig-common/dpkg/postrm.pgsql
+    dbc_go ${pkg} $@
+fi
+
 case "$1" in
     purge)
 	# remove all potential config files and dirs in /var/www

Added: trunk/packages/agdbnet/trunk/debian/prerm
===================================================================
--- trunk/packages/agdbnet/trunk/debian/prerm	                        (rev 0)
+++ trunk/packages/agdbnet/trunk/debian/prerm	2008-09-18 07:59:19 UTC (rev 2508)
@@ -0,0 +1,19 @@
+#!/bin/sh
+# prerm script for agdbnet
+
+set -e
+
+pkg=agdbnet
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+# source dbconfig-common shell library, and call the hook function 
+if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
+    . /usr/share/dbconfig-common/dpkg/config.pgsql
+    dbc_go ${pkg} $@
+fi
+
+#DEBHELPER#
+
+exit 0

Modified: trunk/packages/agdbnet/trunk/debian/rules
===================================================================
--- trunk/packages/agdbnet/trunk/debian/rules	2008-09-17 17:11:13 UTC (rev 2507)
+++ trunk/packages/agdbnet/trunk/debian/rules	2008-09-18 07:59:19 UTC (rev 2508)
@@ -12,6 +12,10 @@
 common-binary-post-install-arch::
 	# Directory conf has to be copied to /etc/agdbnet
 	cp -a conf/* debian/$(pkg)/etc/$(pkg)
+	
+	# copy script to setup PubMed reference fields into
+	# apropriate dbconfig-common dir
+	cp -a setup/refs.sql debian/$(pkg)/usr/share/dbconfig-common/data/${pkg}/install/pgsql
 
 # To update po files as recommended in po-debconf(7)
 clean::




More information about the debian-med-commit mailing list