[med-svn] [kronatools] 01/01: Drop patches and use own install script

Andreas Tille tille at debian.org
Thu Aug 4 07:03:00 UTC 2016


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

tille pushed a commit to branch master
in repository kronatools.

commit 9db04ae6be8fe29e7049b5c4b170168c25a1f769
Author: Andreas Tille <tille at debian.org>
Date:   Thu Aug 4 09:02:13 2016 +0200

    Drop patches and use own install script
---
 debian/install.pl                       | 137 ++++++++++++++++++++++++++++++++
 debian/patches/fix_install_script.patch |  24 ------
 debian/patches/series                   |   1 -
 debian/rules                            |   2 +-
 4 files changed, 138 insertions(+), 26 deletions(-)

diff --git a/debian/install.pl b/debian/install.pl
new file mode 100755
index 0000000..2746b38
--- /dev/null
+++ b/debian/install.pl
@@ -0,0 +1,137 @@
+#!/usr/bin/env perl
+
+# Copyright © 2011, Battelle National Biodefense Institute (BNBI);
+# all rights reserved. Authored by: Brian Ondov, Nicholas Bergman, and
+# Adam Phillippy
+#
+# See the LICENSE.txt file included with this software for license information.
+
+use strict;
+
+use Cwd 'abs_path';
+use Getopt::Long;
+
+my $path = '/usr/local';
+my $taxonomyDir;
+my $scriptPath;
+my $help;
+
+GetOptions(
+	'prefix=s'   => \$path,
+	'taxonomy=s' => \$taxonomyDir,
+	'scriptpath=s' => \$scriptPath,
+	'help' => \$help
+	);
+
+if ( $help )
+{
+	print "./install.pl [-prefix /path/to/install] [-taxonomy /path/to/taxonomy] [-scriptpath /path/to/sripts]\n";
+	exit;
+}
+
+$path = abs_path($path);
+
+if ( defined $taxonomyDir )
+{
+	$taxonomyDir = abs_path($taxonomyDir);
+}
+
+if ( ! defined $scriptPath )
+{
+    $scriptPath = abs_path('scripts');
+}
+
+createDir($path);
+createDir("$path/bin");
+
+print "Creating links...\n";
+
+foreach my $script
+(qw(
+	ClassifyBLAST
+	GetContigMagnitudes
+	GetLCA
+	GetLibPath
+	GetTaxIDFromAcc
+	GetTaxInfo
+	ImportBLAST
+	ImportDiskUsage
+	ImportEC
+	ImportFCP
+	ImportGalaxy
+	ImportKrona
+	ImportMETAREP-blast
+	ImportMETAREP-EC
+	ImportMGRAST
+	ImportPhymmBL
+	ImportRDP
+	ImportRDPComparison
+	ImportTaxonomy
+	ImportText
+	ImportXML
+))
+{
+	if ( system('ln', '-sf', "$scriptPath/$script.pl", "$path/bin/kt$script") )
+	{
+		linkFail("$path/bin");
+	}
+}
+
+if ( defined $taxonomyDir )
+{
+	if ( ! -e $taxonomyDir )
+	{
+		ktDie("$taxonomyDir does not exist.");
+	}
+	
+	if ( -e 'taxonomy')
+	{
+		system('rm -r taxonomy');
+	}
+	
+	print "Linking taxonomy to $taxonomyDir...\n";
+	system('ln -s -f -F ' . $taxonomyDir . ' taxonomy');
+}
+
+print '
+Installation complete.
+
+Run ./updateTaxonomy.sh to use scripts that rely on NCBI taxonomy:
+   ktClassifyBLAST
+   ktGetLCA
+   ktGetTaxInfo
+   ktImportBLAST
+   ktImportTaxonomy
+   ktImportMETAREP-BLAST
+
+Run ./updateAccessions.sh to use scripts that get taxonomy IDs from accessions:
+   ktClassifyBLAST
+   ktGetTaxIDFromAcc
+   ktImportBLAST
+';
+
+sub createDir
+{
+	my ($dir) = @_;
+	
+	if ( ! -e $dir )
+	{
+		mkdir $dir or ktDie("$dir does not exist and couldn't create");
+	}
+}
+
+sub ktDie
+{
+	my ($error) = @_;
+	
+	print "\nERROR: $error\n\n";
+	exit 1;
+}
+
+sub linkFail
+{
+	my ($path) = @_;
+	
+	ktDie("Couldn't link files to $path.  Do you have permission?\n(Use \"--prefix <path>\" to change install location)");
+	exit 1;
+}
diff --git a/debian/patches/fix_install_script.patch b/debian/patches/fix_install_script.patch
deleted file mode 100644
index c3fbd06..0000000
--- a/debian/patches/fix_install_script.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Last-Update: Wed, 27 Jul 2016 11:44:17 +0200
-Description: Adjust to Debian install path and fix spelling
-
---- a/KronaTools/install.pl
-+++ b/KronaTools/install.pl
-@@ -34,7 +34,7 @@ if ( defined $taxonomyDir )
- 	$taxonomyDir = abs_path($taxonomyDir);
- }
- 
--my $scriptPath = abs_path('scripts');
-+my $scriptPath = '../share/perl5/KronaTools/scripts';
- 
- createDir($path);
- createDir("$path/bin");
-@@ -55,7 +55,7 @@ foreach my $script
- 	ImportFCP
- 	ImportGalaxy
- 	ImportKrona
--	ImportMETAREP-BLAST
-+	ImportMETAREP-blast
- 	ImportMETAREP-EC
- 	ImportMGRAST
- 	ImportPhymmBL
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index a1fd7c2..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-fix_install_script.patch
diff --git a/debian/rules b/debian/rules
index 14c637b..6322031 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,7 +14,7 @@ HELP2MAN = help2man --no-info --version-string="$(VERSION)" --no-discard-stderr
 
 override_dh_install:
 	dh_install
-	KronaTools/install.pl -prefix debian/$(DEBPKGNAME)/usr -taxonomy /var/lib/$(DEBPKGNAME)/taxonomy
+	debian/install.pl -prefix debian/$(DEBPKGNAME)/usr -taxonomy /var/lib/$(DEBPKGNAME)/taxonomy -scriptpath "../share/perl5/KronaTools/scripts"
 
 override_dh_installman_does_not_work__giving_up:
 	dh_installman

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



More information about the debian-med-commit mailing list