From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-848472-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 411D31384B4
	for <garchives@archives.gentoo.org>; Tue, 24 Nov 2015 19:28:13 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 607D421C0B5;
	Tue, 24 Nov 2015 19:28:09 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id D206921C0B5
	for <gentoo-commits@lists.gentoo.org>; Tue, 24 Nov 2015 19:28:08 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id C196A3405C3
	for <gentoo-commits@lists.gentoo.org>; Tue, 24 Nov 2015 19:28:06 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 793B7A3F
	for <gentoo-commits@lists.gentoo.org>; Tue, 24 Nov 2015 19:28:05 +0000 (UTC)
From: "Martin Mokrejs" <mmokrejs@fold.natur.cuni.cz>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Martin Mokrejs" <mmokrejs@fold.natur.cuni.cz>
Message-ID: <1448393264.62c5ffc75e7cea39f2488c7567ea47808c57b8f8.mmokrejs@gentoo>
Subject: [gentoo-commits] proj/sci:master commit in: sci-biology/repeatmasker/, sci-biology/repeatmasker/files/
X-VCS-Repository: proj/sci
X-VCS-Files: sci-biology/repeatmasker/ChangeLog sci-biology/repeatmasker/files/configure.patch sci-biology/repeatmasker/metadata.xml sci-biology/repeatmasker/repeatmasker-4.0.1-r1.ebuild
X-VCS-Directories: sci-biology/repeatmasker/files/ sci-biology/repeatmasker/
X-VCS-Committer: mmokrejs
X-VCS-Committer-Name: Martin Mokrejs
X-VCS-Revision: 62c5ffc75e7cea39f2488c7567ea47808c57b8f8
X-VCS-Branch: master
Date: Tue, 24 Nov 2015 19:28:05 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 55aa19d8-27a7-4570-b7fb-72f69c1bc8a8
X-Archives-Hash: eecd6a51a5d88fc79b584666aea9b2a4

commit:     62c5ffc75e7cea39f2488c7567ea47808c57b8f8
Author:     Martin Mokrejš <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
AuthorDate: Tue Nov 24 19:27:44 2015 +0000
Commit:     Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
CommitDate: Tue Nov 24 19:27:44 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=62c5ffc7

sci-biology/repeatmasker: heavily patch configure to return error codes and die upon error; add more DEPENDencies

Package-Manager: portage-2.2.18

 sci-biology/repeatmasker/ChangeLog                 |  10 ++
 sci-biology/repeatmasker/files/configure.patch     | 122 +++++++++++++++++++++
 sci-biology/repeatmasker/metadata.xml              |   5 +
 .../repeatmasker/repeatmasker-4.0.1-r1.ebuild      | 100 +++++++++++++++++
 4 files changed, 237 insertions(+)

diff --git a/sci-biology/repeatmasker/ChangeLog b/sci-biology/repeatmasker/ChangeLog
new file mode 100644
index 0000000..67ed4e6
--- /dev/null
+++ b/sci-biology/repeatmasker/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for sci-biology/repeatmasker
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Id$
+
+*repeatmasker-4.0.1-r1 (24 Nov 2015)
+
+  24 Nov 2015; Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>
+  +files/configure.patch, +metadata.xml, +repeatmasker-4.0.1-r1.ebuild:
+  sci-biology/repeatmasker: heavily patch configure to return error codes and
+  die upon error; add more DEPENDencies

diff --git a/sci-biology/repeatmasker/files/configure.patch b/sci-biology/repeatmasker/files/configure.patch
new file mode 100644
index 0000000..0b8a75c
--- /dev/null
+++ b/sci-biology/repeatmasker/files/configure.patch
@@ -0,0 +1,122 @@
+--- configure.ori	2013-02-21 02:32:30.000000000 +0100
++++ configure	2015-11-24 19:54:50.630202150 +0100
+@@ -253,17 +253,16 @@
+   close INVERS;
+ }
+ else {
+-  print "\nYour RepeatMasker installation is missing a library file.\n"
++  die "\nYour RepeatMasker installation is missing a library file.\n"
+       . "RepeatMasker requires a minimal set of library sequences to run\n"
+       . "properly.  Please check that all files were extracted from the\n"
+       . "distribution before re-running the configure program.\n\n";
+-  exit;
+ }
+ 
+ print "\n  -- Building monolithic RM database...";
+ system(
+ "$rmLocation/util/buildRMLibFromEMBL.pl $rmLocation/Libraries/RepeatMaskerLib.embl > $rmLocation/Libraries/RepeatMasker.lib 2>/dev/null"
+-);
++) and die "$rmLocation/util/buildRMLibFromEMBL.pl $rmLocation/Libraries/RepeatMaskerLib.embl command filed with: $!";
+ 
+ ##
+ ## TRF location
+@@ -475,7 +474,7 @@
+     }
+     close IN;
+     close OUT;
+-    system( "mv $configFile.tmp $configFile" );
++    system( "mv $configFile.tmp $configFile" ) and die "mv $configFile.tmp $configFile failed with: $!";
+   }
+ 
+ }
+@@ -607,15 +606,15 @@
+   }
+   close IN;
+   close OUT;
+-  system( "mv $configFile.tmp $configFile" );
++  system( "mv $configFile.tmp $configFile" ) and die "Faled to mv $configFile.tmp $configFile: $!";
+ 
+   # Freeze RM and RMPep libraries for RepeatModeler use among others
+   my $rmLocation = "$FindBin::Bin";
+   print "Building RMBlast frozen libraries..\n";
+   system(   "$pgLocation/makeblastdb -dbtype nucl -in "
+-          . "$rmLocation/Libraries/RepeatMasker.lib > /dev/null 2>&1" );
++          . "$rmLocation/Libraries/RepeatMasker.lib > /dev/null 2>&1" ) and die "$pgLocation/makeblastdb -dbtype nucl -in $rmLocation/Libraries/RepeatMasker.lib failed: $!";
+   system(   "$pgLocation/makeblastdb -dbtype prot -in "
+-          . "$rmLocation/Libraries/RepeatPeps.lib > /dev/null 2>&1" );
++          . "$rmLocation/Libraries/RepeatPeps.lib > /dev/null 2>&1" ) and die "$pgLocation/makeblastdb -dbtype prot -in $rmLocation/Libraries/RepeatPeps.lib failed with: $!";
+ 
+   my $pgDefault = &promptScreen(
+     "",
+@@ -682,15 +681,15 @@
+   }
+   close IN;
+   close OUT;
+-  system( "mv $configFile.tmp $configFile" );
++  system( "mv $configFile.tmp $configFile" ) and die "mv $configFile.tmp $configFile failed with: $!";
+ 
+   # Freeze RM and RMPep libraries
+   my $rmLocation = "$FindBin::Bin";
+   print "Building WUBlast/ABBlast frozen libraries..\n";
+   system(   "$wuLocation/xdformat -n -I "
+-          . "$rmLocation/Libraries/RepeatMasker.lib > /dev/null 2>&1" );
++          . "$rmLocation/Libraries/RepeatMasker.lib > /dev/null 2>&1" ) and die "$wuLocation/xdformat -n -I $rmLocation/Libraries/RepeatMasker.lib failed with: $!";
+   system(   "$wuLocation/xdformat -p -I "
+-          . "$rmLocation/Libraries/RepeatPeps.lib > /dev/null 2>&1" );
++          . "$rmLocation/Libraries/RepeatPeps.lib > /dev/null 2>&1" ) and die "$wuLocation/xdformat -p -I $rmLocation/Libraries/RepeatPeps.lib failed with: $!";
+ 
+   my $wuDefault = &promptScreen(
+     "",
+@@ -748,7 +747,7 @@
+         }
+       }
+       else {
+-        print "ERROR: Could not find nhmmer program in this directory!\n";
++        print "ERROR: Could not find nhmmer program in '$location' directory!\n";
+       }
+       if ( $goodParam == 0 ) {
+         print "<PRESS ENTER TO CONTINUE>\n";
+@@ -773,7 +772,7 @@
+   }
+   close IN;
+   close OUT;
+-  system( "mv $configFile.tmp $configFile" );
++  system( "mv $configFile.tmp $configFile" ) and die "mv $configFile.tmp $configFile failed with: $!";
+ 
+   my $default = &promptScreen(
+     "",
+@@ -827,7 +826,7 @@
+   }
+   close IN;
+   close OUT;
+-  system( "mv $configFile.tmp $configFile" );
++  system( "mv $configFile.tmp $configFile" ) and die "mv $configFile.tmp $configFile failed with: $!";
+ 
+   my $deDefault = &promptScreen(
+     "",
+@@ -863,9 +862,6 @@
+ 
+   my $answer = undef;
+ 
+-  # Clear the screen
+-  system( "clear" );
+-
+   print "\n\n\n";
+   print $screenText;
+   my $numLines = ( $screenText =~ s/(\n)/$1/g );
+--- configure.ori	2015-11-24 20:10:58.640204679 +0100
++++ configure	2015-11-24 20:11:00.970204685 +0100
+@@ -728,11 +728,12 @@
+         # HMMER 3.0dev (March 2010); http://hmmer.org/
+         # HMMER 3.1dev_0.33 (July 2012); http://hmmer.org
+         # HMMER hmmer3.1-snap20120830 (August 2012); http://hmmer.org/
++	# HMMER 3.1b2 (February 2015); http://hmmer.org/
+         while ( $result =~ /([^\n\r]*)[\n\r]/ig ) {
+           my $line = $1;
+ 
+           if ( $line =~ /^#\s+HMMER\s+(\d+\.\d+)((dev)?(_\d+\.\d+)?\s+\(.*\)).*/
+-               || $line =~ /^#\s+HMMER\s+hmmer(\d+\.\d+)-snap.*/ )
++               || $line =~ /^#\s+HMMER\s+hmmer(\d+\.\d+)-snap.*/ || $line =~ /^#\s+HMMER\s+(\d+\.\d+).*/)
+           {
+             if ( $1 >= 3.1 ) {
+               $goodParam = 1;

diff --git a/sci-biology/repeatmasker/metadata.xml b/sci-biology/repeatmasker/metadata.xml
new file mode 100644
index 0000000..f17a827
--- /dev/null
+++ b/sci-biology/repeatmasker/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <herd>sci-biology</herd>
+</pkgmetadata>

diff --git a/sci-biology/repeatmasker/repeatmasker-4.0.1-r1.ebuild b/sci-biology/repeatmasker/repeatmasker-4.0.1-r1.ebuild
new file mode 100644
index 0000000..9507e23
--- /dev/null
+++ b/sci-biology/repeatmasker/repeatmasker-4.0.1-r1.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+MY_PV=${PV//\./-}
+
+DESCRIPTION="Screen DNA sequences for interspersed repeats and low complexity DNA"
+HOMEPAGE="http://repeatmasker.org/"
+SRC_URI="http://www.repeatmasker.org/RepeatMasker-open-${MY_PV}.tar.gz"
+
+LICENSE="OSL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=dev-lang/perl-5.8"
+RDEPEND="
+	sci-biology/rmblast
+	>=sci-biology/trf-4.0.4
+	sci-biology/repeatmasker-libraries
+	sci-biology/phrap"
+# dev-perl/Text-Soundex see bug #566740
+
+S="${WORKDIR}/RepeatMasker"
+
+src_prepare(){
+	epatch "${FILESDIR}"/configure.patch
+}
+
+src_configure() {
+	# The below is wrong as it causes:
+	# Enter path [ /var/tmp/portage/sci-biology/repeatmasker-4.0.1-r1/work/RepeatMasker ]: 
+	#  -- Building monolithic RM database...sh: /var/tmp/portage/sci-biology/repeatmasker-4.0.1-r1/image///usr/share/repeatmasker/Libraries/RepeatMasker.lib: No such file or directory
+	# -e 's|> \($rmLocation/Libraries/RepeatMasker.lib\)|> '${D}'/\1|'
+	sed -i -e 's/system( "clear" );//' "${S}/configure" || die
+	mkdir -p ${D}//usr/share/repeatmasker/Libraries/ || die
+	#
+	# the below files is actually overwritten by buildRMLibFromEMBL.pl so the 'blah'
+	# item does not get installed
+	echo ">blah\natgc" > ${D}//usr/share/repeatmasker/Libraries/RepeatMasker.lib || die
+	# below try to define paths to trf, cross_match, rmblast and nhmmer as search tools
+	echo "
+env
+${S}
+/opt/bin
+1
+/usr/bin
+Y
+2
+/usr/bin
+Y
+4
+/usr/bin
+Y
+5" | "${S}/configure" || die "configure failed"
+	sed -i -e 's|use lib $FindBin::RealBin;|use lib "/usr/share/'${PN}'/lib";|' \
+		-e 's|".*\(taxonomy.dat\)"|"/usr/share/'${PN}'/\1"|' \
+		-e '/$REPEATMASKER_DIR/ s|$FindBin::RealBin|/usr/share/'${PN}'|' \
+		"${S}"/{DateRepeats,ProcessRepeats,RepeatMasker,DupMasker,RepeatProteinMask,RepeatMaskerConfig.pm,Taxonomy.pm} || die
+}
+# configure failed to 'cp RepeatMaskerConfig.tmpl RepeatMaskerConfig.pm'
+# replace also /u1/local/bin/perl with proper Gentoo PATH
+
+src_install() {
+	exeinto /usr/share/${PN}
+	for i in DateRepeats ProcessRepeats RepeatMasker DupMasker RepeatProteinMask; do
+		doexe $i || die
+		dosym /usr/share/${PN}/$i /usr/bin/$i || die
+	done
+
+	dodir /usr/share/${PN}/lib
+	insinto /usr/share/${PN}/lib
+	doins "${S}"/*.pm || die
+
+	# if sci-biology/repeatmasker-libraries is installed prevent file collision
+	# and do NOT install Libraries/RepeatMaskerLib.embl file which contains
+	# a limited version of the file: 20110419-min
+	rm -rf Libraries/RepeatMaskerLib.embl
+	insinto /usr/share/${PN}
+	doins -r util Matrices Libraries taxonomy.dat *.help || die
+	keepdir /usr/share/${PN}/Libraries
+
+	dodoc README INSTALL *.help
+}
+
+pkg_postinst(){
+	einfo "RepeatMasker provides bundled human repeats database"
+	einfo "from Dfam-1.0 database www.dfam.org"
+	einfo "You can configure which search search engine is to be used and"
+	einfo "PATHs to the search binaries in RepeatMaskerConfig.pm"
+	einfo "Supported search engines are:"
+	einfo "cross_match from sci-biology/phrap"
+	einfo "rmblast from sci-biology/rmblast"
+	einfo "nhmmer from >=sci-biology/hmmer-3.1"
+	einfo "abblast/wublast from http://blast.advbiocomp.com/licensing"
+}