[med-svn] [Git][med-team/sepp][master] 7 commits: Adding dependency to ncbi-blast+

Pierre Gruet gitlab at salsa.debian.org
Sat Sep 26 10:09:51 BST 2020



Pierre Gruet pushed to branch master at Debian Med / sepp


Commits:
c4a6f4b7 by Pierre Gruet at 2020-09-26T10:41:30+02:00
Adding dependency to ncbi-blast+

- - - - -
56030d08 by Pierre Gruet at 2020-09-26T10:41:48+02:00
Adding Rules-Requires-Root: no

- - - - -
edf70426 by Pierre Gruet at 2020-09-26T10:47:55+02:00
Using Debian paths for executables

- - - - -
fb458d48 by Pierre Gruet at 2020-09-26T10:49:12+02:00
Fixing syntax error in lintian-overrides file

- - - - -
46b0614b by Pierre Gruet at 2020-09-26T10:53:29+02:00
Handling the build of the two other jars

- - - - -
471e9300 by Pierre Gruet at 2020-09-26T10:58:08+02:00
Making conffiles placed into /etc

- - - - -
48f6e95b by Pierre Gruet at 2020-09-26T11:09:29+02:00
Hacking for making build tests, errors still to be fixed

- - - - -


10 changed files:

- debian/changelog
- debian/control
- + debian/install
- debian/patches/change_java_version_for_ant.patch
- + debian/patches/java_build.patch
- debian/patches/series
- debian/patches/use_debian_packaged_guppy_from_pplacer.patch
- + debian/patches/use_etc_configuration_files.patch
- debian/rules
- debian/sepp.lintian-overrides


Changes:

=====================================
debian/changelog
=====================================
@@ -3,7 +3,8 @@ sepp (4.3.10+dfsg-1) UNRELEASED; urgency=medium
   * Initial release (Closes: #<bug>)
   TODO:
   - See if split_sequences.py should be shipped.
-  - Call build-time tests in debian/rules.
+  - Debug build-time.
   - Write manpages.
+  - Write autopkgtests.
 
- -- Pierre Gruet <pgtdebian at free.fr>  Wed, 19 Aug 2020 11:02:08 +0200
+ -- Pierre Gruet <pgtdebian at free.fr>  Sat, 26 Sep 2020 11:05:33 +0200


=====================================
debian/control
=====================================
@@ -1,21 +1,25 @@
 Source: sepp
 Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>
+Uploaders: Andreas Tille <tille at debian.org>,
+           Pierre Gruet <pgtdebian at free.fr>
 Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                dh-python,
                python3,
                python3-setuptools,
+               python3-dendropy,
                pplacer,
                hmmer,
                ant,
                libjenkins-json-java,
-               libgoogle-gson-java
+               libgoogle-gson-java,
+               ncbi-blast+
 Standards-Version: 4.5.0
 Vcs-Browser: https://salsa.debian.org/med-team/sepp
 Vcs-Git: https://salsa.debian.org/med-team/sepp.git
 Homepage: https://github.com/smirarab/sepp/
+Rules-Requires-Root: no
 
 Package: sepp
 Architecture: any
@@ -30,7 +34,8 @@ Depends: ${shlibs:Depends},
          libcommons-beanutils-java,
          libcommons-collections3-java,
          libcommons-lang-java,
-         libcommons-logging-java
+         libcommons-logging-java,
+         ncbi-blast+
 Description: methods use ensembles of Hidden Markov Models (HMM)
  The tools SEPP, TIPP, UPP and HIPPI implementing three methods use
  ensembles of Hidden Markov Models (HMMs) in different ways, each


=====================================
debian/install
=====================================
@@ -0,0 +1,4 @@
+main.config etc/sepp
+tipp.config etc/sepp
+upp.config etc/sepp
+tools/merge/*JsonMerger.jar usr/share/sepp/


=====================================
debian/patches/change_java_version_for_ant.patch
=====================================
@@ -1,5 +1,5 @@
 From: Pierre Gruet <pgtdebian at free.fr>
-Date: Fri, 14 Aug 2020 22:40:28 +0200
+Date: Fri, 18 Sep 2020 22:30:28 +0200
 Description: More recent version of Java suppresses some warnings
 Origin: https://lists.debian.org/debian-med/2020/08/msg00104.html
 
@@ -14,3 +14,14 @@ Origin: https://lists.debian.org/debian-med/2020/08/msg00104.html
  	        <classpath refid="classpath"/>
          </javac>
    </target>
+--- a/tools/merge/tipp.xml
++++ b/tools/merge/tipp.xml
+@@ -29,7 +29,7 @@
+ 
+   <target name="compile">
+         <mkdir dir="${deploy.home}/classes"/>
+-        <javac srcdir="src" destdir="${deploy.home}/classes" source="1.6" target="1.6" debug="on" >
++        <javac srcdir="src" destdir="${deploy.home}/classes" source="1.8" target="1.8" debug="on" >
+ 	        <classpath refid="classpath"/>
+         </javac>
+   </target>


=====================================
debian/patches/java_build.patch
=====================================
@@ -0,0 +1,40 @@
+Description: Adapting the build.xml file of ant to Debian policy
+ There are no embedded jars to include.
+ The classpath thus has to be changed to include Debian-packaged jars.
+ The .java files should not be included in the target jars.
+Author: Pierre Gruet <pgtdebian at free.fr>
+Forwarded: not-needed
+Last-Update: 2020-09-18
+
+--- a/tools/merge/build.xml
++++ b/tools/merge/build.xml
+@@ -44,12 +44,8 @@
+         <attribute name="Main-Class" value="${main.class}" />  
+   
+         <!-- Finally, use the generated libs path -->  
+-        <attribute name="Class-Path" value="lib/*.jar" />  
++        <attribute name="Class-Path" value="/usr/share/java/jenkins-json-lib.jar /usr/share/java/gson.jar" />  
+       </manifest>  
+-      
+-      <zipgroupfileset dir="lib" includes="*.jar" />
+-      <!--<fileset dir="lib" includes="*.jar"/>  -->
+-      <fileset dir="${src.home}" includes="**/*.java"/>      
+     </jar>  
+   </target>  
+   
+--- a/tools/merge/tipp.xml
++++ b/tools/merge/tipp.xml
+@@ -44,12 +44,8 @@
+         <attribute name="Main-Class" value="${main.class}" />  
+   
+         <!-- Finally, use the generated libs path -->  
+-        <attribute name="Class-Path" value="lib/*.jar" />  
++        <attribute name="Class-Path" value="/usr/share/java/jenkins-json-lib.jar /usr/share/java/gson.jar" />  
+       </manifest>  
+-      
+-      <zipgroupfileset dir="lib" includes="*.jar" />
+-      <!--<fileset dir="lib" includes="*.jar"/>  -->
+-      <fileset dir="${src.home}" includes="**/*.java"/>      
+     </jar>  
+   </target>  
+   


=====================================
debian/patches/series
=====================================
@@ -2,3 +2,5 @@ setup.patch
 use_debian_packaged_guppy_from_pplacer.patch
 change_java_version_for_ant.patch
 json_collections.patch
+java_build.patch
+use_etc_configuration_files.patch


=====================================
debian/patches/use_debian_packaged_guppy_from_pplacer.patch
=====================================
@@ -46,3 +46,55 @@ Description: Use Debian packaged guppy and hmm*
  
      def initialize_options(self):
          """init options"""
+--- a/test/unittest/testConfig.py
++++ b/test/unittest/testConfig.py
+@@ -93,7 +93,7 @@
+         sys.argv = [sys.argv[0], "-c", get_data_path("configs/test2.config")]
+         # set pplacer filepath to a file shipped with the code base
+         options().pplacer.path = get_data_path(
+-            "../../../tools/bundled/Darwin/pplacer")
++            "/usr/bin/pplacer")
+ 
+         assert (options().pplacer is not None and os.path.exists(
+                 options().pplacer.path)), \
+@@ -102,14 +102,14 @@
+              options().pplacer.path)
+ 
+         options().hmmalign.path = get_data_path(
+-            "../../../tools/bundled/Darwin/hmmalign")
++            "/usr/bin/hmmalign")
+         assert (options().hmmalign is not None and os.path.exists(
+                 options().hmmalign.path)), \
+             ("main config file options not read properly, or nonexistent "
+              "binaries: hmmalign = %s" % options().hmmalign.path)
+ 
+         options().hmmsearch.path = get_data_path(
+-            "../../../tools/bundled/Darwin/hmmsearch")
++            "/usr/bin/hmmsearch")
+         assert (options().hmmsearch is not None and os.path.exists(
+                 options().hmmsearch.path)), \
+             ("main config file options not read properly, or nonexistent "
+--- a/test/unittest/testMidpoint.py
++++ b/test/unittest/testMidpoint.py
+@@ -41,8 +41,7 @@
+             suff_bit = ""
+         for prog in ['hmmalign', 'hmmbuild', 'hmmsearch', 'pplacer']:
+             setattr(self.x.options, prog, Namespace(
+-                path=get_data_path("../../../tools/bundled/%s/%s%s" % (
+-                    platform.system(), prog, suff_bit))))
++                path=get_data_path("/usr/bin/" + prog)))
+ 
+     def setUp(self):
+         # ensure necessary settings are made
+--- a/test/unittest/testSepp.py
++++ b/test/unittest/testSepp.py
+@@ -42,8 +42,7 @@
+             suff_bit = ""
+         for prog in ['hmmalign', 'hmmbuild', 'hmmsearch', 'pplacer']:
+             setattr(self.x.options, prog, Namespace(
+-                path=get_data_path("../../../tools/bundled/%s/%s%s" % (
+-                    platform.system(), prog, suff_bit))))
++                path=get_data_path("/usr/bin/" + prog)))
+ 
+     def tearDown(self):
+         self.x.options.alignment_file.close()


=====================================
debian/patches/use_etc_configuration_files.patch
=====================================
@@ -0,0 +1,71 @@
+Description: using configuration files that are in /etc
+Author: Pierre Gruet <pgtdebian at free.fr>
+Forwarded: not-needed
+Last-Update: 2020-09-19
+
+--- a/run_tipp_tool.py
++++ b/run_tipp_tool.py
+@@ -43,9 +43,7 @@
+     return args
+ 
+ 
+-root_p = open(os.path.join(os.path.split(
+-    os.path.split(sepp.__file__)[0])[0], "home.path")).readlines()[0].strip()
+-tipp_config_path = os.path.join(root_p, "tipp.config")
++tipp_config_path = "/etc/sepp/tipp.config"
+ 
+ 
+ def profile(input, gene, output, prefix, threshold):
+--- a/sepp/config.py
++++ b/sepp/config.py
+@@ -48,9 +48,7 @@
+ 
+ _LOG = get_logger(__name__)
+ 
+-root_p = open(os.path.join(os.path.split(
+-    os.path.split(__file__)[0])[0], "home.path")).readlines()[0].strip()
+-main_config_path = os.path.join(root_p, "main.config")
++main_config_path = "/etc/sepp/main.config"
+ 
+ 
+ def set_main_config_path(filename):
+--- a/sepp/ensemble.py
++++ b/sepp/ensemble.py
+@@ -161,7 +161,7 @@
+ 
+ 
+ def augment_parser():
+-    sepp.config.set_main_config_path(os.path.expanduser("~/.sepp/upp.config"))
++    sepp.config.set_main_config_path("/etc/sepp/upp.config")
+     parser = sepp.config.get_parser()
+     parser.description = (
+         "This script runs the UPP algorithm on set of sequences.  A backbone "
+--- a/sepp/exhaustive_tipp.py
++++ b/sepp/exhaustive_tipp.py
+@@ -483,12 +483,7 @@
+ 
+ 
+ def augment_parser():
+-    root_p = open(
+-        os.path.join(
+-            os.path.split(
+-                os.path.split(
+-                    __file__)[0])[0], "home.path")).readlines()[0].strip()
+-    tipp_config_path = os.path.join(root_p, "tipp.config")
++    tipp_config_path = "/etc/sepp/tipp.config"
+     sepp.config.set_main_config_path(tipp_config_path)
+     # default_settings['DEF_P'] = (100 ,
+     #    "Number of taxa (i.e. no decomposition)")
+--- a/sepp/exhaustive_upp.py
++++ b/sepp/exhaustive_upp.py
+@@ -324,9 +324,7 @@
+ 
+ 
+ def augment_parser():
+-    root_p = open(os.path.join(os.path.split(
+-        os.path.split(__file__)[0])[0], "home.path")).readlines()[0].strip()
+-    upp_config_path = os.path.join(root_p, "upp.config")
++    upp_config_path = "/etc/sepp/upp.config"
+     sepp.config.set_main_config_path(upp_config_path)
+     parser = sepp.config.get_parser()
+     parser.description = (


=====================================
debian/rules
=====================================
@@ -23,20 +23,60 @@ include /usr/share/dpkg/default.mk
 override_dh_auto_configure:
 	mkdir -p tools/bundled/Linux
 	mkdir -p tools/merge/lib
+	# Building the jars for sepp first, tipp then.
 	cd tools/merge && \
-	CLASSPATH=/usr/share/java/jenkins-json-lib.jar:/usr/share/java/gson.jar ant
-	dh_auto_configure
+	CLASSPATH=/usr/share/java/jenkins-json-lib.jar:/usr/share/java/gson.jar ant && \
+	CLASSPATH=/usr/share/java/jenkins-json-lib.jar:/usr/share/java/gson.jar ant -f tipp.xml
+	# dh_auto_configure only calls the config for sepp, we need it for tipp and
+	# upp as well.
+	pybuild --configure --configure-args "tipp upp"
+
+override_dh_auto_build:
+	dh_auto_build
+	# Preparing a conffile with Debian paths for sepp.
+	sed 's,path=.*\(pplacer\)$$,path=/usr/bin/\1,' `find . -name main.config` | \
+	        sed 's,path=.*\(hmm[a-z]*\)$$,path=/usr/bin/\1,' | \
+	        sed 's,path=.*\(seppJsonMerger.jar\)$$,path=/usr/share/sepp/\1,' > main.config
+	# Preparing a conffile with Debian paths for tipp.
+	sed 's,path=.*\(pplacer\)$$,path=/usr/bin/\1,' `find . -name tipp.config` | \
+	        sed 's,path=.*\(hmm[a-z]*\)$$,path=/usr/bin/\1,' | \
+	        sed 's,path=.*\(tippJsonMerger.jar\)$$,path=/usr/share/sepp/\1,' > tipp.config
+	# Preparing a conffile with Debian paths for upp.
+	sed 's,path=.*\(pplacer\)$$,path=/usr/bin/\1,' `find . -name upp.config` | \
+	        sed 's,path=.*\(hmm[a-z]*\)$$,path=/usr/bin/\1,' | \
+	        sed 's,path=.*\(seppJsonMerger.jar\)$$,path=/usr/share/sepp/\1,' > upp.config
 
 override_dh_auto_clean:
 	dh_auto_clean
-	rm -rf tools/bundled
+	$(RM) -rf tools/bundled
+	$(RM) -rf tools/merge/build
+	$(RM) main.config tipp.config upp.config
 
 override_dh_auto_install:
 	dh_auto_install
-	rm debian/sepp/usr/home.path
+	# Deleting upstream configuration file, which we are not packaging.
+	$(RM) debian/sepp/usr/home.path
 
-### When overriding auto_test make sure DEB_BUILD_OPTIONS will be respected
-#override_dh_auto_test:
-#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-#	do_stuff_for_testing
-#endif
+# To test, we move the test tree into a subdir of /tmp and we proceed to the
+# following changes:
+# - change paths of configuration files from /etc to build tree;
+# - change path of jar in /usr/share to build tree;
+# - adapt relative path of jar to its correct place in build tree.
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	ORIGIN_FOLDER=`pwd` && \
+	        TEST_FOLDER=`mktemp -d` && \
+	        cp -r test/ $$TEST_FOLDER && \
+	        cd $$TEST_FOLDER && \
+	        mkdir sepp/ && \
+	        for F in $$(ls $$ORIGIN_FOLDER/sepp/*.py); do \
+	                sed "s,/etc/sepp,$$TEST_FOLDER," $$F > sepp/$${F##*/}; \
+	        done && \
+	        for F in $$(ls $$ORIGIN_FOLDER/*.config); do \
+	                sed "s,/usr/share/sepp,$$ORIGIN_FOLDER/tools/merge," $$F > $${F##*/}; \
+	        done && \
+	        cd test/unittest/ && \
+	        sed "s,\".*\.jar\",\"$$ORIGIN_FOLDER/tools/merge/seppJsonMerger.jar\"," testMerge.py > testMergeCp.py && \
+	        mv testMergeCp.py testMerge.py && \
+	        PYTHONPATH=$$PYTHONPATH:../../ python3.8 -m unittest discover -v
+endif


=====================================
debian/sepp.lintian-overrides
=====================================
@@ -1,2 +1,2 @@
 # see https://lists.debian.org/debian-med/2018/06/msg00043.html
-: script-with-language-extension usr/bin/*.py
+script-with-language-extension usr/bin/*.py



View it on GitLab: https://salsa.debian.org/med-team/sepp/-/compare/c458c31847f39900a4dae5ae07bf816d1c1f2a40...48f6e95b4f03a20631736e9711ef824433deaf00

-- 
View it on GitLab: https://salsa.debian.org/med-team/sepp/-/compare/c458c31847f39900a4dae5ae07bf816d1c1f2a40...48f6e95b4f03a20631736e9711ef824433deaf00
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200926/a4e1959f/attachment-0001.html>


More information about the debian-med-commit mailing list