Author: tille Date: 2009-01-18 14:57:43 +0000 (Sun, 18 Jan 2009) New Revision: 3019
Added: trunk/packages/mlstdbnet/trunk/debian/README.source trunk/packages/mlstdbnet/trunk/debian/TODO trunk/packages/mlstdbnet/trunk/debian/apache.conf trunk/packages/mlstdbnet/trunk/debian/compat trunk/packages/mlstdbnet/trunk/debian/config trunk/packages/mlstdbnet/trunk/debian/cron.daily trunk/packages/mlstdbnet/trunk/debian/dirs trunk/packages/mlstdbnet/trunk/debian/docs trunk/packages/mlstdbnet/trunk/debian/examples trunk/packages/mlstdbnet/trunk/debian/install trunk/packages/mlstdbnet/trunk/debian/mlstdbnet_xml2sql trunk/packages/mlstdbnet/trunk/debian/po/ trunk/packages/mlstdbnet/trunk/debian/po/POTFILES.in trunk/packages/mlstdbnet/trunk/debian/po/templates.pot trunk/packages/mlstdbnet/trunk/debian/postinst trunk/packages/mlstdbnet/trunk/debian/postrm trunk/packages/mlstdbnet/trunk/debian/prerm trunk/packages/mlstdbnet/trunk/debian/rules trunk/packages/mlstdbnet/trunk/debian/template/ trunk/packages/mlstdbnet/trunk/debian/template/footer.html trunk/packages/mlstdbnet/trunk/debian/template/index.html trunk/packages/mlstdbnet/trunk/debian/template/mlstdbnet.xml trunk/packages/mlstdbnet/trunk/debian/templates Modified: trunk/packages/mlstdbnet/trunk/debian/README.Debian Log: Took over packaging stuff from agdbnet and tried a quite rude s/agdbnet/mlstdbnet/g which most probably does not lead to a workin package but seems to be a reasonable approach to finish the mlstdbnet packaging soon. Modified: trunk/packages/mlstdbnet/trunk/debian/README.Debian =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/README.Debian 2009-01-17 20:56:22 UTC (rev 3018) +++ trunk/packages/mlstdbnet/trunk/debian/README.Debian 2009-01-18 14:57:43 UTC (rev 3019) @@ -5,4 +5,4 @@ ----------------------------------- - -- Andreas Tille <[email protected]>, Wed, 24 Sep 2008 14:23:04 +0200 + -- Andreas Tille <[email protected]>, Wed, 24 Sep 2008 14:23:04 +0200 Added: trunk/packages/mlstdbnet/trunk/debian/README.source =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/README.source (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/README.source 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,16 @@ +README.source for mlstdbnet +=========================== + +The old and unreproducible tweaked java/Djalview.jar is removed from +the upstream source because Upstream said: + + Date: Wed, 14 Jan 2009 07:54:21 +0000 + From: Keith Jolley <[email protected]> + To: Andreas Tille <[email protected]> + + The included jalview binary was modified quite a bit by Man-Suen Chan + (author of mlstdb) and Michele Clamp (original author of JalView version + 1). The functionality is not particularly useful and I've never liked + the way it spawned a Java program anyway, so I'd be happy to see it left out. + + -- Andreas Tille <[email protected]>, Wed, 24 Sep 2008 14:23:04 +0200 Added: trunk/packages/mlstdbnet/trunk/debian/TODO =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/TODO (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/TODO 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,4 @@ +What is the sense of apache-modconf? +The command + apache-modconf apache enable authn_anon +does nothing and I have to manually do Added: trunk/packages/mlstdbnet/trunk/debian/apache.conf =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/apache.conf (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/apache.conf 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,44 @@ +# agcurate default Apache configuration + +ScriptAlias /agcurate/ /usr/share/mlstdbnet/cgi-bin/ +<Directory "/usr/share/mlstdbnet/cgi-bin"> + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + + AuthName "Authentication for agcurator" + AuthType Basic + + # This is a very simple Authentication method which in principle enables + # ANYBODY to authenticate successfully. This definitely should be changed + # to get a secure system. + AuthBasicProvider anon + # A detailed description of Apache authentication mechanisms is given at + # http://httpd.apache.org/docs/2.2/howto/auth.html + # We recommend at least file authentication which is described here + # http://httpd.apache.org/docs/2.2/mod/mod_authn_file.html + # and could be configured like this: + # AuthBasicProvider file + # AuthUserFile /etc/mlstdbnet/htpasswd + # Alternatively you might have an LDAP directory for your local users + # which can be used with Apache LDAP athentication which is described here + # http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html + # Setting up this is quite comfortable for your users because they do + # not need to remember just another password for agcurator but can use + # the same as for local network authentication + # + # I repeat: CHANGE THE AUTHENTICATION METHOD TO SOMETHING MORE SECURE + # BECAUSE EVERYBODY WHO KNOWS YOUR NAME AND E_MAIL ADDRESS MIGHT CURATE + # YOUR mlstdbnet DATABASE OTHERWISE. + + Anonymous_NoUserID off + Anonymous_MustGiveEmail on + Anonymous_VerifyEmail on + Anonymous_LogEmail on + # Accepts any user name and valid e-mail address combination + Anonymous "*" + + Order Deny,Allow + Allow from all + + Require valid-user +</Directory> Added: trunk/packages/mlstdbnet/trunk/debian/compat =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/compat (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/compat 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1 @@ +7 Added: trunk/packages/mlstdbnet/trunk/debian/config =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/config (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/config 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,127 @@ +#!/bin/sh +set -e + +# export should ensure that pkg is available in the template +export pkg=mlstdbnet + +DEBCONF_DEBUG=developer + +. /usr/share/debconf/confmodule +db_version 2.0 + +# 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/mlstdbnet/${xmlname} +# and thus we have to look first, where the config items are stored. +# Then we can read out the remaining config items from the apropriate +# config file + +db_get ${pkg}/xmlname || true +XMLNAME=$RET + +# Verify the existence of a /etc/${pkg}/${XMLNAME}.xml file +if [ -e /etc/${pkg}/${XMLNAME}.xml ] ; then + confavail="true" +else + confavail="false" + # Verify whether there are other potential XML conffiles + if [ -d /etc/${pkg} ] ; then + if grep -q "<mlstdb>" /etc/${pkg}/*.xml 2> /dev/null ; then + # use first potential conffile + confxml=`grep -l "<mlstdb>" /etc/${pkg}/*.xml | head -1` + confxml=`basename ${confxml} .xml` + fi + fi +fi + +if [ "$XMLNAME" = "" ] ; then + if [ "$confavail" = "false" -a "$confxml" != "" ] ; then + XMLNAME="$confxml" + fi +fi + +db_set ${pkg}/xmlname "$XMLNAME" +db_input high ${pkg}/xmlname || true +db_go || true + +# Verify whether config file might contain values different from +# debconf database and set these values +if [ -s /etc/${pkg}/${XMLNAME}.xml ] ; then + ## According to upstream pathogen is not used ... can be removed + ## PATOGEN=`grep '</system>' /etc/${pkg}/${XMLNAME}.xml | sed 's?\([^>]\+\)</system>.*?\1?'` + ## # verify whether Pathogen is set in config file + ## if [ "$PATOGEN" != "##Pathogen##" -a "$PATOGEN" != "" ] ; then + ## db_set ${pkg}/pathogen "$PATOGEN" + ## fi + DESCRIPTION=`grep 'description="' /etc/${pkg}/${XMLNAME}.xml | sed 's/.*description="\([^"]*\)".*/\1/'` + # verify whether description is set in config file + if [ "$DESCRIPTION" != "##Description##" -a "$DESCRIPTION" != "" ] ; then + db_set ${pkg}/description "$DESCRIPTION" + fi + LOCUSFULLNAME=`grep '<locus fullname=' /etc/${pkg}/${XMLNAME}.xml | sed 's/.*<locus fullname="\([^"]*\)".*/\1/'` + # verify whether LocusFullName is set in config file + if [ "$LOCUSFULLNAME" != "##LocusFullName##" -a "$LOCUSFULLNAME" != "" ] ; then + db_set ${pkg}/locusfullname "$LOCUSFULLNAME" + fi + LOCUS=`grep '<locus fullname=' /etc/${pkg}/${XMLNAME}.xml | sed 's/.*<locus fullname="[^"]*">\([^<]\+\)/\1/'` + # verify whether Locus is set in config file + if [ "$LOCUS" != "##Locus##" -a "$LOCUS" != "" ] ; then + db_set ${pkg}/locus "$LOCUS" + fi +fi + +## db_input high ${pkg}/pathogen || true +db_input high ${pkg}/description || true +db_input high ${pkg}/locusfullname || true +db_input high ${pkg}/locus || true +db_input high ${pkg}/note || true + +## Now configure a curator for the agcurator.pl cgi script +## values are stored in +CURATORCONF=/etc/${pkg}/agcurator.conf + +parse_config_string () { + grep "^[[:space:]]*$1[[:space:]]*=[[:space:]]*[^#]\+" "$CURATORCONF" | head -1 | sed "s/^[[:space:]]*$1[[:space:]]*=[[:space:]]*\([^#]\+\).*/\1/" + return 0 +} + +if [ -s "$CURATORCONF" ] ; then + USERNAME=`parse_config_string USERNAME` + if [ "$USERNAME" != "" ] ; then + db_set ${pkg}/curator/username "$USERNAME" + fi + SURNAME=`parse_config_string SURNAME` + if [ "$SURNAME" != "" ] ; then + db_set ${pkg}/curator/surname "$SURNAME" + fi + FIRSTNAME=`parse_config_string FIRSTNAME` + if [ "$FIRSTNAME" != "" ] ; then + db_set ${pkg}/curator/firstname "$FIRSTNAME" + fi + EMAIL=`parse_config_string EMAIL` + if [ "$EMAIL" != "" ] ; then + db_set ${pkg}/curator/email "$EMAIL" + fi +fi + +db_input high ${pkg}/curator/username || true +db_input high ${pkg}/curator/surname || true +db_input high ${pkg}/curator/firstname || true +db_input high ${pkg}/curator/email || true + +# 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 Added: trunk/packages/mlstdbnet/trunk/debian/cron.daily =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/cron.daily (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/cron.daily 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,17 @@ +#!/bin/sh +# populate the refs database once isolate databases have been set up +# +# The config file +CONFFILE=/etc/mlstdbnet/getrefs.conf +# is not installed at package installation time because the information +# in this file has to be edited manually before reasonable operation can +# be accomplished. So this cron job does not do anything until a valid +# $CONFFILE exists. +# +# See /usr/share/doc/mlstdbnet/README.Debian for more detailed information + +PROG=/usr/share/mlstdbnet/getrefs.pl + +if [ -x $PROG -a -s $CONFFILE ] ; then + su - --command "$PROG $CONFFILE" www-data +fi Added: trunk/packages/mlstdbnet/trunk/debian/dirs =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/dirs (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/dirs 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,3 @@ +etc/mlstdbnet +etc/apache2/conf.d +usr/share/dbconfig-common/data/mlstdbnet/install Added: trunk/packages/mlstdbnet/trunk/debian/docs =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/docs (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/docs 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,2 @@ +debian/mlstdbnet_xml2sql + Added: trunk/packages/mlstdbnet/trunk/debian/examples =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/examples (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/examples 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1 @@ +example_xmlfiles/* Added: trunk/packages/mlstdbnet/trunk/debian/install =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/install (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/install 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,9 @@ +cgi-bin/mlstdbnet.pl usr/lib/cgi-bin +cgi-bin/curate.pl usr/share/mlstdbnet/cgi-bin +cgi-bin/lib usr/share/perl5/mlstdbnet +cgi-bin/Plugins usr/share/perl5/mlstdbnet +debian/template usr/share/mlstdbnet +scripts/*.pl usr/share/mlstdbnet +css/stylesheet.css usr/share/mlstdbnet/template +conf/* etc/mlstdbnet +images usr/share/mlstdbnet Added: trunk/packages/mlstdbnet/trunk/debian/mlstdbnet_xml2sql =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/mlstdbnet_xml2sql (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/mlstdbnet_xml2sql 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,75 @@ +#!/bin/sh -e +pkg=mlstdbnet +SQLDIR="/var/lib/${pkg}" + +if [ "$1" != "" ] ; then + XML="/etc/${pkg}/$1" + if [ ! -s "$XML" ] ; then + XML="/etc/${pkg}/$1.xml" + if [ ! -s "$XML" ] ; then + echo "$0: File /etc/${pkg}/$1 or $XML not found." + exit 66 # EX_NOINPUT + fi + fi +else + if [ `grep -c "<mlstdb>" /etc/${pkg}/*.xml` -eq 1 ] ; then + XML=`grep -l "<mlstdb>" /etc/${pkg}/*.xml` + else + if [ `grep -c "<mlstdb>" /etc/${pkg}/*.xml` -eq 0 ] ; then + echo "$0: There are no valid XML configuration files for ${pkg} available in /etc/${pkg}" + exit 66 # EX_NOINPUT + else + cat <<EOT +Usage: $0 [${pkg}.xml] + There are more than one XML files available. + You need to specify the one which should be used to create the database. +EOT + grep -l "<mlstdb>" /etc/${pkg}/*.xml + exit 64 # EX_USAGE + fi + fi +fi + +XMLNAME=`basename $XML .xml` + +if [ -e "$SQLDIR"/"$XMLNAME".sql ] ; then + mv "$SQLDIR"/"$XMLNAME".sql "$SQLDIR"/"$XMLNAME".sql~ +fi +/usr/share/${pkg}/xml2sql.pl -u 'www-data' "$XML" > "$SQLDIR"/"$XMLNAME".sql + +if psql -l | grep -wq "$XMLNAME" ; then + cat <<EOT +$0: The database $XMLNAME just exists. + You might like to manually drop this database and populate a newly created + one with the data in "$SQLDIR"/"$XMLNAME".sql. +EOT + exit 0 +fi + +createdb "$XMLNAME" +psql "$XMLNAME" < "$SQLDIR"/"$XMLNAME".sql + +# try to set curator information +CURATORCONF=/etc/${pkg}/agcurator.conf + +parse_config_string () { + RET=`grep "^[[:space:]]*$1[[:space:]]*=[[:space:]]*[^#]\+" "$CURATORCONF" | head -1 | sed "s/^[[:space:]]*$1[[:space:]]*=[[:space:]]*\([^#]\+\).*/\1/"` + if [ "$RET" = "" ] ; then + echo "Unable to find value $1 in $CURATORCONF. Curator information can not be set." + return -1 + fi + echo "$RET" + return 0 +} + +if [ -s "$CURATORCONF" ] ; then + USERNAME=`parse_config_string USERNAME` + SURNAME=`parse_config_string SURNAME` + FIRSTNAME=`parse_config_string FIRSTNAME` + EMAIL=`parse_config_string EMAIL` +fi + +set -x +psql "$XMLNAME" <<EOT + INSERT INTO users VALUES (1, '$USERNAME', '$SURNAME', '$FIRSTNAME', '$EMAIL', '', 'curator', now(), '') ; +EOT Added: trunk/packages/mlstdbnet/trunk/debian/po/POTFILES.in =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/po/POTFILES.in (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/po/POTFILES.in 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates Added: trunk/packages/mlstdbnet/trunk/debian/po/templates.pot =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/po/templates.pot (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/po/templates.pot 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,279 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <em...@address>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: [email protected]\n" +"POT-Creation-Date: 2009-01-18 15:52+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <em...@address>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#: ../templates:1001 +msgid "Name of the mlstdbnet database:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:1001 +msgid "" +"The package mlstdbnet is using a configuration file which stores the name of " +"the database. The configuration file should have the same name. The " +"database specific configuration items will be stored in the file /etc/" +"mlstdbnet/<name_you_input_here>.xml and can be adjusted there." +msgstr "" + +#. Type: string +#. Description +#: ../templates:1001 +msgid "" +"It is suggested to use a characteristical lower-case character name which is " +"handy for file names for instance. A shortcut for the pathogen that will be " +"typed by mlstdbnet makes perfectly sense." +msgstr "" + +#. Type: string +#. Description +#: ../templates:1001 +msgid "" +"More information is provided online at http://pubmlst.org/software/database/" +"mlstdbnet/attributes.shtml . See the description of the attribute \"longcode" +"\" for the \"<system>\" element." +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Database description:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "" +"Each mlstdbnet database should have a description which includes the " +"pathogen name and genetic locus/loci that the database holds. It is used as " +"<h1> heading and <title> of the generated HTML pages. The description will " +"be stored in the configuration file in /etc/mlstdbnet and can be changed " +"there if needed." +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "" +"Resonable values for such a short description are something like:\n" +" * Campylobacter jejuni FlaA\n" +" * Neisseria meningitidis FetA variable region\n" +" * Streptococcus equi seM" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "" +"More information is provided online at http://pubmlst.org/software/database/" +"mlstdbnet/attributes.shtml . See the description of the attribute " +"\"description\" for the \"<system>\" element." +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Full name of locus:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "" +"A locus describes a genetic locus (gene, partial gene fragment, operon etc.) " +"or a gene product (protein/peptide)." +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "" +"The preconfiguration of this Debian package has a template for one <locus> " +"element which is the minimal required number. If you need more loci you have " +"to edit the XML file manually as it is described later." +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Reasonable values might be: variable region <number>." +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "" +"More information is provided online at http://pubmlst.org/software/database/" +"mlstdbnet/attributes.shtml . See the description of the attribute \"fullname" +"\" for the \"<locus>\" element." +msgstr "" + +#. Type: string +#. Description +#: ../templates:4001 +msgid "Locus abbreviation:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:4001 +msgid "" +"Within the locus element you must have either a nucleotide or a peptide " +"element (or both if you have tables defined for both). The generated XML " +"file in /etc/mlstdbnet contains templates for both and you have to edit this " +"manually as described later." +msgstr "" + +#. Type: string +#. Description +#: ../templates:4001 +msgid "" +"The abbreviation should be short and describe only the locus - for instance " +"for \"variable region 1\" the abbreviation 'VR1' is fine or 'flaA' for " +"\"Campylobacter jejuni FlaA\". The name here is used throughout the website " +"- including the name of sequences when you download in FASTA format. It " +"should definitely be short." +msgstr "" + +#. Type: string +#. Description +#: ../templates:4001 +msgid "" +"More information is provided online at http://pubmlst.org/software/database/" +"mlstdbnet/attributes.shtml . The value here corresponds to the man attribute " +"of the \"<locus>\" element." +msgstr "" + +#. Type: note +#. Description +#: ../templates:5001 +msgid "Hint about configuration of the PubMed reference database" +msgstr "" + +#. Type: note +#. Description +#: ../templates:5001 +msgid "" +"You are now finished with the mlstdbnet configuration. Please read more " +"about mlstdbnet configuration at\n" +" http://pubmlst.org/software/database/mlstdbnet/xml.shtml and\n" +" http://pubmlst.org/software/database/mlstdbnet/attributes.shtml\n" +"and review the XML file in /etc/mlstdbnet and make sure that all values are " +"reasonable. The database is not created automatically and you have to " +"follow the procedure described in /usr/share/doc/mlstdbnet/README.Debian to " +"finish the installation process." +msgstr "" + +#. Type: note +#. Description +#: ../templates:5001 +msgid "" +"The following questions concern the creation of the database for PubMed " +"references. It should be safe to use always default values (just <Enter>)." +msgstr "" + +#. Type: note +#. Description +#: ../templates:5001 +msgid "" +"To enable daily updates of PubMed references you have to create\n" +" /etc/mlstdbnet/getrefs.conf\n" +"according to the template in examples. It is strongly recommended to read\n" +" /usr/share/doc/mlstdbnet/README.Debian\n" +"how to create this file." +msgstr "" + +#. Type: string +#. Description +#: ../templates:6001 +msgid "Username of database curator:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:6001 +msgid "" +"Curators of agdbnat are people who are allowed to insert new sequences into " +"the database which can be used to compare with user provided sequences in " +"mlstdbnet. Curators should be knowledged administrators of the database and " +"need to authenticate themself before they will be able to manage database " +"information. You have to provide a username, real name information and a " +"valid e-mail address." +msgstr "" + +#. Type: string +#. Description +#: ../templates:6001 +msgid "" +"Attention: The method currently used for authentication is insecure. Please " +"read /usr/share/doc/mlstdbnet/README.Debian how to change this to a secure " +"method." +msgstr "" + +#. Type: string +#. Description +#: ../templates:6001 +msgid "" +"Please input the login username for one curator now. Others can be added " +"later." +msgstr "" + +#. Type: string +#. Description +#: ../templates:7001 +msgid "Surname of database curator:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:7001 +msgid "" +"Please input the surname of the person which should work as a curator for " +"mlstdbnet." +msgstr "" + +#. Type: string +#. Description +#: ../templates:8001 +msgid "First name of database curator:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:8001 +msgid "" +"Please input the first name of the person which should work as a curator for " +"mlstdbnet." +msgstr "" + +#. Type: string +#. Description +#: ../templates:9001 +msgid "E-mail address of database curator:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:9001 +msgid "" +"Please input the e-mail address of the person which should work as a curator " +"for mlstdbnet. Please not that your input is not verified now for a valid e-" +"mail address, but once you want to log in as curator only strings containing " +"at least one '@' and a '.' will be accepted." +msgstr "" Added: trunk/packages/mlstdbnet/trunk/debian/postinst =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/postinst (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/postinst 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,169 @@ +#!/bin/sh +# postinst script for mlstdbnet + +set -e + +pkg=mlstdbnet + +DEBCONF_DEBUG=developer +. /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} + +db_get ${pkg}/description +DESCRIPTION=${RET} + +## According to upstream pathogen is not used any more +## db_get ${pkg}/pathogen +## PATHOGEN=${RET} + +db_get ${pkg}/locusfullname +LOCUSFULLNAME=${RET} + +db_get ${pkg}/locus +LOCUS=${RET} + + +# Substitute the value ##variables## in the templates and move them +# right into place +XMLOUT=/etc/${pkg}/"$XMLNAME".xml +# if no config file exists, just create one from the template +if [ ! -e "$XMLOUT" ] ; then + sed -e "s/##database##/${XMLNAME}/g" \ + -e "s/##Description##/${DESCRIPTION}/g" \ + -e "s/##LocusFullName##/${LOCUSFULLNAME}/g" \ + -e "s/##Locus##/${LOCUS}/g" \ + /usr/share/${pkg}/template/${pkg}.xml > \ + "$XMLOUT" +else + cp -a "$XMLOUT" "$XMLOUT".old + sed -i \ + -e "s/longcode=\"[^\"]\+\"/longcode=\"${XMLNAME}\"/g" \ + -e "s/description=\"[^\"]\+\"/description=\"${DESCRIPTION}\"/g" \ + -e "s/<locus fullname=\"[^\"]*\">[^<]\+/<locus fullname=\"${LOCUSFULLNAME}\">${LOCUS}/" \ + "$XMLOUT" +fi + +# All files that might influence the layout of the web site are +# considered config files and stored into /etc/${pkg}/${XMLNAME} +# If such files do not exist they will be created from a simple +# template. +STYLEDIR=/etc/${pkg}/"$XMLNAME" +mkdir -p ${STYLEDIR} +for style in `ls /usr/share/${pkg}/template/*.css /usr/share/${pkg}/template/*.html` ; do + confstyle=`basename $style` + if [ ! -s "$STYLEDIR/$confstyle" ] ; then + if [ "$confstyle" = "index.html" ] ; then + sed -e "s/##database##/${XMLNAME}/g" \ + -e "s/##Description##/${DESCRIPTION}/g" \ + -e "s/##LocusFullName##/${LOCUSFULLNAME}/g" \ + -e "s/##Locus##/${LOCUS}/g" \ + "$style" > "$STYLEDIR/$confstyle" + else + cp -a "$style" "$STYLEDIR/$confstyle" + fi + fi +done + +# Finally a link is put into place to enable mlstdbnet to find these files. +mkdir -p /var/www/${pkg} +if [ ! -L "/var/www/${pkg}/$XMLNAME" -a ! -d "/var/www/${pkg}/$XMLNAME" ] ; then + ln -s "$STYLEDIR" "/var/www/${pkg}/$XMLNAME" +fi + +# Link to image directory +if [ ! -e "/var/www/${pkg}/images" ] ; then + ln -s "/usr/share/${pkg}/images" "/var/www/${pkg}" +fi + +# Obtaining user information for agcurator and write this to the config file +db_get ${pkg}/curator/username +USERNAME=${RET} + +db_get ${pkg}/curator/surname +SURNAME=${RET} + +db_get ${pkg}/curator/firstname +FIRSTNAME=${RET} + +db_get ${pkg}/curator/email +EMAIL=${RET} + +CURATORCONF=/etc/${pkg}/agcurator.conf +if [ ! -s "$CURATORCONF" ] ; then + cat > "$CURATORCONF" <<EOT +# This file is used when creating the mlstdbnet database to add an initial curator +# Please read /usr/share/${pkg}/README.Debian for further information. +USERNAME=${USERNAME} +SURNAME=${SURNAME} +FIRSTNAME=${FIRSTNAME} +EMAIL=${EMAIL} +EOT +else + sed -i~ -e "s/^\([[:space:]]*USERNAME[[:space:]]*=[[:space:]]*\)[^#]\+/\1${USERNAME}/" \ + -e "s/^\([[:space:]]*SURNAME[[:space:]]*=[[:space:]]*\)[^#]\+/\1${SURNAME}/" \ + -e "s/^\([[:space:]]*FIRSTNAME[[:space:]]*=[[:space:]]*\)[^#]\+/\1${FIRSTNAME}/" \ + -e "s/^\([[:space:]]*EMAIL[[:space:]]*=[[:space:]]*\)[^#]\+/\1${EMAIL}/" \ + "$CURATORCONF" +fi + +TMPDIR="/var/www/${pkg}/temporary" +SQLDIR="/var/lib/${pkg}" + +case "$1" in + configure) + [ -d ${TMPDIR} ] || mkdir -p ${TMPDIR} + chgrp www-data ${TMPDIR} + chmod g+w ${TMPDIR} + + # create SQL script from config file + mkdir -p $SQLDIR + # Here the SQL code which is created by xml2sql.pl from config + # file is stored. It is world writable because a normal user + # with proper postgresql permissions should be enabled to create the + # database. + chmod 777 ${SQLDIR} + /usr/share/${pkg}/xml2sql.pl -u '"www-data"' "$XMLOUT" > "$SQLDIR"/"$XMLNAME".sql + chmod 666 "$SQLDIR"/"$XMLNAME".sql + + # Enable Apache anonymous authentication for agcurate.pl + # script + # apache-modconf apache enable authn_anon + # I have no idea for what purpose apache-modconf exists - + # at least it does not set the necessary link - so do it + # manually here ... + if [ ! -L /etc/apache2/mods-enabled/authn_anon.load ] ; then + ln -s ../mods-available/authn_anon.load /etc/apache2/mods-enabled + fi + # Restart Apache to register configuration for agcurator + if apache2ctl configtest 2>/dev/null; then + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d apache2 reload 3>/dev/null || true + else + /etc/init.d/apache2 reload 3>/dev/null || true + fi + else + echo "Your apache2 configuration is broken, so we're not restarting it for you." + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 Added: trunk/packages/mlstdbnet/trunk/debian/postrm =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/postrm (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/postrm 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,63 @@ +#!/bin/sh +# postrm script for mlstdbnet + +set -e + +pkg=mlstdbnet + +. /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 + if ls /etc/${pkg}/*.xml 1>/dev/null 2>/dev/null ; then + for confxml in `grep -l "<mlstdb>" /etc/${pkg}/*.xml` ; do + XMLNAME=`basename ${confxml} .xml` + + rm -f /etc/${pkg}/"$XMLNAME".xml + rm -f /etc/${pkg}/"$XMLNAME".xml.old + # remove style files + rm -rf /etc/${pkg}/"$XMLNAME" + rm -rf /etc/${pkg}/images + # remove link from /var/www to /etc which was created in postinst + rm -rf /var/www/${pkg}/"$XMLNAME" + done + fi + + # If package should be purged also purge temporary web directory + rm -rf /var/www/${pkg}/temporary + + # finally remove web directory + if [ -d /var/www/${pkg} ] ; then + rmdir --ignore-fail-on-non-empty /var/www/${pkg} + fi + + # Remove directory with SQL scripts + if [ -d /var/lib/${pkg} ] ; then + rm -f /var/lib/${pkg}/"$XMLNAME".sql + rmdir --ignore-fail-on-non-empty /var/lib/${pkg} + fi + + # Remove configuration for curator + rm -f /etc/${pkg}/agcurator.conf + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 Added: trunk/packages/mlstdbnet/trunk/debian/prerm =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/prerm (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/prerm 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,19 @@ +#!/bin/sh +# prerm script for mlstdbnet + +set -e + +pkg=mlstdbnet + +. /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 Added: trunk/packages/mlstdbnet/trunk/debian/rules =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/rules (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/rules 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,30 @@ +#!/usr/bin/make -f +# debian/rules for mlstdbnet +# Andreas Tille <[email protected]>; GPL + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +pkg=mlstdbnet + +DEB_COMPRESS_EXCLUDE := .xml + +common-binary-post-install-arch:: + # Directory conf has to be copied to /etc/$(pkg) + 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 + # keep lintian silent ... + chmod 644 debian/$(pkg)/usr/share/dbconfig-common/data/${pkg}/install/pgsql + + # Apache configuration for agcurator.pl + cp -a debian/apache.conf debian/$(pkg)/etc/apache2/conf.d/$(pkg) + +# To update po files as recommended in po-debconf(7) +clean:: + @debconf-updatepo + +get-orig-source: + sh debian/get-orig-source Property changes on: trunk/packages/mlstdbnet/trunk/debian/rules ___________________________________________________________________ Name: svn:executable + * Added: trunk/packages/mlstdbnet/trunk/debian/template/footer.html =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/template/footer.html (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/template/footer.html 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,3 @@ +<!-- This html snippet will be included after the output of the mlstdbnet -- + -- cgi script --> +<p>This is the footer.html file.</p> Added: trunk/packages/mlstdbnet/trunk/debian/template/index.html =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/template/index.html (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/template/index.html 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,18 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" > +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>##Description##</title> + + <meta name="description" content="##Description##" /> + <meta name="keywords" content="mlstdbnet" /> + <meta http-equiv="content-language" content="en" /> + <meta name="language" content="en" /> +</head> +<body> + +##Description##: <a href="http://localhost/cgi-bin/mlstdbnet.pl?file=##database##.xml">##database##</a><br /> +##LocusFullName## + +</body> +</html> Added: trunk/packages/mlstdbnet/trunk/debian/template/mlstdbnet.xml =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/template/mlstdbnet.xml (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/template/mlstdbnet.xml 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<mlstdb> + +<!-- _______________________________________________________ --> +<!-- Before you start --> +<!-- ________________ --> +<!-- As long as there are values marked like ##this## the --> +<!-- XML file is not usable --> +<!-- Make sure you read /usr/share/doc/mlstdbnet/README.Debian --> +<!-- to learn what has to be done! --> +<!-- _______________________________________________________ --> + +<system + longcode="##database##" webroot="/mlstdbnet" indexpage="" + description="##Description##" + downloadFASTAonly="yes" +> +</system> + +<!-- LOCI --> +<locus fullname="##LocusFullName##">##Locus## +<nucleotide> +<field type="int" length="##?##" userupdate="no" comments="primary key">id</field> +<field type="text" length="##?##" width="30" maindisplay="no">sequence</field> +<field type="int" length="##?##" comments="foreign key to peptide table">peptide_id</field> +<field type="text" length="##?##" required="no" maindisplay="no">genbank</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference1</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference2</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference3</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference4</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference5</field> +<field type="int" maindisplay="no" length="4" comments="sender unique name, link to users">sender</field> +<field type="DATE" maindisplay="no" userupdate="no" length="10" comments="date last modified">datestamp</field> +<field type="int" maindisplay="no" userupdate="no" length="4" comments="curator who entered data,link to users">curator</field> +</nucleotide> + +<peptide> +<field type="int" length="##?##" userupdate="no" comments="primary key">id</field> +<field type="text" length="##?##" userupdate="no" width="30">sequence</field> +<field type="text" length="##?##" required="no" maindisplay="no">genbank</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference1</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference2</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference3</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference4</field> +<field type="int" required="no" maindisplay="no" length="10" comments="PubMed number if published">reference5</field> +<field type="int" maindisplay="no" length="4" comments="sender unique name, link to users">sender</field> +<field type="DATE" maindisplay="no" userupdate="no" length="10" comments="date last modified">datestamp</field> +<field type="int" maindisplay="no" userupdate="no" length="4" comments="curator who entered data,link to users">curator</field> +</peptide> +</locus> + +</mlstdb> Added: trunk/packages/mlstdbnet/trunk/debian/templates =================================================================== --- trunk/packages/mlstdbnet/trunk/debian/templates (rev 0) +++ trunk/packages/mlstdbnet/trunk/debian/templates 2009-01-18 14:57:43 UTC (rev 3019) @@ -0,0 +1,132 @@ +Template: mlstdbnet/xmlname +Type: string +_Description: Name of the mlstdbnet database: + The package mlstdbnet is using a configuration file which stores the + name of the database. The configuration file should have the same + name. The database specific configuration items will be stored in + the file /etc/mlstdbnet/<name_you_input_here>.xml and can be adjusted + there. + . + It is suggested to use a characteristical lower-case character + name which is handy for file names for instance. A shortcut for + the pathogen that will be typed by mlstdbnet makes perfectly sense. + . + More information is provided online at + http://pubmlst.org/software/database/mlstdbnet/attributes.shtml . + See the description of the attribute "longcode" for the + "<system>" element. + +Template: mlstdbnet/description +Type: string +_Description: Database description: + Each mlstdbnet database should have a description which includes + the pathogen name and genetic locus/loci that the database holds. + It is used as <h1> heading and <title> of the generated HTML pages. + The description will be stored in the configuration file in + /etc/mlstdbnet and can be changed there if needed. + . + Resonable values for such a short description are something + like: + * Campylobacter jejuni FlaA + * Neisseria meningitidis FetA variable region + * Streptococcus equi seM + . + More information is provided online at + http://pubmlst.org/software/database/mlstdbnet/attributes.shtml . + See the description of the attribute "description" for the + "<system>" element. + +Template: mlstdbnet/locusfullname +Type: string +_Description: Full name of locus: + A locus describes a genetic locus (gene, partial gene fragment, + operon etc.) or a gene product (protein/peptide). + . + The preconfiguration of this Debian package has a template + for one <locus> element which is the minimal required number. + If you need more loci you have to edit the XML file manually + as it is described later. + . + Reasonable values might be: variable region <number>. + . + More information is provided online at + http://pubmlst.org/software/database/mlstdbnet/attributes.shtml . + See the description of the attribute "fullname" for the + "<locus>" element. + +Template: mlstdbnet/locus +Type: string +_Description: Locus abbreviation: + Within the locus element you must have either a nucleotide or + a peptide element (or both if you have tables defined for both). + The generated XML file in /etc/mlstdbnet contains templates for + both and you have to edit this manually as described later. + . + The abbreviation should be short and describe only the locus - + for instance for "variable region 1" the abbreviation 'VR1' is + fine or 'flaA' for "Campylobacter jejuni FlaA". The name here + is used throughout the website - including the name of sequences + when you download in FASTA format. It should definitely be short. + . + More information is provided online at + http://pubmlst.org/software/database/mlstdbnet/attributes.shtml . + The value here corresponds to the man attribute of the "<locus>" + element. + +Template: mlstdbnet/note +Type: note +_Description: Hint about configuration of the PubMed reference database + You are now finished with the mlstdbnet configuration. Please + read more about mlstdbnet configuration at + http://pubmlst.org/software/database/mlstdbnet/xml.shtml and + http://pubmlst.org/software/database/mlstdbnet/attributes.shtml + and review the XML file in /etc/mlstdbnet and make sure that all values + are reasonable. The database is not created automatically and you have + to follow the procedure described in /usr/share/doc/mlstdbnet/README.Debian + to finish the installation process. + . + The following questions concern the creation of the database for PubMed + references. It should be safe to use always default values (just <Enter>). + . + To enable daily updates of PubMed references you have to create + /etc/mlstdbnet/getrefs.conf + according to the template in examples. It is strongly recommended to read + /usr/share/doc/mlstdbnet/README.Debian + how to create this file. + +Template: mlstdbnet/curator/username +Type: string +_Description: Username of database curator: + Curators of agdbnat are people who are allowed to insert new sequences + into the database which can be used to compare with user provided + sequences in mlstdbnet. Curators should be knowledged administrators of + the database and need to authenticate themself before they will be able + to manage database information. You have to provide a username, real + name information and a valid e-mail address. + . + Attention: The method currently used for authentication is insecure. + Please read /usr/share/doc/mlstdbnet/README.Debian how to change this + to a secure method. + . + Please input the login username for one curator now. Others can be + added later. + +Template: mlstdbnet/curator/surname +Type: string +_Description: Surname of database curator: + Please input the surname of the person which should work as a curator + for mlstdbnet. + +Template: mlstdbnet/curator/firstname +Type: string +_Description: First name of database curator: + Please input the first name of the person which should work as a curator + for mlstdbnet. + +Template: mlstdbnet/curator/email +Type: string +_Description: E-mail address of database curator: + Please input the e-mail address of the person which should work as a + curator for mlstdbnet. Please not that your input is not verified now + for a valid e-mail address, but once you want to log in as curator + only strings containing at least one '@' and a '.' will be accepted. _______________________________________________ debian-med-commit mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/debian-med-commit
