Author: tille Date: 2008-09-24 13:14:12 +0000 (Wed, 24 Sep 2008) New Revision: 2531
Added: trunk/packages/agdbnet/trunk/debian/doc Modified: trunk/packages/agdbnet/trunk/debian/README.Debian trunk/packages/agdbnet/trunk/debian/config trunk/packages/agdbnet/trunk/debian/po/templates.pot trunk/packages/agdbnet/trunk/debian/postinst trunk/packages/agdbnet/trunk/debian/postrm trunk/packages/agdbnet/trunk/debian/templates Log: Add debconf configuration for curator Modified: trunk/packages/agdbnet/trunk/debian/README.Debian =================================================================== --- trunk/packages/agdbnet/trunk/debian/README.Debian 2008-09-24 12:43:32 UTC (rev 2530) +++ trunk/packages/agdbnet/trunk/debian/README.Debian 2008-09-24 13:14:12 UTC (rev 2531) @@ -4,13 +4,12 @@ Creating the database for AgdbNet --------------------------------- -In the installation process some debconf questions have to -be answered to prepare a reasonable XML config file in -/etc/agdbnet/<database name>.xml. This config file has -to reviewed before a database is finally created. Before -you inspect the config file it is strongly advised to read -the introduction "Creating a XML description of an agdbnet -database" on the AgdbNet homepage at +In the installation process some debconf questions have to be answered +to prepare a reasonable XML config file in /etc/agdbnet/<database +name>.xml. This config file has to reviewed before a database is +finally created. Before you inspect the config file it is strongly +advised to read the introduction "Creating a XML description of an +agdbnet database" on the AgdbNet homepage at http://pubmlst.org/software/database/agdbnet/xml.shtml @@ -18,26 +17,56 @@ http://pubmlst.org/software/database/agdbnet/attributes.shtml -to understand the meaning of the fields you have to configure. -You should also have a look at the examples directory which -contains some example configuration files provided by the -agdbnet authors. +to understand the meaning of the fields you have to configure. You +should also have a look at the examples directory which contains some +example configuration files provided by the agdbnet authors. +To simplify the creation of the database you can find a script named +agdbnet_xml2sql in this directory. This script might serve as an +example how to intialise the agdbnet database which means - it was not +yet thoroughly tested but it implements the hints of the installation +manual and works for the maintainer of this package. Any hints for +enhancing this script are welcome. In case you do not want to use +this script you have to do the following steps: + /usr/share/agdbnet/xml2sql.pl -u '"www-data"' \ + /etc/agdbnet/[your_database].xml > init.sql + createdb [your_database] + psql [your_database] < init.sql + +Finally you have to insert the data of the curator + + psql [your_database] -c \ + "INSERT INTO users VALUES (1, 'username', 'surname', 'firstname', 'email', '', '', now(), '') ;" + +These steps including some sanity checks are done by the +agdbnet_xml2sql script and thus the manual initialisation could be +simplified by just calling + + . agdbnet_xml2sql + +To populate the database with the data of the curator user the file +/etc/agdbnet/agcurator.conf is read. Once the database is initialised +there is not much use for this file any more but you might keep it for +later reference. + +In case this might fail just use the reportbug tool to report the +problem that might have occured. + + PubMed references ----------------- According to item 6. of the original installation manual (see -installation.html) the configuration file has to be adjusted to -enable obtaining PubMed references. You can find the original -getrefs.conf example file in the examples directory. The data -in this example file correspond to the configuration file example -poravr.xml. Please adapt this to your own needs and finally copy -a working getrefs.conf file into the directory /etc/agdbnet. -Once you have done this the cron job in /etc/cron.daily/agdbnet -will fetch the references once a day. It is strongly advised -to call /etc/cron.daily/agdbnet manually for testing proper -operation. +installation.html) the configuration file has to be adjusted to enable +obtaining PubMed references. You can find the original getrefs.conf +example file in the examples directory. The data in this example file +correspond to the configuration file example poravr.xml. Please adapt +this to your own needs and finally copy a working getrefs.conf file +into the directory /etc/agdbnet. Once you have done this the cron job +in /etc/cron.daily/agdbnet will fetch the references once a day. It +is strongly advised to call /etc/cron.daily/agdbnet manually for +testing proper operation. - -- Andreas Tille <[EMAIL PROTECTED]> Fri, 05 Sep 2008 11:07:50 +0200 + -- Andreas Tille <[EMAIL PROTECTED]>, Wed, 24 Sep 2008 14:23:04 +0200 Modified: trunk/packages/agdbnet/trunk/debian/config =================================================================== --- trunk/packages/agdbnet/trunk/debian/config 2008-09-24 12:43:32 UTC (rev 2530) +++ trunk/packages/agdbnet/trunk/debian/config 2008-09-24 13:14:12 UTC (rev 2531) @@ -9,7 +9,6 @@ . /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/agdbnet/${xmlname} @@ -76,6 +75,39 @@ 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 Added: trunk/packages/agdbnet/trunk/debian/doc =================================================================== --- trunk/packages/agdbnet/trunk/debian/doc (rev 0) +++ trunk/packages/agdbnet/trunk/debian/doc 2008-09-24 13:14:12 UTC (rev 2531) @@ -0,0 +1,2 @@ +agdbnet_xml2sql + Modified: trunk/packages/agdbnet/trunk/debian/po/templates.pot =================================================================== --- trunk/packages/agdbnet/trunk/debian/po/templates.pot 2008-09-24 12:43:32 UTC (rev 2530) +++ trunk/packages/agdbnet/trunk/debian/po/templates.pot 2008-09-24 13:14:12 UTC (rev 2531) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: [EMAIL PROTECTED]" -"POT-Creation-Date: 2008-09-19 14:10+0200\n" +"POT-Creation-Date: 2008-09-24 14:39+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <[EMAIL PROTECTED]>\n" "Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n" @@ -175,3 +175,121 @@ "agdbnet/attributes.shtml . The value here corresponds to the man attribute " "of the \"<locus>\" element." msgstr "" + +#. Type: note +#. Description +#: ../templates:6001 +msgid "Hint about configuration of the PubMed reference database" +msgstr "" + +#. Type: note +#. Description +#: ../templates:6001 +msgid "" +"You are now finished with the AgdbNet configuration. Please read more about " +"AgdbNet configuration at\n" +" http://pubmlst.org/software/database/agdbnet/xml.shtml and\n" +" http://pubmlst.org/software/database/agdbnet/attributes.shtml\n" +"and review the XML file in /etc/agdbnet 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/agdbnet/README.Debian to " +"finish the installation process." +msgstr "" + +#. Type: note +#. Description +#: ../templates:6001 +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:6001 +msgid "" +"To enable daily updates of PubMed references you have to create\n" +" /etc/agdbnet/getrefs.conf\n" +"according to the template in examples. It is strongly recommended to read\n" +" /usr/share/doc/agdbnet/README.Debian\n" +"how to create this file." +msgstr "" + +#. Type: string +#. Description +#: ../templates:7001 +msgid "Username of database curator:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:7001 +msgid "" +"Curators of agdbnat are people who are allowed to insert new strains into " +"the database which can be used to compare with user provided strains in " +"agdbnet. 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:7001 +msgid "" +"Attention: The method currently used for authentication is insecure. Please " +"read /usr/share/doc/agdbnet/README.Debian how to change this to a secure " +"method." +msgstr "" + +#. Type: string +#. Description +#: ../templates:7001 +msgid "" +"Please input the login username for one curator now. Others can be added " +"later." +msgstr "" + +#. Type: string +#. Description +#: ../templates:8001 +msgid "Surname of database curator:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:8001 +msgid "" +"Please input the surname of the person which should work as a curator for " +"agdbnet." +msgstr "" + +#. Type: string +#. Description +#: ../templates:9001 +msgid "First name of database curator:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:9001 +msgid "" +"Please input the first name of the person which should work as a curator for " +"agdbnet." +msgstr "" + +#. Type: string +#. Description +#: ../templates:10001 +msgid "E-mail address of database curator:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:10001 +msgid "" +"Please input the e-mail address of the person which should work as a curator " +"for agdbnet. 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 "" Modified: trunk/packages/agdbnet/trunk/debian/postinst =================================================================== --- trunk/packages/agdbnet/trunk/debian/postinst 2008-09-24 12:43:32 UTC (rev 2530) +++ trunk/packages/agdbnet/trunk/debian/postinst 2008-09-24 13:14:12 UTC (rev 2531) @@ -30,6 +30,7 @@ db_get ${pkg}/locus LOCUS=${RET} + # Substitute the value ##variables## in the templates and move them # right into place XMLOUT=/etc/${pkg}/"$XMLNAME".xml @@ -80,6 +81,37 @@ ln -s "$STYLEDIR" "/var/www/${pkg}/$XMLNAME" 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 agdbnet 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}/tmp" SQLDIR="/var/lib/${pkg}" Modified: trunk/packages/agdbnet/trunk/debian/postrm =================================================================== --- trunk/packages/agdbnet/trunk/debian/postrm 2008-09-24 12:43:32 UTC (rev 2530) +++ trunk/packages/agdbnet/trunk/debian/postrm 2008-09-24 13:14:12 UTC (rev 2531) @@ -43,8 +43,11 @@ 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) ;; Modified: trunk/packages/agdbnet/trunk/debian/templates =================================================================== --- trunk/packages/agdbnet/trunk/debian/templates 2008-09-24 12:43:32 UTC (rev 2530) +++ trunk/packages/agdbnet/trunk/debian/templates 2008-09-24 13:14:12 UTC (rev 2531) @@ -81,7 +81,7 @@ Template: agdbnet/note Type: note -Description: Hint about configuration of the PubMed reference database +_Description: Hint about configuration of the PubMed reference database You are now finished with the AgdbNet configuration. Please read more about AgdbNet configuration at http://pubmlst.org/software/database/agdbnet/xml.shtml and @@ -99,3 +99,40 @@ according to the template in examples. It is strongly recommended to read /usr/share/doc/agdbnet/README.Debian how to create this file. + +Template: agdbnet/curator/username +Type: string +_Description: Username of database curator: + Curators of agdbnat are people who are allowed to insert new strains + into the database which can be used to compare with user provided strains + in agdbnet. 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/agdbnet/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: agdbnet/curator/surname +Type: string +_Description: Surname of database curator: + Please input the surname of the person which should work as a curator + for agdbnet. + +Template: agdbnet/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 agdbnet. + +Template: agdbnet/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 agdbnet. 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
