[med-svn] [card-rgi] 02/02: Initial packaging
Andreas Tille
tille at debian.org
Thu May 11 07:31:11 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository card-rgi.
commit 31999ed51d9ed55c689f638dd609492ae4b28003
Author: Andreas Tille <tille at debian.org>
Date: Thu May 11 09:30:12 2017 +0200
Initial packaging
---
debian/bin/rgi | 21 ++++++
debian/changelog | 5 ++
debian/clean | 2 +
debian/compat | 1 +
debian/control | 31 +++++++++
debian/copyright | 12 ++++
debian/examples | 1 +
debian/install | 3 +
debian/links | 5 ++
debian/patches/add_python_interpreter.patch | 39 +++++++++++
debian/patches/database_dir_to_var_lib.patch | 94 ++++++++++++++++++++++++++
debian/patches/do_not_cleanup_system_dir.patch | 12 ++++
debian/patches/series | 3 +
debian/postinst | 26 +++++++
debian/postrm | 24 +++++++
debian/rules | 12 ++++
debian/source/format | 1 +
debian/upstream/metadata | 50 ++++++++++++++
debian/watch | 3 +
19 files changed, 345 insertions(+)
diff --git a/debian/bin/rgi b/debian/bin/rgi
new file mode 100644
index 0000000..27c4c55
--- /dev/null
+++ b/debian/bin/rgi
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+exe=`basename $0`
+export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}/usr/share/card-rgi/"
+
+case "$exe" in
+ ("rgi")
+ python /usr/share/card-rgi/rgi.py $@
+ ;;
+ ("rgi_clean"|"rgi_load"|"rgi_convertJsonToTSV")
+ pyfile=`echo $exe | sed 's/^rgi_//'`
+ python /usr/share/card-rgi/${pyfile}.py $@
+ ;;
+ ("rgi_jsonformat")
+ python /usr/share/card-rgi/formatJson.py $@
+ ;;
+ (*)
+ echo "rgi: unknown executable $exe"
+ exit -1
+ ;;
+esac
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..5196135
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+card-rgi (3.2.0-1) UNRELEASED; urgency=medium
+
+ * Initial packaging (Closes: #???)
+
+ -- Andreas Tille <tille at debian.org> Wed, 10 May 2017 14:08:29 +0200
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..3b43f3f
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,2 @@
+protein.fasta*
+_db/protein*
\ No newline at end of file
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..4b3dc0e
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,31 @@
+Source: card-rgi
+Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
+Uploaders: Andreas Tille <tille at debian.org>
+Section: science
+Priority: optional
+Build-Depends: debhelper (>= 10),
+ dh-python,
+ python-all-dev
+Standards-Version: 3.9.8
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/card-rgi.git
+Vcs-Git: https://anonscm.debian.org/git/debian-med/card-rgi.git
+Homepage: https://card.mcmaster.ca/
+
+Package: card-rgi
+Architecture: all
+Depends: ${python:Depends},
+ ${misc:Depends},
+ prodigal,
+ ncbi-blast+,
+ python-biopython
+Description: analysis of genome sequences using the Resistance Gene Identifier
+ The Comprehensive Antibiotic Resistance Database ("CARD") provides data,
+ models, and algorithms relating to the molecular basis of antimicrobial
+ resistance. The CARD provides curated reference sequences and SNPs
+ organized via the Antibiotic Resistance Ontology ("ARO"). These data can
+ be browsed on the website or downloaded in a number of formats. These
+ data are additionally associated with detection models, in the form of
+ curated homology cut-offs and SNP maps, for prediction of resistome from
+ molecular sequences. These models can be downloaded or can be used for
+ analysis of genome sequences using the Resistance Gene Identifier
+ ("RGI"), either online or as a stand-alone tool.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..68cf081
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,12 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: CARD
+Source: https://card.mcmaster.ca/download
+
+Files: *
+Copyright: 2012-2017 <upstream>
+License: non-free
+ -> https://card.mcmaster.ca/about
+
+Files: debian/*
+Copyright: 2017 Andreas Tille <tille at debian.org>
+License: <license>
diff --git a/debian/examples b/debian/examples
new file mode 100644
index 0000000..e7e1fb0
--- /dev/null
+++ b/debian/examples
@@ -0,0 +1 @@
+tests/*
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..4ffa2a0
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,3 @@
+*.py usr/share/card-rgi
+_data/*.json usr/share/card-rgi/_data
+debian/bin usr
\ No newline at end of file
diff --git a/debian/links b/debian/links
new file mode 100644
index 0000000..a7379d6
--- /dev/null
+++ b/debian/links
@@ -0,0 +1,5 @@
+usr/bin/rgi usr/bin/rgi_clean
+usr/bin/rgi usr/bin/rgi_convertJsonToTSV
+usr/bin/rgi usr/bin/rgi_load
+usr/bin/rgi usr/bin/rgi_jsonformat
+usr/share/card-rgi/_data/card.json var/lib/card-rgi/_data/card.json
diff --git a/debian/patches/add_python_interpreter.patch b/debian/patches/add_python_interpreter.patch
new file mode 100644
index 0000000..04f09f3
--- /dev/null
+++ b/debian/patches/add_python_interpreter.patch
@@ -0,0 +1,39 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Wed, 10 May 2017 14:08:29 +0200
+Description: Add missing Python interpreter line
+
+--- a/rgi.py
++++ b/rgi.py
+@@ -1,3 +1,4 @@
++#!/usr/bin/python
+ import json
+ import sys
+ import os
+--- a/clean.py
++++ b/clean.py
+@@ -1,3 +1,4 @@
++#!/usr/bin/python
+ import os
+ import sys
+ import filepaths
+--- a/convertJsonToTSV.py
++++ b/convertJsonToTSV.py
+@@ -1,3 +1,4 @@
++#!/usr/bin/python
+ import json
+ import csv
+ import sys
+--- a/formatJson.py
++++ b/formatJson.py
+@@ -1,3 +1,4 @@
++#!/usr/bin/python
+ import os
+ import sys
+ import filepaths
+--- a/load.py
++++ b/load.py
+@@ -1,3 +1,4 @@
++#!/usr/bin/python
+ import os, sys
+ import shutil
+ import filepaths
diff --git a/debian/patches/database_dir_to_var_lib.patch b/debian/patches/database_dir_to_var_lib.patch
new file mode 100644
index 0000000..83443d9
--- /dev/null
+++ b/debian/patches/database_dir_to_var_lib.patch
@@ -0,0 +1,94 @@
+--- a/clean.py
++++ b/clean.py
+@@ -6,7 +6,7 @@ import argparse
+
+ script_path = filepaths.determine_path()
+ working_directory = os.getcwd()
+-path = script_path+"/"
++path = "/var/lib/card-rgi/"
+
+ app_files = [".gitignore","_docs","_tmp","_db","mgm"]
+
+--- a/contigToORF.py
++++ b/contigToORF.py
+@@ -8,7 +8,7 @@ import datetime
+ script_path = filepaths.determine_path()
+ working_directory = os.getcwd()
+
+-path = script_path
++path = "/var/lib/card-rgi/"
+
+ def catProteins(filename,afile):
+
+--- a/contigToProteins.py
++++ b/contigToProteins.py
+@@ -5,7 +5,7 @@ import filepaths
+ script_path = filepaths.determine_path()
+ working_directory = os.getcwd()
+
+-path = script_path
++path = "/var/lib/card-rgi/"
+
+ def catProteins(filename,afile):
+
+--- a/convertJsonToTSV.py
++++ b/convertJsonToTSV.py
+@@ -11,7 +11,7 @@ import filepaths
+
+ script_path = filepaths.determine_path()
+ working_directory = os.getcwd()
+-path = script_path+"/"
++path = "/var/lib/card-rgi/"
+
+ def check_delimiter(fastaHeader):
+ # Colon
+--- a/fqToFsa.py
++++ b/fqToFsa.py
+@@ -6,7 +6,7 @@ from Bio import SeqIO
+ script_path = filepaths.determine_path()
+ working_directory = os.getcwd()
+
+-path = script_path
++path = "/var/lib/card-rgi/"
+
+ def convertFqToFsa(fq_path,fa_path):
+ SeqIO.convert(fq_path, "fastq", fa_path, "fasta")
+--- a/rgi.py
++++ b/rgi.py
+@@ -27,9 +27,10 @@ working_directory = os.getcwd()
+
+ clean_files = []
+
+-path = script_path+"/_db/"
+-data_path = script_path+"/_data/"
+-tmp = script_path+"/_tmp/"
++var_path = "/var/lib/card-rgi"
++path = var_path+"/_db/"
++data_path = var_path+"/_data/"
++tmp = var_path+"/_tmp/"
+
+ #remove temporary file
+ def removeTemp():
+--- a/rrna.py
++++ b/rrna.py
+@@ -23,9 +23,10 @@ Step 3: blast and report for mutations i
+ script_path = filepaths.determine_path()
+ working_directory = os.getcwd()
+
+-path = script_path+"/_db/"
+-data_path = script_path+"/_data/"
+-tmp = script_path+"/_tmp/"
++var_path = "/var/lib/card-rgi"
++path = var_path+"/_db/"
++data_path = var_path+"/_data/"
++tmp = var_path+"/_tmp/"
+
+ def rRNA(fq_path,start,stop,strand):
+ try:
+@@ -156,4 +157,4 @@ def main(argvfile):
+ #runBlast(argvfile,8)
+
+ if __name__ == "__main__":
+- main(sys.argv[1])
+\ No newline at end of file
++ main(sys.argv[1])
diff --git a/debian/patches/do_not_cleanup_system_dir.patch b/debian/patches/do_not_cleanup_system_dir.patch
new file mode 100644
index 0000000..7b3c452
--- /dev/null
+++ b/debian/patches/do_not_cleanup_system_dir.patch
@@ -0,0 +1,12 @@
+--- a/clean.py
++++ b/clean.py
+@@ -15,9 +15,6 @@ def _clean():
+ import glob
+ files = glob.glob(path+"*")
+ for f in files:
+- if os.path.isfile(f) and os.path.splitext(os.path.basename(f))[1][1:].strip() in ["adraft","xml","fsa","draft","pyc","log"]:
+- os.remove(f)
+-
+ if os.path.isdir(f) == False:
+ if os.path.isfile(f) == True and os.path.splitext(os.path.basename(f))[1][1:].strip() in ["py"]:
+ pass
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2b241d2
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+add_python_interpreter.patch
+database_dir_to_var_lib.patch
+do_not_cleanup_system_dir.patch
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..6026750
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -e
+
+VARDIR=/var/lib/card-rgi
+DBDIR=${VARDIR}/_db
+
+case "$1" in
+ configure)
+ mkdir -p $DBDIR
+ chmod 1777 $DBDIR
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/postrm b/debian/postrm
new file mode 100644
index 0000000..ebe9f4d
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+VARDIR=/var/lib/card-rgi
+DBDIR=${VARDIR}/_db
+
+case "$1" in
+ purge)
+ rm -rf $DBDIR
+ ;;
+ remove|upgrade|deconfigure|failed-upgrade)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..46c23f3
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+
+# DH_VERBOSE := 1
+
+DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
+
+%:
+ dh $@ --with python2
+
+override_dh_fixperms:
+ dh_fixperms
+ chmod -x debian/$(DEBPKGNAME)/usr/share/$(DEBPKGNAME)
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
new file mode 100644
index 0000000..8c57bcc
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1,50 @@
+Reference:
+ - Author: >
+ Baofeng Jia and Amogelang R. Raphenya and Brian Alcock and
+ Nicholas Waglechner and Peiyao Guo and Kara K. Tsang and
+ Briony A. Lago and Biren M. Dave and Sheldon Pereira and
+ Arjun N. Sharma and Sachin Doshi and Mélanie Courtot and
+ Raymond Lo and Laura E. Williams and Jonathan G. Frye and
+ Tariq Elsayegh and Daim Sardar and Erin L. Westman and
+ Andrew C. Pawlowski and Timothy A. Johnson and
+ Fiona S.L. Brinkman and Gerard D. Wright and Andrew G. McArthur
+ Title: "CARD 2017: expansion and model-centric curation of the comprehensive antibiotic resistance database"
+ Journal: Nucleic Acids Research
+ Year: 2017
+ Volume: 45
+ Number: D1
+ Pages: D566-D573
+ DOI: 10.1093/nar/gkw1004
+ PMID: 27789705
+ URL: https://academic.oup.com/nar/article-lookup/doi/10.1093/nar/gkw1004#
+ eprint: https://academic.oup.com/nar/article-pdf/45/D1/D566/8846551/gkw1004.pdf
+ - Author: Andrew G McArthur and Gerard D Wright
+ Title: Bioinformatics of antimicrobial resistance in the age of molecular epidemiology
+ Journal: Current Opinion in Microbiology
+ Year: 2015
+ Volume: 27
+ Pages: 45–50
+ DOI: 10.1016/j.mib.2015.07.004
+ PMID: 26241506
+ URL: http://www.sciencedirect.com/science/article/pii/S1369527415000958
+ - Author: >
+ Andrew G. McArthurb and Nicholas Waglechnera and Fazmin Nizama and
+ Austin Yana and Marisa A. Azada and Alison J. Baylayc and
+ Kirandeep Bhullara and Marc J. Canovaa and Gianfranco De Pascalea and
+ Linda Ejima and Lindsay Kalana and Andrew M. Kinga and
+ Kalinka Kotevaa and Mariya Morara and Michael R. Mulveyd and
+ Jonathan S. O'Briena and Andrew C. Pawlowskia and
+ Laura J. V. Piddockc and Peter Spanogiannopoulosa and
+ Arlene D. Sutherlanda and Irene Tanga and Patricia L. Taylora and
+ Maulik Thakera and Wenliang Wanga and Marie Yana and Tennison Yua and
+ Gerard D. Wright
+ Title: The comprehensive antibiotic resistance database
+ Journal: Antimicrobial Agents and Chemotherapy
+ Year: 2013
+ Volume: 57
+ Number: 7
+ Pages: 3348-57
+ DOI: 10.1128/AAC.00419-13
+ PMID: 23650175
+ URL: http://aac.asm.org/content/57/7/3348
+ eprint: http://aac.asm.org/content/57/7/3348.full.pdf+html
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..6f7ed7f
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=4
+
+https://card.mcmaster.ca/download .*/software-v(\d[.\d]+)\.tar\.gz
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/card-rgi.git
More information about the debian-med-commit
mailing list