-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbootstrap.sh
executable file
·210 lines (186 loc) · 6.2 KB
/
bootstrap.sh
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#!/bin/bash
#
# Build and install prerequisites for compiling lmserver dependencies
#
. /opt/rocks/share/devel/src/roll/etc/bootstrap-functions.sh
# Add PGDG repo for Postgresql and geospatial libs
# No opt-python for yum
module unload opt-python
yum install src/RPMS/screen-4.1.0-0.25.20120314git3c2946.el7.x86_64.rpm
yum install src/RPMS/pgdg-centos96-9.6-3.noarch.rpm epel-release
yum install cmake
yum update
### do this only once for roll distro to keep known RPMS in the roll src
#cd src/RPMS
# yumdownloader --resolve --enablerepo base screen.x86_64
# wget http://li.nux.ro/download/nux/dextop/el7/x86_64/bitstream-vera-fonts-common-1.10-19.el7.nux.noarch.rpm
# wget http://li.nux.ro/download/nux/dextop/el7/x86_64/bitstream-vera-sans-fonts-1.10-19.el7.nux.noarch.rpm
#
## for postgresql9.6 and postgis2 rpms
# wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
#
## for gdal
# yumdownloader --resolve --enablerepo epel libaec.x86_64 libaec-devel.x86_64
# yumdownloader --resolve --enablerepo epel hdf5.x86_64 hdf5-devel.x86_64
## for postgis
# yumdownloader --resolve --enablerepo epel proj.x86_64
## for mapserver
# yumdownloader --resolve --enablerepo base giflib-devel.x86_64
#
## Add PostgreSQL 9.6, devel, server, python
# yumdownloader --resolve --enablerepo=pgdg96 postgresql96
# yumdownloader --resolve --enablerepo=pgdg96 postgresql96-server
# yumdownloader --resolve --enablerepo=pgdg96 postgresql96-contrib
# yumdownloader --resolve --enablerepo=pgdg96 postgresql96-devel
# yumdownloader --resolve --enablerepo=pgdg96 postgresql96-plpython
#
## Add postgis
# yumdownloader --resolve --enablerepo=pgdg96 boost-serialization
# for gdal-libs
# yumdownloader --resolve --enablerepo=epel libdap
# yumdownloader --resolve --enablerepo=epel CharLS
# yumdownloader --resolve --enablerepo=epel cfitsio
# yumdownloader --resolve --enablerepo=epel freexl
# yumdownloader --resolve --enablerepo=epel libgta
# yumdownloader --resolve --enablerepo=epel netcdf
# yumdownloader --resolve --enablerepo=epel openjpeg2
## armadillo brings arpack, atlas, blas, lapack, hdf5, SuperLU, openblas-openmp
# yumdownloader --resolve --enablerepo epel armadillo
# yumdownloader --resolve --enablerepo=pgdg96 postgis2_96
#
## Add postgresql-python connector
# yumdownloader --resolve --enablerepo=pgdg96 python2-psycopg2.x86_64
## Add pgbouncer from PGDG and dependency c-ares from epel and base repos
# yumdownloader --resolve --enablerepo=base c-ares.x86_64
# yumdownloader --resolve --enablerepo=base c-ares-devel.x86_64
# yumdownloader --resolve --enablerepo=pgdg96 pgbouncer
#
# for gdal
rpm -i src/RPMS/libaec-1.0.4-1.el7.x86_64.rpm
rpm -i src/RPMS/libaec-devel-1.0.4-1.el7.x86_64.rpm
rpm -i src/RPMS/hdf5-1.8.12-10.el7.x86_64.rpm
rpm -i src/RPMS/hdf5-devel-1.8.12-10.el7.x86_64.rpm
# for pgbouncer
rpm -i src/RPMS/c-ares-1.10.0-3.el7.x86_64.rpm
rpm -i src/RPMS/c-ares-devel-1.10.0-3.el7.x86_64.rpm
# for mapserver
module unload opt-python
# gd-devel pulls libXpm-devel also
yum --enablerepo base install gd-devel
rpm -i src/RPMS/bitstream-vera-fonts-common-1.10-19.el7.nux.noarch.rpm
rpm -i src/RPMS/bitstream-vera-sans-fonts-1.10-19.el7.nux.noarch.rpm
rpm -i src/RPMS/giflib-devel-4.1.6-9.el7.x86_64.rpm
# add dynamic libs
echo "/etc/alternatives/jre/lib/amd64" > /etc/ld.so.conf.d/lifemapper-server.conf
echo "/etc/alternatives/jre/lib/amd64/server" >> /etc/ld.so.conf.d/lifemapper-server.conf
echo "/opt/lifemapper/lib" >> /etc/ld.so.conf.d/lifemapper-server.conf
echo "/opt/python/lib/" >> /etc/ld.so.conf.d/lifemapper-server.conf
# echo "/opt/rocks/fcgi/lib" >> /etc/ld.so.conf.d/lifemapper-server.conf
/sbin/ldconfig
# # add newer version of chardet for requests dependency
# cd src/chardet
# make prep
# cd ../..
# module load opt-python
# compile chardet
# module unload opt-python
# install opt-lifemapper-chardet
# /sbin/ldconfig
# install proj, tiff, geos for gdal
cd src/proj
make prep
cd ../..
compile proj
install lifemapper-proj
/sbin/ldconfig
cd src/tiff
make prep
cd ../..
compile tiff
install lifemapper-tiff
/sbin/ldconfig
cd src/geos
make prep
cd ../..
compile geos
install lifemapper-geos
/sbin/ldconfig
cd src/gdal
make prep
cd ../..
module load opt-python
compile gdal
module unload opt-python
install lifemapper-gdal
/sbin/ldconfig
# install postgresql
# yum --enablerepo base update openssl
rpm -i src/RPMS/postgresql96-libs-9.6.15-1PGDG.rhel7.x86_64.rpm
rpm -i src/RPMS/postgresql96-9.6.15-1PGDG.rhel7.x86_64.rpm
rpm -i src/RPMS/postgresql96-devel-9.6.15-1PGDG.rhel7.x86_64.rpm
rpm -i src/RPMS/postgresql96-server-9.6.15-1PGDG.rhel7.x86_64.rpm
rpm -i src/RPMS/postgresql96-contrib-9.6.15-1PGDG.rhel7.x86_64.rpm
/sbin/ldconfig /usr/pgsql-9.6/lib/
# TODO: Upgrade cherrypy to 17.4.2 and prepSrc on it and build dependencies
# cherrypy 17.4.2 requires six>=1.11.0, cheroot>=6.2.4, portend>=2.1.1,
# and for exec, not build:
# more-itertools=5.0.0
# contextlib2==0.6.0.post1
# zc.lockfile=2.0
# backports.functools_lru_cache=1.6.1
# jaraco.functools=2.0
# cheroot requires six
# portend requires tempora requires six, pytz
cd src/six
make prep
cd ../..
module load opt-python
compile six
module unload opt-python
install opt-lifemapper-six
/sbin/ldconfig
cd src/cheroot
make prep
cd ../..
module load opt-python
compile cheroot
module unload opt-python
install opt-lifemapper-cheroot
/sbin/ldconfig
cd src/pytz
make prep
cd ../..
module load opt-python
compile pytz
module unload opt-python
install opt-lifemapper-pytz
/sbin/ldconfig
cd src/tempora
make prep
cd ../..
module load opt-python
compile tempora
module unload opt-python
install opt-lifemapper-tempora
/sbin/ldconfig
cd src/portend
make prep
cd ../..
module load opt-python
compile portend
module unload opt-python
install opt-lifemapper-portend
/sbin/ldconfig
# Leave with opt-python loaded
module load opt-python
echo "You will need to download source code, data and dependencies."
echo " lmserver"
echo " webclient"
echo " lmdata-env"
echo " lmdata-image"
echo " lmdata-species"
echo " solr"
echo " cctools"
echo " dendropy"
echo "Go to each of the packages and execute:"
echo " make prep"