-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbes.spec.all_static.in
299 lines (243 loc) · 9.39 KB
/
bes.spec.all_static.in
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# -*- mode: rpm-spec -*-
%define bescachedir %{_localstatedir}/cache/%{name}
%define bespkidir %{_sysconfdir}/pki/%{name}
%define beslogdir %{_localstatedir}/log/%{name}
%define bespiddir %{_localstatedir}/run
# The pid file should be in /var/run and not /var/run/bes for systemctl/systemd
# to function correctly (it could be hacked, but it's better to go with the herd).
# jhrg 1/31/19
# /%{name}
%define besuser %{name}
%define besgroup %{name}
%define beslibdir %{_libdir}/bes
%define bessharedir %{_datadir}/bes
%define hyraxsharedir %{_datadir}/hyrax
Name: bes
Version: @PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_PATCH_VERSION@
Release: @PACKAGE_BUILD_NUMBER@.static%{?dist}
Summary: Back-end server software framework for OPeNDAP
Group: System Environment/Libraries
License: LGPLv2+
URL: http://www.opendap.org/download/BES.html
Source0: http://www.opendap.org/pub/source/bes-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: libdap >= 3.21.1
Requires: readline bzip2 zlib
Requires: libicu >= 3.6
Requires: libxml2 >= 2.9.0
Requires: libcurl >= 7.61.0
Requires: openssl
# Requires: netcdf >= 4.1
# Requires: hdf5 => 1.8
# Build and run against a static hdf4/hdfeos2 library because hdfeos2
# is not part of the RPM ecosystem. jhrg 3/24/15
# Requires: hdf >= 4.2
# gdal >= 1.10
# gridfields >= ?
# fits >= ?
Requires(pre): shadow-utils
BuildRequires: libdap-devel >= 3.21.1
BuildRequires: readline-devel
BuildRequires: bzip2-devel zlib-devel
BuildRequires: libxml2-devel >= 2.9.0
BuildRequires: libcurl-devel >= 7.61.0
BuildRequires: libicu-devel >= 3.6
BuildRequires: openssl-devel
BuildRequires: pkgconfig
# RH7++ only
BuildRequires: systemd
%description
BES is a high-performance back-end server software framework for
OPeNDAP that allows data providers more flexibility in providing end
users views of their data. The current OPeNDAP data objects (DAS, DDS,
and DataDDS) are still supported, but now data providers can add new data
views, provide new functionality, and new features to their end users
through the BES modular design. Providers can add new data handlers, new
data objects/views, the ability to define views with constraints and
aggregation, the ability to add reporting mechanisms, initialization
hooks, and more. Note: This RPM contains versions of the runtime
modules (aka handlers) that are statically linked to any dependencies
that cannot be pulled from the RHEL/CentOS 6 yum repositories. The
RPM without 'static' in its name requires that the EPEL repo be used
for some dependencies and does not include modules that lack dependencies
in the standard + EPEL repos.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: libdap-devel >= 3.21.1
# for the /usr/share/aclocal directory ownership
Requires: automake
Requires: openssl-devel, bzip2-devel, zlib-devel
Requires: pkgconfig
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
# %package doc
# Summary: Documentation of the OPeNDAP BES
# Group: Documentation
# %description doc
# Documentation of OPeNDAP BES.
%prep
%setup -q
chmod a-x dispatch/BESStreamResponseHandler*
%build
%configure --disable-dependency-tracking --with-dependencies=$prefix/deps --with-build=@PACKAGE_BUILD_NUMBER@
# Try removing --disable-static from the above so that libdap_module.a is built.
# The code links with this to avoid linking to a Shared Object library that is
# really a run-time loaded module. jhrg 1/21/22
make %{?_smp_mflags}
# make docs
# rm -rf __distribution_docs
# cp -pr docs __distribution_docs
# mv __distribution_docs/html __distribution_docs/api-html
# # .map and .md5 files are of dubious use
# rm __distribution_docs/api-html/*.map
# rm __distribution_docs/api-html/*.md5
# chmod a-x __distribution_docs/BES_*.doc
sed -i.dist -e 's:=/tmp:=%{bescachedir}:' \
-e 's:=.*/bes.log:=%{beslogdir}/bes.log:' \
-e 's:=.*/lib/bes:=%{beslibdir}:' \
-e 's:=.*/share/bes:=%{bessharedir}:' \
-e 's:=.*/share/hyrax:=%{hyraxsharedir}:' \
-e 's:=/full/path/to/serverside/certificate/file.pem:=%{bespkidir}/cacerts/file.pem:' \
-e 's:=/full/path/to/serverside/key/file.pem:=%{bespkidir}/public/file.pem:' \
-e 's:=/full/path/to/clientside/certificate/file.pem:=%{bespkidir}/cacerts/file.pem:' \
-e 's:=/full/path/to/clientside/key/file.pem:=%{bespkidir}/public/file.pem:' \
-e 's:=user_name:=%{besuser}:' \
-e 's:=group_name:=%{besgroup}:' \
dispatch/bes/bes.conf
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
# Static libraries are now built so the code can link against libdap_module.a in
# some special cases. But, those should not be part of the RPM package so remove
# them here (along with the libtool archives). jhrg 1/21/22
find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';'
mkdir -p $RPM_BUILD_ROOT%{bescachedir}
chmod g+w $RPM_BUILD_ROOT%{bescachedir}
mkdir -p $RPM_BUILD_ROOT%{bespkidir}/{cacerts,public}
mkdir -p $RPM_BUILD_ROOT%{beslogdir}
chmod g+w $RPM_BUILD_ROOT%{beslogdir}
mkdir -p $RPM_BUILD_ROOT%{bespiddir}
chmod g+w $RPM_BUILD_ROOT%{bespiddir}
mv $RPM_BUILD_ROOT%{_bindir}/bes-config-pkgconfig $RPM_BUILD_ROOT%{_bindir}/bes-config
mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
mv $RPM_BUILD_ROOT%{_bindir}/bes-tmpfiles-conf $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf
%clean
rm -rf $RPM_BUILD_ROOT
%pre
getent group %{besgroup} >/dev/null || groupadd -r %{besgroup}
getent passwd %{besuser} >/dev/null || \
useradd -r -g %{besuser} -d %{beslogdir} -s /sbin/nologin \
-c "BES daemon" %{besuser}
exit 0
%post
/sbin/chkconfig --add besd
/sbin/ldconfig
%preun
/sbin/chkconfig --del besd
%postun -p /sbin/ldconfig
%files
#%attr(<mode>, <user>, <group>) file
#%defattr(file perms, user, group, dir perms)
%defattr(-,root,root,-)
%doc ChangeLog NEWS README.md
# NB: listing a directory here packages the dir and everything it contains. Using %dir
# packages _just_ the dir. Subsequent commands can add contents selectively. jhrg 9/19/18
%dir %{_sysconfdir}/bes/
%dir %{_sysconfdir}/bes/modules
%config(noreplace) %{_sysconfdir}/bes/bes.conf
%config(noreplace) %{_sysconfdir}/bes/site.conf.proto
%config(noreplace) %{_sysconfdir}/bes/modules/*.conf
# Added 10/25/16 jhrg. See below for the installation of the logrotate file.
%dir %{_sysconfdir}/logrotate.d
%config(noreplace) %{_sysconfdir}/logrotate.d/besd.logrotate
%dir %{_datadir}/bes/
%{_datadir}/bes/*.html
%{_datadir}/bes/*.txt
%{_datadir}/bes/*.xml
%{_datadir}/hyrax/
%{_datadir}/mds/
%{_bindir}/beslistener
%{_bindir}/besdaemon
# %{_bindir}/besd # moved to /etc/rc.d/init.d; see below.
%{_bindir}/besstandalone
%{_bindir}/besctl
%{_bindir}/hyraxctl
%{_bindir}/bescmdln
%{_bindir}/build_dmrpp
%{_bindir}/build_dmrpp_h4
%{_bindir}/check_dmrpp
%{_bindir}/merge_dmrpp
%{_bindir}/reduce_mdf
# %{_bindir}/ngap_build_dmrpp
%{_bindir}/localBesGetDap
%{_bindir}/populateMDS
%{_bindir}/get_dmrpp
%{_bindir}/get_dmrpp_h4
%{_bindir}/get_dmrpp_h5
%{_bindir}/ingest_filesystem
%{_bindir}/ingest_s3bucket
%{_bindir}/gen_dmrpp_side_car
%{_bindir}/get_hdf_side_car
#%{_bindir}/retriever
# There is now a separate project for a new build_sidecar program. This should not
# be installed. jhrg 8/20/20
# %{_bindir}/build_sidecar
%{_libdir}/*.so.*
%{_libdir}/bes/
%{_initddir}/besd
# %{bescachedir}
%{bespkidir}/
%attr (-,%{besuser},%{besgroup}) %{beslogdir}
# The directory bespiddir was specific to the bes, but it became a system directory.
# Thus, its bad form to change the owner and group to the 'bes.' jhrg 7/8/20
# %attr (-,%{besuser},%{besgroup}) %{bespiddir}
%attr (-,%{besuser},%{besgroup}) %{bescachedir}
# Make sure that the BES, once running, can write to the MDS directory. jhrg 11/7/18
%attr (-,%{besuser},%{besgroup}) %{_datadir}/mds/
%{_tmpfilesdir}/%{name}.conf
%files devel
%defattr(-,root,root,-)
# %doc __distribution_docs/BES_*.doc
%{_bindir}/besCreateModule
%{_bindir}/bes-config
%{_includedir}/bes/
%{_libdir}/*.so
%{_libdir}/pkgconfig/bes_*.pc
%{_datadir}/bes/templates/
%{_datadir}/aclocal/bes.m4
# %files doc
# %defattr(-,root,root,-)
# %doc __distribution_docs/api-html/
%changelog
* Wed Mar 18 2020 Nathan Potter <ndp@opendap.org> -3.20.6-1
- Added ngap_build_dmrpp to bin
* Thu Aug 30 2018 James Gallagher <jgallagher@opendap.org> - 3.19.1-1.static
- Added build_dmrpp, localBesGetDap, and populateMDS to bin
* Thu Apr 2 2015 EC2 James Gallagher <jgallagher@opendap.org> - 3.13.2-1.NASA
- Added install of 'besd' script to /etc/rc.d/init.d
* Tue Sep 14 2010 Patrick West <westp@rpi.edu> - 3.9.0-1
- Update
* Tue May 04 2010 Patrick West <westp@rpi.edu> - 3.8.3-1
- Update
* Tue Apr 06 2010 Patrick West <westp@rpi.edu> - 3.8.2-1
- Update
* Thu Mar 11 2010 Patrick West <westp@rpi.edu> - 3.8.1-1
- Update
* Tue Feb 02 2010 Patrick West <westp@rpi.edu> - 3.8.0-1
- Update
* Thu Jan 29 2009 James Gallagher <jgallagher@opendap.org> - 3.7.0-1
- Update
* Wed Jun 25 2008 Patrick West <pwest@ucar.edu> 3.6.2-1
- Update.
* Fri Apr 11 2008 Patrick West <pwest@ucar.edu> 3.6.1-1
- Update.
* Fri Feb 29 2008 Patrick West <pwest@ucar.edu> 3.6.0-1
- Update.
* Tue Feb 13 2007 James Gallagher <jgallagher@opendap.org> 3.4.0-1
- Update.
* Sat Jul 22 2006 Patrice Dumas <pertusus@free.fr> 3.2.0-1
- initial packaging