forked from pol/tacc-sci-life
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfastqc-0.11.3-1.spec
188 lines (146 loc) · 5.12 KB
/
fastqc-0.11.3-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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
Name: fastqc
Version: 0.11.3
Release: 1
License: GPL
Source: http://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.3.zip
URL: http://www.bioinformatics.babraham.ac.uk/projects/fastqc/
Packager: TACC - [email protected]
Summary: FastQC - A quality control application for high throughput sequence data
#------------------------------------------------
# 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
## directory and name definitions for relocatable RPMs
%include ./include/name-defines.inc
%define MODULE_VAR %{MODULE_VAR_PREFIX}FASTQC
%define PNAME fastqc
%package %{PACKAGE}
Summary: A quality control application for high throughput sequence data
Group: Applications/Life Sciences
%description package
%package %{MODULEFILE}
Summary: A quality control application for high throughput sequence data
Group: Applications/Life Sciences
%description modulefile
## PACKAGE DESCRIPTION
%description
FastQC is an application which takes a FastQ file and runs a series of tests on it to generate a comprehensive QC report.
## PREP
# Use -n <name> if source file different from <name>-<version>.tar.gz
%prep
%if %{?BUILD_PACKAGE}
rm -rf $RPM_BUILD_ROOT/%{INSTALL_DIR}
%endif
%if %{?BUILD_MODULEFILE}
rm -rf $RPM_BUILD_ROOT/%{MODULE_DIR}
%endif
## SETUP
# Run the setup macro - this removes old copies, then unpackages the program zip file
# from ~SOURCES into ~BUILD
%setup -n FastQC
## BUILD
%build
#------------------------------------------------
# INSTALL
#------------------------------------------------
%install
# Start with a clean environment
%include ./include/%{PLATFORM}/system-load.inc
#--------------------------------------
%if %{?BUILD_PACKAGE}
mkdir -p $RPM_BUILD_ROOT/%{INSTALL_DIR}
##### Create TACC Canary Files ########
touch $RPM_BUILD_ROOT/%{INSTALL_DIR}/.tacc_install_canary
########### Do Not Remove #############
## Install Steps Start
module purge
module load TACC
module swap $TACC_FAMILY_COMPILER intel
# The objective of this section is to install the compiled software into a virtual
# directory structure so that it can be packaged up into an RPM
#
# install is also a macro that does many things, including creating appropriate
# directories in $RPM_BUILD_ROOT and cd to the right place
mkdir -p $RPM_BUILD_ROOT%{INSTALL_DIR}
cp -R ./Help ./uk ./Templates ./fastqc ./*.txt ./*.jar $RPM_BUILD_ROOT/%{INSTALL_DIR}
%endif
#------------------------------------------------
# MODULEFILE CREATION
#------------------------------------------------
# Clean up the old module directory
rm -rf $RPM_BUILD_ROOT/%{MODULE_DIR}
%if %{?BUILD_MODULEFILE}
mkdir -p $RPM_BUILD_ROOT/%{MODULE_DIR}
##### Create TACC Canary Files ########
touch $RPM_BUILD_ROOT/%{MODULE_DIR}/.tacc_module_canary
########### Do Not Remove #############
#--------------------------------------
## Modulefile Start
cat > $RPM_BUILD_ROOT/%{MODULE_DIR}/%{version}.lua << 'EOF'
help (
[[
This module loads %{PNAME} built with %{comp_fam}.
Documentation for %{PNAME} is available online at http://www.bioinformatics.babraham.ac.uk/projects/fastqc
The executables are added on to path
Version %{version}
]])
whatis("Name: %{PNAME}")
whatis("Version: %{version}")
whatis("Category: computational biology, genomics")
whatis("Keywords: Biology, Genomics, Sequencing, FastQ, Quality Control")
whatis("Description: fastqc - A Quality Control application for FastQ files")
whatis("URL: http://www.bioinformatics.babraham.ac.uk/projects/fastqc")
setenv("%{MODULE_VAR}_DIR","%{INSTALL_DIR}/")
prepend_path("PATH" ,"%{INSTALL_DIR}")
EOF
## Modulefile End
#--------------------------------------
# Lua sytax 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 %{PNAME}-%{version}
##
set ModulesVersion "%{version}"
EOF
## VERSION FILE END
#--------------------------------------
%endif
#------------------------------------------------
# FILES SECTION
#------------------------------------------------
%if %{?BUILD_PACKAGE}
%files %{PACKAGE}
%defattr(755,root,root,-)
%{INSTALL_DIR}
%{MODULE_DIR}
%endif # ?BUILD_PACKAGE
%if %{?BUILD_MODULEFILE}
%files %{MODULEFILE}
%defattr(-,root,install,)
%{MODULE_DIR}
%endif # ?BUILD_MODULEFILE
## POST
%post %{PACKAGE}
export PACKAGE_POST=1
%include include/post-defines.inc
%post %{MODULEFILE}
export MODULEFILE_POST=1
%include include/post-defines.inc
## CLEAN UP
%clean
# Make sure we are not within one of the directories we try to delete
cd /tmp
# Remove the installation files now that the RPM has been generated
rm -rf $RPM_BUILD_ROOT