Andreas Tille pushed to branch master at Debian Med / prokka

Commits:
259437d3 by Andreas Tille at 2019-01-28T15:12:27Z
Move database to var to enable users recreation of the database

- - - - -
a97fba2f by Andreas Tille at 2019-01-28T15:12:50Z
Symlinks to data files on /var/lib to /usr/share

- - - - -
5867f570 by Andreas Tille at 2019-01-28T15:16:23Z
Cleanup on purge

- - - - -
fa66f09b by Andreas Tille at 2019-01-28T15:32:58Z
Make db dir user writable

- - - - -
1b3ad84c by Andreas Tille at 2019-01-28T17:22:31Z
Fix permissions

- - - - -


6 changed files:

- − debian/README.Debian
- debian/changelog
- debian/patches/set-db-dir
- debian/prokka.postinstall → debian/prokka.postinst
- + debian/prokka.postrm
- debian/rules


Changes:

=====================================
debian/README.Debian deleted
=====================================
@@ -1,20 +0,0 @@
-Prokka's databases are installed to /usr/share/prokka
-
-HAMAP.hmm is 224M, took 21 hours and 10 minutes, 15M of memory, single 
threaded?
-
-Shipped HAMAP.hmm is 88M ??
-
-
-After installing the package you need to run
-
-    prokka --setupdb
-
-as root.  This is creates files
-
-    /usr/share/prokka/db/kingdom/Archaea/sprot.{phr,pin,psq}
-
-which is not policy compliant.  It would be better to move the db to
-
-    /var/lib/prokka/db
-
-instead.


=====================================
debian/changelog
=====================================
@@ -2,6 +2,5 @@ prokka (1.13.4+dfsg-1) UNRELEASED; urgency=low
 
   [ Michael R. Crusoe ]
   * Initial release (Closes: #778246)
-  TODO: See README.Debian about user generated files in /usr
 
  -- Andreas Tille <[email protected]>  Mon, 28 Jan 2019 13:26:30 +0100


=====================================
debian/patches/set-db-dir
=====================================
@@ -13,7 +13,7 @@ Last-Update: 2015-02-21
  
  # where to put formatted database: /path/to/prokka/db/
 -ROOTDIR=$(dirname $0)
-+ROOTDIR=/usr/share/prokka/db
++ROOTDIR=/var/lib/prokka/db
  
  echo "*** NOTICE ***"
  echo "This script is about to download data from the Internet and overwrite 
your existing Prokka BLAST databases."
@@ -33,7 +33,7 @@ Last-Update: 2015-02-21
             $metagenome, $compliant, $listdb, $citation);
  
 -$dbdir = $ENV{'PROKKA_DBDIR'} || abs_path("$FindBin::RealBin/../db");
-+$dbdir = "/usr/share/prokka/db";
++$dbdir = "/var/lib/prokka/db";
  
  setOptions();
  


=====================================
debian/prokka.postinstall → debian/prokka.postinst
=====================================
@@ -17,6 +17,7 @@ set -e
 # for details, see http://www.debian.org/doc/debian-policy/ or
 # the debian-policy package
 
+#PROKKADBPATH=/var/lib/prokka/db
 
 case "$1" in
     configure)


=====================================
debian/prokka.postrm
=====================================
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e 
+
+PROKKADBPATH=/var/lib/prokka/db
+
+
+if [ "$1" = "purge" ] ; then
+   
+   if [ -d $PROKKADBPATH ]; then
+      rm -rf $(dirname $PROKKADBPATH)
+   fi
+fi
+
+#DEBHELPER#    
+


=====================================
debian/rules
=====================================
@@ -2,6 +2,10 @@
 
 DH_VERBOSE := 1
 
+include /usr/share/dpkg/default.mk
+
+PROKKADBPATH=/var/lib/prokka/db
+
 %:
        dh $@
 
@@ -10,3 +14,17 @@ override_dh_install:
        for pl in `grep -Rl '#!/usr/bin/env[[:space:]]\+perl' debian/*/usr/*` ; 
do \
            sed -i '1s?^#!/usr/bin/env[[:space:]]\+perl?#!/usr/bin/perl?' 
$${pl} ; \
        done
+
+override_dh_link:
+       for db in `find debian/$(DEB_SOURCE)/usr/share/prokka/db -type f` ; do \
+           vardir=`echo $${db} | sed -e 's?.*/usr/share?/var/lib?'` ; \
+           mkdir -p debian/$(DEB_SOURCE)/`dirname $${vardir}` ; \
+           usrdir=`echo $${db} | sed -e 's?.*/usr?/usr?'` ; \
+           dh_link $${usrdir} $${vardir} ; \
+       done
+
+override_dh_fixperms:
+       dh_fixperms
+       for db in `find debian/$(DEB_SOURCE)/$(PROKKADBPATH) -type d` ; do \
+           chmod a+w $${db} ; \
+       done



View it on GitLab: 
https://salsa.debian.org/med-team/prokka/compare/a04766af36e117512eff77c0bfd604d84acbe0c8...1b3ad84c682b9b2af283613be8a1c9d1fb1f7b32

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/prokka/compare/a04766af36e117512eff77c0bfd604d84acbe0c8...1b3ad84c682b9b2af283613be8a1c9d1fb1f7b32
You're receiving this email because of your account on salsa.debian.org.
_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to