[med-svn] [qcumber] 03/05: Care for minikrakendb installation via debconf

Andreas Tille tille at debian.org
Tue Nov 29 09:34:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository qcumber.

commit 682d9bbd167c3f3eef9659d2f476b13fcb7dcbbe
Author: Andreas Tille <tille at debian.org>
Date:   Mon Nov 28 17:44:32 2016 +0100

    Care for minikrakendb installation via debconf
---
 debian/config           | 21 +++++++++++++++++++++
 debian/po/POTFILES.in   |  1 +
 debian/po/de.po         | 43 +++++++++++++++++++++++++++++++++++++++++++
 debian/po/templates.pot | 37 +++++++++++++++++++++++++++++++++++++
 debian/postinst         | 36 ++++++++++++++++++++++++++++++++++++
 debian/templates        | 11 +++++++++++
 6 files changed, 149 insertions(+)

diff --git a/debian/config b/debian/config
new file mode 100644
index 0000000..9043fb4
--- /dev/null
+++ b/debian/config
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+conffile=/etc/qcumber/config.txt
+DEFAULTKRAKENDB="/var/lib/kraken/minikraken_20141208"
+CHECKKRAKENDBFILE="database.idx"
+
+. /usr/share/debconf/confmodule
+
+if [ -f $conffile ] ; then
+    krakendb=`sed '/\[PATH\]/,$d' $conffile | grep "^kraken_db" | head -n 1 | sed 's/^kraken_db *= *\([^ ]\+\) *$/\1/'`
+    db_set qcumber/krakendb ${krakendb}
+fi
+
+if [ ! -e "${krakendb}/${CHECKKRAKENDBFILE}" ] ; then
+    # if Minikrakendb installation does not seem to be done further action needed
+    db_input high qcumber/krakendb || [ $? -eq 30 ]
+fi
+
+db_go || true
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644
index 0000000..cef83a3
--- /dev/null
+++ b/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates
diff --git a/debian/po/de.po b/debian/po/de.po
new file mode 100644
index 0000000..a492884
--- /dev/null
+++ b/debian/po/de.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the qcumber package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: qcumber\n"
+"Report-Msgid-Bugs-To: qcumber at packages.debian.org\n"
+"POT-Creation-Date: 2016-11-28 17:15+0100\n"
+"PO-Revision-Date: 2016-11-28 17:02+0100\n"
+"Last-Translator: Andreas Tille <tille at debian.org\n"
+"Language-Team: Debian German <debian-l10n-german at lists.debian.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Installation directory of the minikraken database"
+msgstr "Installationsverzeichnis der minikraken Datenbank"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid ""
+"QCumber is using kraken which needs a database.  To simplyfy the process of "
+"creating the database which requires a lot of computing power there is the "
+"option to download this database (see https://ccb.jhu.edu/software/"
+"kraken/).  If you want to run QCumber the directory of the kraken database "
+"needs to be known to the program.  In which directory is the database "
+"installed or should the database installed by the script /usr/share/doc/"
+"qcumber/get-minikrakendb?"
+msgstr ""
+"QCumber benutzt kraken, das eine Datenbank benötigt.  Um den Prozess des "
+"Erzeugens der Datenbank, der eine erhebliche Rechenleistung benötigt, zu "
+"vereinfachen, besteht die Möglichkeit diese Datenbank herunterzuladen (siehe "
+"https://ccb.jhu.edu/software/kraken/ .)  Um QCumber zu benutzen, muß das "
+"Verzeichnis der minikraken Datenbank bekannt sein.  In welchem Verzeichnis "
+"ist die Datenbank installiert oder soll die Datenbank mit Hilfe des Scripts "
+"/usr/share/doc/qcumber/get-minikrakendb installiert werden?"
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644
index 0000000..6bd674d
--- /dev/null
+++ b/debian/po/templates.pot
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the qcumber package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: qcumber\n"
+"Report-Msgid-Bugs-To: qcumber at packages.debian.org\n"
+"POT-Creation-Date: 2016-11-28 17:15+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <LL at li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid "Installation directory of the minikraken database"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:1001
+msgid ""
+"QCumber is using kraken which needs a database.  To simplyfy the process of "
+"creating the database which requires a lot of computing power there is the "
+"option to download this database (see https://ccb.jhu.edu/software/"
+"kraken/).  If you want to run QCumber the directory of the kraken database "
+"needs to be known to the program.  In which directory is the database "
+"installed or should the database installed by the script /usr/share/doc/"
+"qcumber/get-minikrakendb?"
+msgstr ""
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..4aa48e7
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+conffile=/etc/qcumber/config.txt
+CHECKKRAKENDBFILE="database.idx"
+
+. /usr/share/debconf/confmodule
+
+db_get qcumber/krakendb || true
+
+DEFAULTKRAKENDB=$RET
+
+if [ "$DEFAULTKRAKENDB" = "" ] ; then
+    DEFAULTKRAKENDB=`sed '/\[PATH\]/,$d' $conffile | grep "^kraken_db" | head -n 1 | sed 's/^kraken_db *= *\([^ ]\+\) *$/\1/'`
+else
+    # check whether configfile has the same dir as the user has input in config step
+    if ! grep -q "^kraken_db *= *$DEFAULTKRAKENDB *$" $conffile ; then
+        sed -i "s/^\(kraken_db *=\) *.*$/\1 $DEFAULTKRAKENDB" $conffile
+    fi
+fi
+
+if [ "$1" = configure ] ; then
+    # Make sure minikraken DB exists
+    if [ ! -e "$DEFAULTKRAKENDB/$CHECKKRAKENDBFILE" ] ; then
+cat <<EOT
+*************************************************************************
+* Minikraken DB is missing.  Either move the according files to         *
+*     $DEFAULTKRAKENDB
+* or call the script /usr/share/doc/qcumber/get-minikrakendb as root.   *
+*************************************************************************
+EOT
+    fi
+fi
+
+#DEBHELPER#
diff --git a/debian/templates b/debian/templates
new file mode 100644
index 0000000..f160f88
--- /dev/null
+++ b/debian/templates
@@ -0,0 +1,11 @@
+Template: qcumber/krakendb
+Type: string
+Default: /var/lib/kraken/minikraken_20141208
+_Description: Installation directory of the minikraken database
+ QCumber is using kraken which needs a database.  To simplyfy the process
+ of creating the database which requires a lot of computing power there is
+ the option to download this database (see
+ https://ccb.jhu.edu/software/kraken/).  If you want to run QCumber the
+ directory of the kraken database needs to be known to the program.  In which
+ directory is the database installed or should the database installed by the
+ script /usr/share/doc/qcumber/get-minikrakendb?

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/qcumber.git



More information about the debian-med-commit mailing list