forked from pol/tacc-sci-life
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcd-hit-4.6.4.spec
122 lines (100 loc) · 3.35 KB
/
cd-hit-4.6.4.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
%define PNAME cd-hit
Version: 4.6.4
Release: 1
License: GPL
Group: Applications/Life Sciences
Source: https://github.com/weizhongli/cdhit/releases/download/V4.6.4/cd-hit-4.6.4.tar.gz
Packager: TACC - [email protected]
Summary: Clustering DNA/protein sequence database at high identity with tolerance.
#------------------------------------------------
# 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}CD-HIT
## PACKAGE DESCRIPTION
%description
CD-HIT is a program for clustering DNA/protein sequence database at high identity with tolerance.
## PREP
# Use -n <name> if source file different from <name>-<version>.tar.gz
%prep
rm -rf $RPM_BUILD_ROOT/%{INSTALL_DIR}
rm -rf $RPM_BUILD_ROOT/%{MODULE_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}
if [ "%{PLATFORM}" != "ls5" ]
then
module purge
module load TACC
fi
## Make
make CC=icc openmp=yes LDFLAGS="-Wl,-rpath=$ICC_LIB -o" PREFIX=$RPM_BUILD_ROOT/%{INSTALL_DIR}
## Install Steps End
#--------------------------------------
make PREFIX=$RPM_BUILD_ROOT/%{INSTALL_DIR} install
#--------------------------------------
## Module File
#--------------------------------------
mkdir -p $RPM_BUILD_ROOT/%{MODULE_DIR}
cat > $RPM_BUILD_ROOT/%{MODULE_DIR}/%{version}.lua << 'EOF'
help (
[[
The %{PNAME} module file defines the following environment variables:
%{MODULE_VAR}_DIR for the location of the %{PNAME} distribution. Documentation can be found online at http://weizhong-lab.ucsd.edu/cd-hit/ref.php
Version %{version}
]])
whatis("Name: CD-HIT")
whatis("Version: %{version}")
whatis("Category: computational biology, genomics")
whatis("Keywords: Biology, Genomics, Proteomics, Clustering")
whatis("URL: https://github.com/weizhongli/cdhit")
whatis("Description: Clustering DNA/protein sequence database at high identity with tolerance.")
setenv("%{MODULE_VAR}_DIR","%{INSTALL_DIR}")
prepend_path("PATH" ,"%{INSTALL_DIR}")
EOF
## Module File 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 %{PNAME}-%{version}
##
set ModulesVersion "%{version}"
EOF
#--------------------------------------
#------------------------------------------------
# FILES SECTION
#------------------------------------------------
%files
%defattr(-,root,install,)
%{INSTALL_DIR}
%{MODULE_DIR}
## POST
%post
## 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