fts-rest.spec 12.7 KB
Newer Older
1
2
3
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")}

4
5
%{!?nosetest_path: %global nosetest_path "/tmp"}

6
Name:           fts-rest
7
Version:        3.8.3
Andrea Manzi's avatar
Andrea Manzi committed
8
Release:        1%{?dist}
9
10
11
12
BuildArch:      noarch
Summary:        FTS3 Rest Interface
Group:          Applications/Internet
License:        ASL 2.0
13
URL:            http://fts3-service.web.cern.ch/
Andrea Manzi's avatar
Andrea Manzi committed
14
15
16
# git clone https://gitlab.cern.ch/fts/fts-rest.git --depth 1 -b master fts-rest-3.8.1
# cd fts-rest-3.8.1
# git checkout v3.8.1
17
18
# git submodule init && git submodule update
# cd ..
Andrea Manzi's avatar
Andrea Manzi committed
19
# tar vczf fts-rest-3.8.1.tar.gz --exclude-vcs fts-rest-3.8.1
20
Source0:        %{name}-%{version}.tar.gz
21

22
BuildRequires:  gfal2-python
23
BuildRequires:  gfal2-plugin-mock
24
BuildRequires:  cmake
25
BuildRequires:  python-jsonschema
26
%if %{?rhel}%{!?rhel:0} == 6
27
BuildRequires:  python-nose1.1
Michal Simon's avatar
added:    
Michal Simon committed
28
%endif
29
30
31
%if %{?rhel}%{!?rhel:0} >= 7
BuildRequires:  python-nose
%endif
32

root's avatar
.    
root committed
33
BuildRequires:  python-dateutil
34
BuildRequires:  python-pylons
35
BuildRequires:  scipy
Michal Simon's avatar
Michal Simon committed
36
BuildRequires:  m2crypto
37
BuildRequires:  python-mock
38
BuildRequires:  python-m2ext
39
%if %{?rhel}%{!?rhel:0} >= 7
Michal Simon's avatar
Michal Simon committed
40
BuildRequires:  python-sqlalchemy
41
42
43
%else
BuildRequires:  python-sqlalchemy0.8
%endif
44
BuildRequires:  python-requests
45
%if %{?rhel}%{!?rhel:0} == 6
46
BuildRequires:  python-slimit
47
%endif
48
BuildRequires:  pandoc
49
BuildRequires:  python-dirq
50
BuildRequires:  MySQL-python
Michal Simon's avatar
Michal Simon committed
51

52
Requires:       gridsite%{?_isa} >= 1.7
53
54
55
56
%if %{?rhel}%{!?rhel:0} == 6
Requires:       httpd%{?_isa} >= 2.2.15-60
%endif
%if %{?rhel}%{!?rhel:0} >= 7
57
Requires:       httpd%{?_isa}
58
%endif
59
Requires:       mod_wsgi
60
Requires:       python-dirq
61
62
63
Requires:       python-fts = %{version}-%{release}
Requires:       python-paste-deploy
Requires:       python-pylons
64
65
Requires:       python-simplejson%{?_isa}
Requires:       gfal2-python%{?_isa}
66
Requires: 	python-requests
67
68
%description
This package provides the FTS3 REST interface
69
70

%if %{?rhel}%{!?rhel:0} >= 7
71
72
73
74
75
%package firewalld
Summary: FTS3 Rest Firewalld
Group: Applications/Internet

Requires:  firewalld-filesystem
76

77
78
%description firewalld
FTS3 Rest firewalld.
79
%endif
80

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%package cloud-storage
Summary:        FTS3 Rest Cloud Storage extensions
Group:          Applications/Internet

Requires:       fts-rest = %{version}-%{release}

%description cloud-storage
FTS3 Rest Cloud Storage extensions. Includes support for Dropbox

%package oauth2
Summary:        FTS3 Rest OAuth2 provider
Group:          Applications/Internet

Requires:       fts-rest = %{version}-%{release}

%description oauth2
FTS3 Rest OAuth2 provider

99
100
101
102
%package http-authz-signed-cert
Summary:        FTS3 Rest HTTP_AUTHORIZATION signed-cert method
Group:          Application/Internet

103
104
Requires:       python-dateutil
Requires:       python-m2ext
105
106
107
108
109
Requires:       fts-rest = %{version}-%{release}

%description http-authz-signed-cert
FTS3 Rest HTTP_AUTHORIZATION signed-cert method

ayllon's avatar
ayllon committed
110
%package cli
111
112
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
113

Michal Simon's avatar
Michal Simon committed
114
Requires:       python-fts = %{version}-%{release}
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
115
Requires:       python-m2ext
ayllon's avatar
ayllon committed
116
117
118
119

%description cli
Command line utilities for the FTS3 REST interface

120
%package selinux
121
122
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
123

Michal Simon's avatar
Michal Simon committed
124
Requires:       %{name} = %{version}-%{release}
125
126

%description selinux
Michal Simon's avatar
Michal Simon committed
127
SELinux support for fts-rest
128

Michal Simon's avatar
Michal Simon committed
129
130
131
132
133
%package -n python-fts
Summary:        FTS3 database model
Group:          Applications/Internet
Requires:       m2crypto
Requires:       python-pycurl
134
%if %{?rhel}%{!?rhel:0} >= 7
Michal Simon's avatar
Michal Simon committed
135
Requires:       python-sqlalchemy
136
137
138
%else
Requires:       python-sqlalchemy0.8
%endif
Michal Simon's avatar
Michal Simon committed
139
140
141
142

%description -n python-fts
This package provides an object model of the FTS3
database, using sqlalchemy ORM.
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
143
144


145
146
%post
/sbin/service httpd condrestart >/dev/null 2>&1 || :
147
148
149
150
151
if [ "$1" -eq "2" ]; then # Upgrade
    # 3.5.1 needs owner to be fts3, since fts3rest runs as fts3
    chown fts3.fts3 /var/log/fts3rest
    chown fts3.fts3 /var/log/fts3rest/fts3rest.log || true
fi
152

Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
153
%if %{?rhel}%{!?rhel:0} >= 7
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
154
%post firewalld
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
155
156
157
%firewalld_reload
%endif

158
159
160
161
162
163

%postun
if [ "$1" -eq "0" ] ; then
    /sbin/service httpd condrestart >/dev/null 2>&1 || :
fi

164
165
166
%post selinux
if [ "$1" -le "1" ] ; then # First install
semanage port -a -t http_port_t -p tcp 8446
167
168
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_setrlimit=1
169
170
semanage fcontext -a -t httpd_log_t "/var/log/fts3rest(/.*)?"
restorecon -R /var/log/fts3rest/
171
172
173
174
175
fi

%preun selinux
if [ "$1" -lt "1" ] ; then # Final removal
semanage port -d -t http_port_t -p tcp 8446
ayllon's avatar
ayllon committed
176
setsebool -P httpd_can_network_connect=0
177
setsebool -P httpd_setrlimit=0
178
179
fi

180
%prep
181
%setup -q
182
183

%build
184
185
186
187
188
# Make sure the version in the spec file and the version used
# for building matches
fts_api_ver=`awk 'match($0, /^API_VERSION = dict\(major=([0-9]+), minor=([0-9]+), patch=([0-9]+)\)/, m) {print m[1]"."m[2]"."m[3]; }' src/fts3rest/fts3rest/controllers/api.py`
fts_spec_ver=`expr "%{version}" : '\([0-9]*\\.[0-9]*\\.[0-9]*\)'`
if [ "$fts_api_ver" != "$fts_spec_ver" ]; then
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
189
    echo "The version in the spec file does not match the api.py version!"
190
191
192
193
    echo "$fts_api_ver != %{version}"
    exit 1
fi

Michal Simon's avatar
Michal Simon committed
194
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
195

196
197
make %{?_smp_mflags}

198
199
%check
pushd src/fts3rest
200
%if %{?rhel}%{!?rhel:0} == 6
201
PYTHONPATH=../:/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/ \
202
    nosetests1.1 --with-xunit --xunit-file=%{?nosetest_path}/nosetests.xml
Michal Simon's avatar
added:    
Michal Simon committed
203
%endif
204
%if %{?rhel}%{!?rhel:0} >= 7
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
205
PYTHONPATH=../ ./setup_pylons_plugin.py install --user
206
PYTHONPATH=../ nosetests --with-xunit --xunit-file=%{?nosetest_path}/nosetests.xml
207
208
%endif
popd
209

210
211
212
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}
213
%if %{?rhel}%{!?rhel:0} == 6
214
rm -rf %{buildroot}/%{_prefix}/lib/firewalld/services/fts3rest.xml
215
%endif
ayllon's avatar
ayllon committed
216
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
217
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
218

219

Michal Simon's avatar
Michal Simon committed
220
cp --preserve=timestamps -r src/fts3 %{buildroot}/%{python_sitelib}
221
222
223
224
225
226
227
228
229
230
231
cat > %{buildroot}/%{python_sitelib}/fts3.egg-info <<EOF
Metadata-Version: 1.0
Name: fts3
Version: %{version}
Summary: FTS3 Python Libraries.
Home-page: http://fts3-service.web.cern.ch
Author: FTS Developers
Author-email: fts-devel@cern.ch
License: Apache2
EOF

Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
232
%files 
233

234
235
236
237
238
239
240
241
242
243
244
245
246
%dir %{python_sitelib}/fts3rest/

%{python_sitelib}/fts3rest.egg-info/*

%{python_sitelib}/fts3rest/__init__.py*
%{python_sitelib}/fts3rest/websetup.py*

%{python_sitelib}/fts3rest/config/*.py*
%{python_sitelib}/fts3rest/config/routing/__init__.py*
%{python_sitelib}/fts3rest/config/routing/base.py*

%{python_sitelib}/fts3rest/controllers/api.py*
%{python_sitelib}/fts3rest/controllers/archive.py*
247
%{python_sitelib}/fts3rest/controllers/autocomplete.py*
248
%{python_sitelib}/fts3rest/controllers/banning.py*
249
%{python_sitelib}/fts3rest/controllers/config/*.py*
250
251
252
253
%{python_sitelib}/fts3rest/controllers/datamanagement.py*
%{python_sitelib}/fts3rest/controllers/delegation.py*
%{python_sitelib}/fts3rest/controllers/error.py*
%{python_sitelib}/fts3rest/controllers/__init__.py*
254
%{python_sitelib}/fts3rest/controllers/files.py*
255
256
%{python_sitelib}/fts3rest/controllers/jobs.py*
%{python_sitelib}/fts3rest/controllers/optimizer.py*
257
%{python_sitelib}/fts3rest/controllers/serverstatus.py*
258
259
260
261
262

%{python_sitelib}/fts3rest/lib/api/
%{python_sitelib}/fts3rest/lib/app_globals.py*
%{python_sitelib}/fts3rest/lib/base.py*
%{python_sitelib}/fts3rest/lib/gfal2_wrapper.py*
263
%{python_sitelib}/fts3rest/lib/heartbeat.py*
264
265
266
%{python_sitelib}/fts3rest/lib/helpers/
%{python_sitelib}/fts3rest/lib/http_exceptions.py*
%{python_sitelib}/fts3rest/lib/__init__.py*
267
%{python_sitelib}/fts3rest/lib/JobBuilder.py*
268
269
270
%{python_sitelib}/fts3rest/lib/middleware/*.py*
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/*.py*
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/__init__.py*
root's avatar
.    
root committed
271
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/ssl.py*
272
273
274
275
%{python_sitelib}/fts3rest/lib/scheduler/schd.py*
%{python_sitelib}/fts3rest/lib/scheduler/db.py*
%{python_sitelib}/fts3rest/lib/scheduler/Cache.py*
%{python_sitelib}/fts3rest/lib/scheduler/__init__.py*
276
277
278
279
280

%{python_sitelib}/fts3rest/model/

%{python_sitelib}/fts3rest/public/
%{python_sitelib}/fts3rest/templates/delegation.html
281
%{python_sitelib}/fts3rest/templates/config/
282

283
284
285
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
286
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
287
288
%dir %attr(0755,fts3,fts3) %{_var}/cache/fts3rest
%dir %attr(0755,fts3,fts3) %{_var}/log/fts3rest
Michal Simon's avatar
Michal Simon committed
289
290
291
%doc docs/README.md
%doc docs/install.md
%doc docs/api.md
292

Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
293
%if %{?rhel}%{!?rhel:0} >= 7
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
294
%files firewalld
295
%config(noreplace) %{_prefix}/lib/firewalld/services/fts3rest.xml
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
296
%endif
297

298
299
300
301
302
303
304
305
306
307
308
309
310
%files cloud-storage
%{python_sitelib}/fts3rest/config/routing/cstorage.py*
%{python_sitelib}/fts3rest/controllers/cloudStorage.py*
%{python_sitelib}/fts3rest/controllers/CSdropbox.py*
%{python_sitelib}/fts3rest/controllers/CSInterface.py*

%files oauth2
%{python_sitelib}/fts3rest/config/routing/oauth2.py*
%{python_sitelib}/fts3rest/controllers/oauth2.py*
%{python_sitelib}/fts3rest/lib/oauth2lib/
%{python_sitelib}/fts3rest/lib/oauth2provider.py*
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/oauth2.py*
%{python_sitelib}/fts3rest/templates/app.html
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
311
%{python_sitelib}/fts3rest/templates/app_register.html
312
313
314
%{python_sitelib}/fts3rest/templates/apps.html
%{python_sitelib}/fts3rest/templates/authz_confirm.html
%{python_sitelib}/fts3rest/templates/authz_failure.html
315
%{python_sitelib}/fts3rest/templates/authz_noredirect.html
316

317
318
319
%files http-authz-signed-cert
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/http.py*

ayllon's avatar
ayllon committed
320
321
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
322
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
323
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
324

325
326
%files selinux

Michal Simon's avatar
Michal Simon committed
327
328
%files -n python-fts
%{python_sitelib}/fts3
329
%{python_sitelib}/fts3.egg-info
Michal Simon's avatar
Michal Simon committed
330
331
%doc LICENSE

332
333


334
%changelog
Andrea Manzi's avatar
Andrea Manzi committed
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
* Thu Jan 10 2019 Andrea Manzi <amanzi@cern.ch> - 3.8.2-1
- New bugfix release

* Tue Oct 16 2018 Andrea Manzi <amanzi@cern.ch> - 3.8.1-1
- New bugfix release

* Mon Sep 24 2018 Andrea Manzi <amanzi@cern.ch> - 3.8.0-1
- New Minor release
- Initial support for Macaroons/Scitokens
- Multihop Scheduler merged into Standard Scheduling system
- AutoSessionReuse support

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
- Python 2 binary package renamed to python2-fts
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.6.3-3
- Python 2 binary package renamed to python2-fts-rest
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Tue Apr 18 2017 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.6.3-1
- Update for new upstream release

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Nov 15 2016 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.5.4-1
- Update for new upstream release

373
374
* Tue Apr 19 2016 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.4.0-1
- Update for new upstream release
375

376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.32-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Mar 13 2015 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.2.32-2
- Missing dependencies

* Fri Mar 13 2015 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.2.32-1
- Update for new upstream release

* Fri Aug 15 2014 Michal Simon <michal.simon@cern.ch> - 3.2.26-2
- Update for new upstream release

* Mon Jun 30 2014 Michal Simon <michal.simon@cern.ch> - 3.2.26-1
Michal Simon's avatar
Michal Simon committed
392
393
- First EPEL release

394
* Tue May 13 2014 Michal Simon <michal.simon@cern.ch> - 3.2.25-1
Michal Simon's avatar
Michal Simon committed
395
396
- Marging fts-rest and python-fts

397
398
399
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

Michal Simon's avatar
Michal Simon committed
400
* Fri Jan 03 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.1.0-1
401
402
- Major and minor versions follow FTS3

ayllon's avatar
ayllon committed
403
404
405
* Tue Aug 13 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.2-2
- Packaging /var/cache/fts3rest

406
407
408
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

409
410
* Thu Mar 21 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-1
- Initial build