forked from pol/tacc-sci-life
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsamtools-1.2-1.spec
138 lines (110 loc) · 4.14 KB
/
samtools-1.2-1.spec
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# $Id$
Name: samtools
Version: 1.2
Release: 1
Summary: Utilities for manipulating alignments in the SAM format.
License: GPL
Group: Applications/Life Sciences
Source: http://downloads.sourceforge.net/project/samtools/samtools/1.2/samtools-1.2.tar.bz2
Packager: TACC - [email protected], [email protected]
#------------------------------------------------
# INITIAL DEFINITIONS
#------------------------------------------------
## System Definitions
%include ./include/system-defines.inc
%include ./include/%{PLATFORM}/rpm-dir.inc
## Compiler Family Definitions
# %include ./include/%{PLATFORM}/compiler-defines.inc
## MPI Family Definitions
# %include ./include/%{PLATFORM}/mpi-defines.inc
%define INSTALL_DIR %{APPS}/%{name}/%{version}
%define MODULE_DIR %{APPS}/%{MODULES}/%{name}
%define MODULE_VAR %{MODULE_VAR_PREFIX}SAMTOOLS
%define PNAME samtools
## PACKAGE DESCRIPTION
%description
Samtools is a set of utilities that manipulate alignments in the BAM format. It imports from and exports to the SAM (Sequence Alignment/Map) format, does sorting, merging and indexing, and allows to retrieve reads in any regions swiftly.
## PREP
# Use -n <name> if source file different from <name>-<version>.tar.gz
%prep
rm -rf $RPM_BUILD_ROOT/%{INSTALL_DIR}
## SETUP
%setup -n %{PNAME}-%{version}
## BUILD
%build
#------------------------------------------------
# INSTALL
#------------------------------------------------
%install
# Start with a clean environment
%include ./include/%{PLATFORM}/system-load.inc
mkdir -p $RPM_BUILD_ROOT/%{INSTALL_DIR}
#------------------------------------------------
## Install Steps Start
module purge
module load TACC
module swap $TACC_FAMILY_COMPILER gcc
make
make prefix=%{INSTALL_DIR} DESTDIR=$RPM_BUILD_ROOT install
## Install Steps End
#------------------------------------------------
# cp -R ./samtools ./bcftools ./misc ./examples $RPM_BUILD_ROOT/%{INSTALL_DIR}
mkdir -p $RPM_BUILD_ROOT/%{INSTALL_DIR}/lib
cp -R ./libbam.a $RPM_BUILD_ROOT/%{INSTALL_DIR}/lib
mkdir -p $RPM_BUILD_ROOT/%{INSTALL_DIR}/include
cp -R *.h $RPM_BUILD_ROOT/%{INSTALL_DIR}/include
#------------------------------------------------
# MODULEFILE CREATION
#------------------------------------------------
rm -rf $RPM_BUILD_ROOT%{MODULE_DIR}
mkdir -p $RPM_BUILD_ROOT%{MODULE_DIR}
#------------------------------------------------
## Modulefile Start
cat > $RPM_BUILD_ROOT%{MODULE_DIR}/%{version}.lua << 'EOF'
help (
[[
The %{name} module file defines the following environment variables:
%{MODULE_VAR}_DIR, %{MODULE_VAR}_INC, and %{MODULE_VAR}_LIB
associated with %{name}
Version %{version}
]])
whatis("Name: samtools")
whatis("Version: %{version}")
whatis("Category: computational biology, genomics")
whatis("Keywords: Biology, Genomics, Quality Control, Utility, Sequencing, Genotyping, Resequencing, SNP")
whatis("URL: http://samtools.sourceforge.net/")
whatis("Description: SAM Tools provide various utilities for manipulating alignments in the SAM format, including sorting, merging, indexing and generating alignments in a per-position format.")
prepend_path("PATH", "%{INSTALL_DIR}/bin")
prepend_path("PATH", "%{INSTALL_DIR}/bcftools")
prepend_path("PATH", "%{INSTALL_DIR}/misc")
setenv ( "%{MODULE_VAR}_DIR", "%{INSTALL_DIR}/")
setenv ( "%{MODULE_VAR}_BIN", "%{INSTALL_DIR}/bin")
setenv ( "%{MODULE_VAR}_INC", "%{INSTALL_DIR}/include")
setenv ( "%{MODULE_VAR}_LIB", "%{INSTALL_DIR}/lib")
EOF
## Modulefile End
#------------------------------------------------
## Lua syntax check
if [ -f $SPEC_DIR/checkModuleSyntax ]; then
$SPEC_DIR/checkModuleSyntax $RPM_BUILD_ROOT/%{MODULE_DIR}/%{version}.lua
fi
## VERSION FILE
cat > $RPM_BUILD_ROOT%{MODULE_DIR}/.version.%{version} << 'EOF'
#%Module3.1.1#################################################
##
## version file for %{name}-%{version}
##
set ModulesVersion "%{version}"
EOF
#------------------------------------------------
# FILES SECTION
#------------------------------------------------
%files
# Define files permissions, user, and group
%defattr(755,root,root,-)
%{INSTALL_DIR}
%{MODULE_DIR}
## CLEAN UP
%post
%clean
rm -rf $RPM_BUILD_ROOT