summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 56bcbec7a45ef538a3256c95e848c7590c832fd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Maintainer: Sebastian Wilzbach < sebi at wilzbach dot me >
pkgname=biopieces
pkgver=r2311
pkgrel=1
epoch=
pkgdesc="Bioinformatic framework of tools easily used and easily created"
arch=("any")
url="http://biopieces.googlecode.com/"
license=('GPL2')
groups=()
depends=('perl' 'ruby' "perl-svg" "perl-bit-vector" "perl-term-readkey" "perl-dbi" "perl-xml-parser" "perl-carp-clan" 
	"perl-class-inspector" "perl-html-parser" "perl-soap-lite" "perl-uri" "perl-inline" "perl-parse-recdescent" "perl-dbd-mysql"
	'ruby-gnuplot' 'ruby-narray' 'perl-json-xs' 'python2' 'ruby-rubyinline' 'ruby-terminal-table')
makedepends=("svn")
checkdepends=()
optdepends=('rubyinline' 'blast: legacy blast'  'gnuplot' 'blat' 'ray' 'bwa' 'bowtie' 'bowtie2' 'hmmer' 'mummer' 'muscle' 'velvet')
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("biopieces::svn+http://biopieces.googlecode.com/svn/trunk"
"biopieces/bp_usage::svn+http://biopieces.googlecode.com/svn/wiki"        
"biopieces.sh")
noextract=()
md5sums=('SKIP'
'SKIP'
'8ebebd698533ae818c8cfbef4fa8e9ca')

pkgver() {
	cd "$srcdir/$pkgname"
	local ver="$(svnversion)"
	printf "r%s" "${ver//[[:alpha:]]}"
}

package() {
	cd "$pkgdir"
	mkdir -p "opt/$pkgname"

	cp -a "$srcdir/biopieces" "opt/"

	# remove svn history
	rm -r -f "opt/$pkgname/.svn"
	rm -r -f "opt/$pkgname/bp_usage/.svn"
	rm -r -f "opt/$pkgname/.makepkg"

	# patch python2 scripts
	find "opt/$pkgname/code_python" -type f -exec sed -i 's/#!\/usr\/bin\/python/&2/' {} \;

	# install exports
	install -Dm755 "$srcdir/$pkgname.sh" etc/profile.d/$pkgname.sh
	source etc/profile.d/$pkgname.sh
}

check() {
	cd "$srcdir/biopieces"

	# set the constant for the test suite
	export BP_DIR=$(pwd)
	export BP_TMP=$BP_DIR"/tmp"
	export BP_LOG="$BP_TMP/log"
	mkdir -p $BP_LOG

	# source the config
	source "bp_conf/bashrc"

	# permission to write on bp_test
	chmod a+w "bp_test"
	chmod a+w "bp_test/in"
	chmod a+w "bp_test/out"

	# calling test
	/bin/bash "bp_test/test_all"

	# remove unnecessary test output
	rm -r -f $BP_TMP
}