nordugrid-arc.spec.in 43.4 KB
Newer Older
Maiken's avatar
Maiken committed
1
2
3
4
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

5
6
%{!?python3_pkgversion: %global python3_pkgversion 3}

7
8
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}

Maiken's avatar
Maiken committed
9
%if %{?rhel}%{!?rhel:0} == 6
10
%filter_provides_in %{python2_sitearch}/.*\.so$
Mattias Ellert's avatar
Mattias Ellert committed
11
12
13
%filter_setup
%endif

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
#
# Build dependency descrepancies across platforms
#
%if %{?suse_version:1}%{!?suse_version:0}
%global glibmm2_devel  glibmm2-devel
%global openldap_devel openldap2-devel
%else
%global glibmm2_devel  glibmm24-devel
%global openldap_devel openldap-devel
%endif
%if %{?fedora}%{!?fedora:5} > 4 && %{?suse_version:0}%{!?suse_version:1}
%global nss_devel nss-devel
%else
%global nss_devel mozilla-nss-devel
%endif

%if %{?fedora}%{!?fedora:0} >= 12 || %{?rhel}%{!?rhel:0} >= 6 || %{?suse_version:1}%{!?suse_version:0}
%global libuuid_devel libuuid-devel
%else
%global libuuid_devel e2fsprogs-devel
%endif

#
# xROOTd
#
39
%if %{?fedora}%{!?fedora:0} >= 12 || %{?rhel}%{!?rhel:0}
Mattias Ellert's avatar
Mattias Ellert committed
40
%global with_xrootd %{!?_without_xrootd:1}%{?_without_xrootd:0}
41
%else
Mattias Ellert's avatar
Mattias Ellert committed
42
%global with_xrootd 0
43
44
%endif

45
46
47
#
# Python
#
Anders Waananen's avatar
Anders Waananen committed
48
%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5 || %{?suse_version:1}%{!?suse_version:0}
49
50
51
52
53
54
55
56
57
58
59
60
%if %{?rhel}%{!?rhel:0} == 6
%ifarch ppc64
# The python module doesn't build on RHEL6 ppc64 (.toc1 section overflow)
%global with_python 0
%else
%global with_python 1
%endif
%else
%global with_python 1
%endif
%else
%global with_python 0
61
62
63
%endif

%if %{with_python}
Mattias Ellert's avatar
Mattias Ellert committed
64
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 7 || %{?suse_version:1}%{!?suse_version:0}
65
66
67
68
69
%global with_pylint %{!?_without_pylint:1}%{?_without_pylint:0}
%else
%global with_pylint 0
%endif
%else
Mattias Ellert's avatar
Mattias Ellert committed
70
%global with_pylint 0
71
72
%endif

73
74
75
76
77
78
79
80
81
82
%if %{?fedora}%{!?fedora:0} >= 29 || %{?rhel}%{!?rhel:0} >= 8
%global py3default 1
%global __defpython python3
%global __altpython python2
%else
%global py3default 0
%global __defpython python2
%global __altpython python3
%endif

83
%if %{?fedora}%{!?fedora:0} >= 7 || %{?rhel}%{!?rhel:0} >= 5 || %{?suse_version}%{!?suse_version:0} >= 1110
84
85
86
87
88
%global with_acix 1
%else
%global with_acix 0
%endif

89
%if %{?fedora}%{!?fedora:0} >= 21 || %{?rhel}%{!?rhel:0} >= 5
90
%global with_s3 1
91
%else
92
%global with_s3 0
93
94
%endif

95
%if %{?fedora}%{!?fedora:0} >= 21 || %{?rhel}%{!?rhel:0} >= 5
96
%global with_gfal 1
David Cameron's avatar
David Cameron committed
97
%else
98
%global with_gfal 0
David Cameron's avatar
David Cameron committed
99
100
%endif

101
102
%global with_canl 0

Mattias Ellert's avatar
Mattias Ellert committed
103
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0}
104
105
106
107
108
%global with_xmlsec1 %{!?_without_xmlsec1:1}%{?_without_xmlsec1:0}
%else
%global with_xmlsec1 0
%endif

109
110
111
112
113
114
%if %{?fedora}%{!?fedora:0} >= 21 || %{?rhel}%{!?rhel:0} >= 6
%global with_pythonlrms 1
%else
%global with_pythonlrms 0
%endif

115
# SQLite
116
%if %{?fedora}%{!?fedora:0} >= 11 || %{?rhel}%{!?rhel:0} >= 6
117
118
119
120
121
%global with_sqlite 1
%else
%global with_sqlite 0
%endif

122
# LDNS
123
%if %{?fedora}%{!?fedora:0} >= 13 || %{?rhel}%{!?rhel:0} >= 5
124
125
126
127
128
%global with_ldns 1
%else
%global with_ldns 0
%endif

129
130
%global pkgdir arc

Mattias Ellert's avatar
Mattias Ellert committed
131
132
133
134
135
136
%if %{?fedora}%{!?fedora:0} >= 25 || %{?rhel}%{!?rhel:0} >= 8
%global use_systemd 1
%else
%global use_systemd 0
%endif

137
138
139
140
141
#
# Macros for scripts
#

# Stop and disable service on package removal
Mattias Ellert's avatar
Mattias Ellert committed
142
143
144
%if %{use_systemd}
%define stop_on_removal() %{expand:%%systemd_preun %(sed 's/[^ ]*/&.service/g' <<< '%{?*}')}
%else
145
%if %{?stop_on_removal:0}%{!?stop_on_removal:1}
Anders Waananen's avatar
Anders Waananen committed
146
%global stop_on_removal() if [ $1 -eq 0 ]; then for s in %*; do service $s stop > /dev/null 2>&1 || : ; done; for s in %*; do /sbin/chkconfig --del $s; done; fi
147
%endif
Mattias Ellert's avatar
Mattias Ellert committed
148
%endif
149
150

# Enable a service
Mattias Ellert's avatar
Mattias Ellert committed
151
152
153
%if %{use_systemd}
%define enable_service() %{expand:%%systemd_post %(sed 's/[^ ]*/&.service/g' <<< '%{?*}')}
%else
154
%if %{?suse_version:1}%{!?suse_version:0}
Anders Waananen's avatar
Anders Waananen committed
155
%define enable_service() %{expand:%%fillup_and_insserv -f %{?*}}
156
%else
Anders Waananen's avatar
Anders Waananen committed
157
%define enable_service() for s in %{?*}; do /sbin/chkconfig --add $s ; done
158
%endif
Mattias Ellert's avatar
Mattias Ellert committed
159
%endif
160
161

# Conditionally restart service on package update
Mattias Ellert's avatar
Mattias Ellert committed
162
163
164
%if %{use_systemd}
%define condrestart_on_update() %{expand:%%systemd_postun_with_restart %(sed 's/[^ ]*/&.service/g' <<< '%{?*}')}
%else
165
%if %{?suse_version:1}%{!?suse_version:0}
Anders Waananen's avatar
Anders Waananen committed
166
%define condrestart_on_update() %{expand:%%restart_on_update %{?*}} %{expand:%%insserv_cleanup}
167
%else
Anders Waananen's avatar
Anders Waananen committed
168
%define condrestart_on_update() if [ $1 -ge 1 ]; then for s in %{?*}; do service $s condrestart > /dev/null 2>&1 || : ; done; fi
169
%endif
Mattias Ellert's avatar
Mattias Ellert committed
170
%endif
171
172

# Standard service requirements
Mattias Ellert's avatar
Mattias Ellert committed
173
%if %{use_systemd}
174
175
176
%define service_post_requires	systemd-units
%define service_preun_requires	systemd-units
%define service_postun_requires	systemd-units
Mattias Ellert's avatar
Mattias Ellert committed
177
%else
178
%if %{?suse_version:1}%{!?suse_version:0}
179
180
181
%define service_post_requires	%{insserv_prereq}
%define service_preun_requires	%{insserv_prereq}
%define service_postun_requires	%{insserv_prereq}
182
%else
183
184
185
%define service_post_requires	chkconfig
%define service_preun_requires	chkconfig, initscripts
%define service_postun_requires	initscripts
186
%endif
Mattias Ellert's avatar
Mattias Ellert committed
187
%endif
188

189
190
191
192
193
194
195
196
197
198
199
Name:		@PACKAGE@
Version:	@baseversion@
Release:	@fedorarelease@%{?dist}
Summary:	Advanced Resource Connector Grid Middleware
Group:		System Environment/Daemons
License:	ASL 2.0
URL:		http://www.nordugrid.org/
Source:		http://download.nordugrid.org/packages/%{name}/releases/%{version}@preversion@/src/%{name}-%{version}@preversion@.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

#		Packages dropped without replacements
Mattias Ellert's avatar
Mattias Ellert committed
200
201
202
203
204
205
206
207
Obsoletes:	%{name}-chelonia < 2.0.0
Obsoletes:	%{name}-hopi < 2.0.0
Obsoletes:	%{name}-isis < 2.0.0
Obsoletes:	%{name}-janitor < 2.0.0
Obsoletes:	%{name}-doxygen < 4.0.0
%if ! %{with_canl}
Obsoletes:	%{name}-arcproxyalt < %{version}-%{release}
%endif
Mattias Ellert's avatar
Mattias Ellert committed
208
Obsoletes:	%{name}-java < 6.0.0
Mattias Ellert's avatar
Mattias Ellert committed
209
Obsoletes:	%{name}-egiis < 6.0.0
210

Mattias Ellert's avatar
Mattias Ellert committed
211
BuildRequires:	gcc-c++
212
213
BuildRequires:	cppunit-devel
BuildRequires:	pkgconfig
Anders Waananen's avatar
Anders Waananen committed
214
%if %{?fedora}%{!?fedora:0} >= 12 || %{?rhel}%{!?rhel:0} >= 6 || %{?suse_version:1}%{!?suse_version:0}
215
BuildRequires:	libuuid-devel
216
%else
217
BuildRequires:	e2fsprogs-devel
218
%endif
219
BuildRequires:	gettext
Maiken's avatar
Maiken committed
220
BuildRequires:	python2-devel
221
%if %{?fedora}%{!?fedora:0} >= 13 || %{?rhel}%{!?rhel:0} >= 8
222
223
BuildRequires:	python3-devel
%endif
224
225
226
%if %{?rhel}%{!?rhel:0} == 7
BuildRequires:	python34-devel
%endif
227
228
229
%if %{with_pylint}
BuildRequires:	pylint
%endif
230
BuildRequires:	%{glibmm2_devel}
231
232
233
234
BuildRequires:	glib2-devel
BuildRequires:	libxml2-devel
BuildRequires:	openssl
BuildRequires:	openssl-devel
235
%if %{with_xmlsec1}
236
237
BuildRequires:	xmlsec1-devel >= 1.2.4
BuildRequires:	xmlsec1-openssl-devel >= 1.2.4
Anders Waananen's avatar
Anders Waananen committed
238
%endif
239
240
BuildRequires:	%{nss_devel}
BuildRequires:	%{openldap_devel}
241
242
243
BuildRequires:	globus-common-devel
BuildRequires:	globus-ftp-client-devel
BuildRequires:	globus-ftp-control-devel
244
245
246
247
248
%if %{?fedora}%{!?fedora:0} >= 23 || %{?rhel}%{!?rhel:0} >= 5
BuildRequires:	globus-gssapi-gsi-devel >= 12.2
%else
BuildRequires:	globus-gssapi-gsi-devel < 12.2
%endif
249
250
251
%if %{with_canl}
BuildRequires:	canl-c++-devel
%endif
Anders Waananen's avatar
Anders Waananen committed
252
%if %{with_xrootd}
Mattias Ellert's avatar
Mattias Ellert committed
253
%if %{?fedora}%{!?fedora:0} >= 17 || %{?rhel}%{!?rhel:0} >= 5
Mattias Ellert's avatar
Mattias Ellert committed
254
255
BuildRequires:	xrootd-client-devel
%else
256
BuildRequires:	xrootd-devel
Anders Waananen's avatar
Anders Waananen committed
257
%endif
Mattias Ellert's avatar
Mattias Ellert committed
258
%endif
259
%if %{with_gfal}
260
BuildRequires:	gfal2-devel
261
%endif
David Cameron's avatar
David Cameron committed
262
%if %{with_s3}
263
BuildRequires:	libs3-devel
David Cameron's avatar
David Cameron committed
264
%endif
Anders Waananen's avatar
Anders Waananen committed
265
%if %{?suse_version}%{!?suse_version:0} == 1110
Anders Waananen's avatar
Anders Waananen committed
266
BuildRequires:	db43-devel
Anders Waananen's avatar
Anders Waananen committed
267
%else
Mattias Ellert's avatar
Mattias Ellert committed
268
%if %{?fedora}%{!?fedora:0} >= 15 || %{?rhel}%{!?rhel:0} >= 7
Mattias Ellert's avatar
Mattias Ellert committed
269
270
BuildRequires:	libdb-cxx-devel
%else
Mattias Ellert's avatar
Mattias Ellert committed
271
272
273
%if %{?fedora}%{!?fedora:0} == 14
BuildRequires:	libdb-devel
%else
274
BuildRequires:	db4-devel
Anders Waananen's avatar
Anders Waananen committed
275
%endif
Mattias Ellert's avatar
Mattias Ellert committed
276
%endif
Mattias Ellert's avatar
Mattias Ellert committed
277
%endif
278
279
# Needed for Boinc backend testing during make check
BuildRequires:	perl(DBI)
280
# Needed for infoprovider testing during make check
281
BuildRequires:	perl(JSON::XS)
Anders Waananen's avatar
Anders Waananen committed
282
BuildRequires:	perl(XML::Simple)
283
# Needed for LRMS testing during make check
284
285
BuildRequires:	perl(Test::Harness)
BuildRequires:	perl(Test::Simple)
286
# Needed to run ACIX unit tests
287
%if %{with_acix}
288
289
290
291
%if %{py3default}
BuildRequires:	python3-twisted
BuildRequires:	python3-pyOpenSSL
%else
292
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8 || %{?suse_version:1}%{!?suse_version:0}
Anders Waananen's avatar
Anders Waananen committed
293
294
BuildRequires:	python-twisted
%else
295
296
BuildRequires:	python-twisted-core
BuildRequires:	python-twisted-web
297
%endif
Anders Waananen's avatar
Anders Waananen committed
298
299
300
%if %{?suse_version:1}%{!?suse_version:0}
BuildRequires:	python-openssl
%else
301
BuildRequires:	pyOpenSSL
Anders Waananen's avatar
Anders Waananen committed
302
%endif
303
%endif
Anders Waananen's avatar
Anders Waananen committed
304
%endif
305
BuildRequires:	swig
306
%if %{?fedora}%{!?fedora:0} >= 4 || %{?rhel}%{!?rhel:0} >= 5
307
BuildRequires:	libtool-ltdl-devel
308
%else
309
BuildRequires:	libtool
310
%endif
311
%if %{with_pythonlrms}
312
313
BuildRequires:	perl(Inline)
BuildRequires:	perl(Inline::Python)
314
%endif
315
%if %{with_sqlite}
Anders Waananen's avatar
Anders Waananen committed
316
BuildRequires:	sqlite-devel >= 3.6
317
%endif
318
%if %{with_ldns}
319
BuildRequires:	ldns-devel >= 1.6.8
320
%endif
321
322
323
324
%if %{?fedora}%{!?fedora:0} <= 13 && %{?rhel}%{!?rhel:0} <= 6
BuildRequires:	python-argparse
Requires:	python-argparse
%endif
325
326

%description
327
328
329
330
331
332
333
334
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

The Advanced Resource Connector (ARC) brings computing resources
together across institutional boundaries. This concept is commonly
referred to as a "computational grid". Historically, grids address the
organization of distributed storage of data and parallel computation,
335
but could be expanded to arbitrary services.
336
337
338
339
340
341

Just like the web, ARC has its roots in the IT infrastructure that was
erected to analyze the experiments for high energy physics at CERN.
The first release, ARC-0.x, was dependent on Globus, the current
release keeps that compatibility but can also be used independently.

342
%package client
343
344
345
346
Summary:	ARC command line interface
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}
347
348

%description client
349
350
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
351
Connector (ARC).
352

353
354
355
356
For the regular user of any ARC-based computational grid,
this client package contains (or depends on) all packages
that are needed to submit jobs, query their status and
retrieve results.
357

358
359
360
361
362
363
364
365
366
367
368
369
370
371
%if %{with_canl}
%package arcproxyalt
Summary:	ARC proxy client based on canl
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}

%description arcproxyalt
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package includes a preview of the arcproxy command based on canl.
%endif

372
%package hed
373
374
375
376
Summary:	ARC Hosting Environment Daemon
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}

377
378
379
Requires(post):		%{service_post_requires}
Requires(preun):	%{service_preun_requires}
Requires(postun):	%{service_postun_requires}
380

381
%description hed
382
383
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
384
Connector (ARC).
385

386
387
The ARC Hosting Environment Daemon (HED). This daemon is a container for
ARC services.
388

Mattias Ellert's avatar
Mattias Ellert committed
389
%package gridftpd
390
391
392
393
394
Summary:	ARC gridftp server
Group:		System Environment/Daemons
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-plugins-globus

395
396
397
Requires(post):		%{service_post_requires}
Requires(preun):	%{service_preun_requires}
Requires(postun):	%{service_postun_requires}
398

Mattias Ellert's avatar
Mattias Ellert committed
399
%description gridftpd
400
401
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
402
403
404
405
406
407
Connector (ARC).

This package contains the ARC gridftp server which has a plugin framework.
Current plugins include:

  fileplugin : Standard gridftp server based on Globus globus-ftp-control
Aleksandr Konstantinov's avatar
Aleksandr Konstantinov committed
408
  jobsplugin : Classical ARC job submission interface
409

410
%package datadelivery-service
411
412
413
414
415
Summary:	ARC data delivery service
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-hed = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}
416

417
418
419
Requires(post):		%{service_post_requires}
Requires(preun):	%{service_preun_requires}
Requires(postun):	%{service_postun_requires}
420
421
422
423
424
425
426
427

%description datadelivery-service
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the ARC data delivery service.

428
%package infosys-ldap
429
430
431
432
433
Summary:	ARC local information system
Group:		System Environment/Libraries
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
BuildArch:	noarch
%endif
434
Requires:	openldap-servers
Mattias Ellert's avatar
Mattias Ellert committed
435
Requires:	glue-schema >= 2.0.10
436
Requires:	bdii
Mattias Ellert's avatar
Mattias Ellert committed
437
438
Provides:	%{name}-ldap-infosys = %{version}-%{release}
Obsoletes:	%{name}-ldap-infosys < 6.0.0
439
440
Provides:	%{name}-aris = %{version}-%{release}
Obsoletes:	%{name}-aris < 6.0.0
441

442
443
444
Requires(post):		%{service_post_requires}
Requires(preun):	%{service_preun_requires}
Requires(postun):	%{service_postun_requires}
445

446
447
448
449
%if %{?fedora}%{!?fedora:0} >= 23 || %{?rhel}%{!?rhel:0} >= 8
Requires(post):		policycoreutils-python-utils
Requires(postun):	policycoreutils-python-utils
%else
450
451
452
%if %{?fedora}%{!?fedora:0} >= 11 || %{?rhel}%{!?rhel:0} >= 6
Requires(post):		policycoreutils-python
Requires(postun):	policycoreutils-python
453
454
455
456
457
%else
%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5
Requires(post):		policycoreutils
Requires(postun):	policycoreutils
%endif
458
459
460
%endif
%endif

461
%description infosys-ldap
462
463
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Mattias Ellert's avatar
Mattias Ellert committed
464
465
466
Connector (ARC).

This package contains the LDAP based information system for ARC.
467
468
This package is not self-contained but is closely connected to
nordugrid-arc-arex.
469

470
%package monitor
471
472
473
474
475
476
Summary:	ARC LDAP monitor service
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:	php
Requires:	php-gd
Requires:	php-ldap
Mattias Ellert's avatar
Mattias Ellert committed
477
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
478
BuildArch:	noarch
Mattias Ellert's avatar
Mattias Ellert committed
479
%endif
Mattias Ellert's avatar
Mattias Ellert committed
480
481
Obsoletes:	%{name}-ldap-monitor < 6.0.0
Obsoletes:	%{name}-ws-monitor < 6.0.0
482

483
%description monitor
484
485
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
486
487
488
489
Connector (ARC).

This package contains the LDAP monitor system for ARC.
This package is self-contained. It is used to set up a web-based monitor
490
491
which pulls information from the information system and displays it in a
readable manner.
492

493
%package arex
494
495
496
497
498
Summary:	ARC Remote EXecution service
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-hed = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}
Mattias Ellert's avatar
Mattias Ellert committed
499
%if %{with_python}
500
501
502
%if %{py3default}
Requires:	python3-%{name} = %{version}-%{release}
%else
503
Requires:	python2-%{name} = %{version}-%{release}
Mattias Ellert's avatar
Mattias Ellert committed
504
%endif
505
%endif
506
Requires:	perl(JSON::XS)
507
Requires:	perl(XML::Simple)
508
509
510
511
512
513
%if %{py3default}
Requires:	python3-stomppy
Requires:	python3-ldap
Requires:	python3-dirq
Requires:	python3-isodate
%else
514
515
516
%if %{?fedora}%{!?fedora:0} >= 26 || %{?rhel}%{!?rhel:0} >= 8
Requires:	python2-stomppy
%else
517
Requires:	stomppy
518
%endif
Anders Waananen's avatar
Anders Waananen committed
519
520
Requires:	python-ldap
Requires:	python-dirq
521
Requires:	python-isodate
522
%endif
523
524
525
526
Provides:	%{name}-cache-service = %{version}-%{release}
Obsoletes:	%{name}-cache-service < 6.0.0
Provides:	%{name}-candypond = %{version}-%{release}
Obsoletes:	%{name}-candypond < 6.0.0
527

528
529
530
Requires(post):		%{service_post_requires}
Requires(preun):	%{service_preun_requires}
Requires(postun):	%{service_postun_requires}
531

532
%description arex
533
534
535
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).
536

537
538
The ARC Remote EXecution service (AREX) provides a service for the
execution of compute jobs and the transfer of input or output data.
539

540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
%if %{with_pythonlrms}
%package arex-python-lrms
Summary:	ARC Remote EXecution service - Python LRMS backends
Group:		System Environment/Libraries
Requires:	%{name}-arex = %{version}-%{release}
Requires:	perl(Inline)
Requires:	perl(Inline::Python)

%description arex-python-lrms
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

The Python LRMS backends are a new implementation of the AREX LRMS
backend scripts written in Python as an alternative to the traditional
Perl implementation. It is released as a technology preview.
%endif

558
%package plugins-needed
559
560
561
Summary:	ARC base plugins
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
562

563
%description plugins-needed
564
565
566
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).
567

568
ARC base plugins. This includes the Message Chain Components (MCCs) and
569
570
Data Manager Components (DMCs).

571
%package plugins-globus
572
573
574
Summary:	ARC Globus plugins
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
575
576
577
578
579
%if %{?fedora}%{!?fedora:0} >= 23 || %{?rhel}%{!?rhel:0} >= 5
Requires:	globus-gssapi-gsi >= 12.2
%else
Requires:	globus-gssapi-gsi < 12.2
%endif
580
581

%description plugins-globus
582
583
584
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).
585

586
ARC Globus plugins. This includes the Globus dependent Data Manager
587
Components (DMCs).
588

589
590
%if %{with_xrootd}
%package plugins-xrootd
591
592
593
Summary:	ARC xrootd plugins
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
594
595
596
597
598
599
600
601
602

%description plugins-xrootd
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

ARC xrootd plugins. These allow access to data through the xrootd protocol.
%endif

603
604
%if %{with_gfal}
%package plugins-gfal
605
Summary:	ARC GFAL plugins
606
607
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
608
609
610
611
612
613
614
615
616
617
618

%description plugins-gfal
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

ARC plugins for GFAL2. This allows third-party transfer and adds support
for several extra transfer protocols (rfio, dcap, gsidcap). Specific
protocol support is provided by separate gfal2-plugin packages.
%endif

David Cameron's avatar
David Cameron committed
619
620
%if %{with_s3}
%package plugins-s3
Anders Waananen's avatar
Anders Waananen committed
621
622
623
Summary:	ARC S3 plugins
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
David Cameron's avatar
David Cameron committed
624
625
626
627
628
629
630
631
632

%description plugins-s3
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

ARC plugins for S3. These allow access to data through the S3 protocol.
%endif

633
634
635
636
637
638
639
640
641
642
643
644
645
%package plugins-internal
Summary:	ARC internal plugin
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-arex = %{version}-%{release}

%description plugins-internal
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

The ARC internal plugin.

646
%if %{with_acix}
647
648
649
%package acix-core
Summary:	ARC cache index - core
Group:		System Environment/Libraries
Mattias Ellert's avatar
Mattias Ellert committed
650
651
652
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
BuildArch:	noarch
%endif
653
654
655
656
%if %{py3default}
Requires:	python3-twisted
Requires:	python3-pyOpenSSL
%else
657
658
659
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8 || %{?suse_version:1}%{!?suse_version:0}
Requires:	python-twisted
%else
660
661
Requires:	python-twisted-core
Requires:	python-twisted-web
662
%endif
663
664
665
%if %{?suse_version:1}%{!?suse_version:0}
Requires:	python-openssl
%else
666
Requires:	pyOpenSSL
667
668
%endif
%endif
669
670
671
672
673
674
675
676

%description acix-core
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Core components of the ARC Cache Index (ACIX).

677
678
%package acix-scanner
Summary:	ARC cache index - scanner server
679
Group:		System Environment/Libraries
Mattias Ellert's avatar
Mattias Ellert committed
680
681
682
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
BuildArch:	noarch
%endif
683
Requires:	%{name}-acix-core = %{version}-%{release}
684
Obsoletes:	%{name}-acix-cache < 6.0.0
685

686
687
688
689
Requires(post):		%{service_post_requires}
Requires(preun):	%{service_preun_requires}
Requires(postun):	%{service_postun_requires}

690
%description acix-scanner
691
692
693
694
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

695
Cache scanner component of the ARC Cache Index (ACIX), usually installed
696
697
698
699
700
701
alongside A-REX. This component collects information on the content of
an A-REX cache.

%package acix-index
Summary:	ARC cache index - index server
Group:		System Environment/Libraries
Mattias Ellert's avatar
Mattias Ellert committed
702
703
704
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
BuildArch:	noarch
%endif
705
706
Requires:	%{name}-acix-core = %{version}-%{release}

707
708
709
710
Requires(post):		%{service_post_requires}
Requires(preun):	%{service_preun_requires}
Requires(postun):	%{service_postun_requires}

711
712
713
714
715
716
717
718
719
%description acix-index
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

Index server component of the ARC Cache Index (ACIX), usually installed
independently of any A-REX installation. This component pulls cache content
from cache servers and can be queried by clients for the location of cached
files.
720
%endif
721

722
%package devel
723
724
725
Summary:	ARC development files
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}
726
Requires:	%{glibmm2_devel}
727
728
729
Requires:	glib2-devel
Requires:	libxml2-devel
Requires:	openssl-devel
730
731

%description devel
732
733
734
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).
735

736
Header files and libraries needed to develop applications using ARC.
737

738
%if %{with_python}
739
%package -n python2-%{name}
740
Summary:	ARC Python 2 wrapper
741
Group:		Development/Libraries
742
743
744
%{?python_provide:%python_provide python2-%{name}}
Provides:	%{name}-python = %{version}-%{release}
Obsoletes:	%{name}-python < 5.3.3
745
Requires:	%{name} = %{version}-%{release}
746

747
%description -n python2-%{name}
748
749
750
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).
751

752
Python 2 bindings for ARC.
753
%endif
754

755
756
757
%if %{?fedora}%{!?fedora:0} >= 13 || %{?rhel}%{!?rhel:0} >= 7
%package -n python%{python3_pkgversion}-%{name}
Summary:	ARC Python 3 wrapper
758
Group:		Development/Libraries
759
760
761
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
Provides:	%{name}-python%{python3_pkgversion} = %{version}-%{release}
Obsoletes:	%{name}-python%{python3_pkgversion} < 5.3.3
762
Requires:	%{name} = %{version}-%{release}
763

764
%description -n python%{python3_pkgversion}-%{name}
765
766
767
768
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

769
Python 3 bindings for ARC.
770
771
%endif

772
773
%package nordugridmap
Summary:	The nordugridmap authorization tool
774
775
Group:		Applications/Internet
Requires:	perl(Crypt::SSLeay)
776
777
Requires:	perl(SOAP::Lite)
Requires:	perl(Crypt::OpenSSL::X509)
778
Obsoletes:	%{name}-gridmap-utils < 6.0.0
Mattias Ellert's avatar
Mattias Ellert committed
779
Requires:	crontabs
780
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
781
BuildArch:	noarch
782
783
%endif

784
%description nordugridmap
785
786
787
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).
788
789

A prominent tool distributed in this package is the nordugridmap
790
script to collect user information from the virtual organizations.
791

792
793
%package test-utils
Summary:	ARC test tools
794
795
796
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-plugins-needed = %{version}-%{release}
797
Obsoletes:	%{name}-misc-utils < 6.0.0
798

799
%description test-utils
800
801
802
803
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

804
This package contains utilities for various tasks including testing. The
Martin Skou Andersen's avatar
+ 'is'.    
Martin Skou Andersen committed
805
package is usually not required by users or sysadmins but is mainly for
806
807
developers.

Mattias Ellert's avatar
Mattias Ellert committed
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
%package archery-manage
Summary:	Archery administration
Group:		Applications/Internet
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
BuildArch:	noarch
%endif

%description archery-manage
NorduGrid is a collaboration aiming at development, maintenance and
support of the free Grid middleware, known as the Advanced Resource
Connector (ARC).

This package contains the archery-manage utility for administration of
an archery information system.

823
%prep
824
%setup @fedorasetupopts@
825
826

%build
827
828
829
830
831
832
if pkg-config --atleast-version 2.6 sigc++-2.0 ; then
  if [ `echo __GNUC__ | gcc -E - | tail -1` -lt 6 ] ; then
    # Workaround for too new libsigc++/glibmm, too old gcc combination
    export CXXFLAGS="%{optflags} -std=c++11"
  fi
fi
833

Mattias Ellert's avatar
Mattias Ellert committed
834
%configure --disable-static \
835
%if ! %{with_python}
Mattias Ellert's avatar
Mattias Ellert committed
836
     --disable-swig-python \
837
838
%endif
%if ! %{with_acix}
839
     --disable-acix \
840
%endif
841
842
843
%if %{with_gfal}
     --enable-gfal \
%endif
David Cameron's avatar
David Cameron committed
844
845
846
%if %{with_s3}
     --enable-s3 \
%endif
847
     --with-python=%{__defpython} \
848
%if %{?fedora}%{!?fedora:0} >= 13 || %{?rhel}%{!?rhel:0} >= 7
849
     --with-altpython=%{__altpython} \
Mattias Ellert's avatar
Mattias Ellert committed
850
%endif
851
852
853
%if %{with_canl}
     --enable-canlxx \
%endif
Anders Waananen's avatar
Anders Waananen committed
854
%if ! %{with_xrootd}
855
     --disable-xrootd \
Anders Waananen's avatar
Anders Waananen committed
856
%endif
857
858
859
%if %{with_pythonlrms}
     --with-inline-python \
%endif
860
%if %{with_sqlite}
861
     --enable-sqlite \
Mattias Ellert's avatar
Mattias Ellert committed
862
%endif
863
864
865
%if ! %{with_ldns}
    --disable-ldns \
%endif
866
    --enable-internal \
Mattias Ellert's avatar
Mattias Ellert committed
867
868
%if %{use_systemd}
     --with-systemd-units-location=%{_unitdir} \
869
%endif
870
     --disable-doc \
871
     --with-docdir=%{_pkgdocdir}
Mattias Ellert's avatar
Mattias Ellert committed
872

873
make %{?_smp_mflags}
Anders Waananen's avatar
Anders Waananen committed
874
875

%check
876
make check
877
878
879

%install
rm -rf $RPM_BUILD_ROOT
880

881
make install DESTDIR=$RPM_BUILD_ROOT
882

883
# Install Logrotate.
884
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
Mattias Ellert's avatar
Mattias Ellert committed
885
886
887
888
install -p -m 644 debian/%{name}-arex.logrotate \
    $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}-arex
install -p -m 644 debian/%{name}-gridftpd.logrotate \
    $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}-gridftpd
889
890
install -p -m 644 debian/%{name}-infosys-ldap.logrotate \
    $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}-infosys-ldap
891
892
install -p -m 644 debian/%{name}-datadelivery-service.logrotate \
    $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}-datadelivery-service
893

894
find $RPM_BUILD_ROOT -type f -name \*.la -exec rm -fv '{}' ';'
895

Mattias Ellert's avatar
Mattias Ellert committed
896
897
898
899
900
# The py-compile script in the source tarball is old (RHEL 6)
# It does the wrong thing for python 3 - remove and let rpmbuild do it right
find $RPM_BUILD_ROOT -type f -name \*.pyc -exec rm -fv '{}' ';'
find $RPM_BUILD_ROOT -type f -name \*.pyo -exec rm -fv '{}' ';'

901
# libarcglobusutils is not part of the ARC api.
902
find $RPM_BUILD_ROOT -name libarcglobusutils.so -exec rm -fv '{}' ';'
903

904
905
906
# Create log directory
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/arc

907
908
909
910
# Create spool directories for Jura
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/arc
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/arc/ssm
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/arc/urs
911
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/arc/jura/archive
912

Mattias Ellert's avatar
Mattias Ellert committed
913
%find_lang %{name}
914

915
# Remove examples and let RPM package them under /usr/share/doc using the doc macro
916
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{pkgdir}/examples
917
918
919
920
921
922
make -C src/libs/data-staging/examples	DESTDIR=$PWD/docdir/devel  pkgdatadir= install-exampleDATA
make -C src/hed/libs/compute/examples	DESTDIR=$PWD/docdir/devel  pkgdatadir= install-exampleDATA
make -C src/hed/libs/data/examples	DESTDIR=$PWD/docdir/devel  pkgdatadir= install-exampleDATA
make -C src/hed/acc/PythonBroker	DESTDIR=$PWD/docdir/python pkgdatadir= install-exampleDATA
make -C python/examples			DESTDIR=$PWD/docdir/python pkgdatadir= install-exampleDATA
make -C src/clients			DESTDIR=$PWD/docdir/client pkgdatadir= install-exampleDATA
Mattias Ellert's avatar
Mattias Ellert committed
923
924
make -C src/tests/echo			DESTDIR=$PWD/docdir/hed	   pkgdatadir= install-exampleDATA
make -C src/hed				DESTDIR=$PWD/docdir/hed	   pkgdatadir= install-profileDATA
925

926
927
928
%clean
rm -rf $RPM_BUILD_ROOT

Anders Waananen's avatar
Anders Waananen committed
929
930
931
932
%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

Mattias Ellert's avatar
Mattias Ellert committed
933
934
935
936
%post plugins-globus -p /sbin/ldconfig

%postun plugins-globus -p /sbin/ldconfig

937
%post hed
938
%enable_service arched
Anders Waananen's avatar
Anders Waananen committed
939

940
%preun hed
941
%stop_on_removal arched
Anders Waananen's avatar
Anders Waananen committed
942

943
%postun hed
944
%condrestart_on_update arched
Anders Waananen's avatar
Anders Waananen committed
945

946
%post arex
947
%enable_service arc-arex
Andrii Salnikov's avatar
Andrii Salnikov committed
948

949
# out-of-package testing host certificate
950
951
952
953
if [ $1 -eq 1 ]; then
  arcctl test-ca init
  arcctl test-ca hostcert
fi
954
955

%preun arex
956
%stop_on_removal arc-arex
957
958

%postun arex
959
%condrestart_on_update arc-arex
960

961
%post gridftpd
962
%enable_service arc-gridftpd
963
964

%preun gridftpd
965
%stop_on_removal arc-gridftpd
966
967

%postun gridftpd
968
%condrestart_on_update arc-gridftpd
969

970
%post datadelivery-service
971
%enable_service arc-datadelivery-service
972
973

%preun datadelivery-service
974
%stop_on_removal arc-datadelivery-service
975
976

%postun datadelivery-service
977
%condrestart_on_update arc-datadelivery-service
978

979
980
%post infosys-ldap
%enable_service arc-infosys-ldap
Anders Waananen's avatar
Anders Waananen committed
981

982
%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5
Mattias Ellert's avatar
Mattias Ellert committed
983
984
semanage port -a -t ldap_port_t -p tcp 2135 2>/dev/null || :
semanage fcontext -a -t slapd_etc_t "/var/run/arc/infosys/bdii-slapd\.conf" 2>/dev/null || :
Mattias Ellert's avatar
Mattias Ellert committed
985
986
semanage fcontext -a -t slapd_db_t "/var/lib/arc/bdii/db(/.*)?" 2>/dev/null || :
semanage fcontext -a -t slapd_var_run_t "/var/run/arc/bdii/db(/.*)?" 2>/dev/null || :
987
%endif
988

989
990
%preun infosys-ldap
%stop_on_removal arc-infosys-ldap
991

992
993
%postun infosys-ldap
%condrestart_on_update arc-infosys-ldap
Anders Waananen's avatar
Anders Waananen committed
994

995
996
%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5
if [ $1 -eq 0 ]; then
Mattias Ellert's avatar
Mattias Ellert committed
997
998
  semanage port -d -t ldap_port_t -p tcp 2135 2>/dev/null || :
  semanage fcontext -d -t slapd_etc_t "/var/run/arc/infosys/bdii-slapd\.conf" 2>/dev/null || :
Mattias Ellert's avatar
Mattias Ellert committed
999
1000
  semanage fcontext -d -t slapd_db_t "/var/lib/arc/bdii/db(/.*)?" 2>/dev/null || :
  semanage fcontext -d -t slapd_var_run_t "/var/run/arc/bdii/db(/.*)?" 2>/dev/null || :
1001
1002
fi
%endif
1003

1004
%triggerun infosys-ldap -- bdii
1005
1006
%if %{?suse_version:1}%{!?suse_version:0}
FIRST_ARG=1
1007
%restart_on_update arc-infosys-ldap
1008
%else
1009
service arc-infosys-ldap condrestart > /dev/null 2>&1 || :
1010
1011
%endif

1012
%if %{with_acix}
1013
1014
%post acix-scanner
%enable_service arc-acix-scanner
1015

1016
1017
%preun acix-scanner
%stop_on_removal arc-acix-scanner
1018

1019
1020
%postun acix-scanner
%condrestart_on_update arc-acix-scanner
1021
1022

%post acix-index
1023
%enable_service arc-acix-index
1024
1025

%preun acix-index
1026
%stop_on_removal arc-acix-index
1027
1028

%postun acix-index
1029
%condrestart_on_update arc-acix-index
1030
%endif
1031

Mattias Ellert's avatar
Mattias Ellert committed
1032
%files -f %{name}.lang
1033
%defattr(-,root,root,-)