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

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

158
159
160
%post selinux
if [ "$1" -le "1" ] ; then # First install
semanage port -a -t http_port_t -p tcp 8446
161
162
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_setrlimit=1
163
164
semanage fcontext -a -t httpd_log_t "/var/log/fts3rest(/.*)?"
restorecon -R /var/log/fts3rest/
165
166
167
168
169
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
170
setsebool -P httpd_can_network_connect=0
171
setsebool -P httpd_setrlimit=0
172
173
fi

174
%prep
175
%setup -q
176
177

%build
178
179
180
181
182
# 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
183
    echo "The version in the spec file does not match the api.py version!"
184
185
186
187
    echo "$fts_api_ver != %{version}"
    exit 1
fi

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

190
191
make %{?_smp_mflags}

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

204
205
206
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}
207
%if %{?rhel}%{!?rhel:0} == 6
208
rm -rf %{buildroot}/%{_prefix}/lib/firewalld/services/fts3rest.xml
209
%endif
ayllon's avatar
ayllon committed
210
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
211
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
212

213

Michal Simon's avatar
Michal Simon committed
214
cp --preserve=timestamps -r src/fts3 %{buildroot}/%{python_sitelib}
215
216
217
218
219
220
221
222
223
224
225
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
226
%files 
227

228
229
230
231
232
233
234
235
236
237
238
239
240
%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*
241
%{python_sitelib}/fts3rest/controllers/autocomplete.py*
242
%{python_sitelib}/fts3rest/controllers/banning.py*
243
%{python_sitelib}/fts3rest/controllers/config/*.py*
244
245
246
247
%{python_sitelib}/fts3rest/controllers/datamanagement.py*
%{python_sitelib}/fts3rest/controllers/delegation.py*
%{python_sitelib}/fts3rest/controllers/error.py*
%{python_sitelib}/fts3rest/controllers/__init__.py*
248
%{python_sitelib}/fts3rest/controllers/files.py*
249
250
%{python_sitelib}/fts3rest/controllers/jobs.py*
%{python_sitelib}/fts3rest/controllers/optimizer.py*
251
%{python_sitelib}/fts3rest/controllers/serverstatus.py*
252
253
254
255
256

%{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*
257
%{python_sitelib}/fts3rest/lib/heartbeat.py*
258
259
260
%{python_sitelib}/fts3rest/lib/helpers/
%{python_sitelib}/fts3rest/lib/http_exceptions.py*
%{python_sitelib}/fts3rest/lib/__init__.py*
261
%{python_sitelib}/fts3rest/lib/JobBuilder.py*
262
263
264
%{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
265
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/ssl.py*
266
267
268
269
%{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*
270
271
272
273
274

%{python_sitelib}/fts3rest/model/

%{python_sitelib}/fts3rest/public/
%{python_sitelib}/fts3rest/templates/delegation.html
275
%{python_sitelib}/fts3rest/templates/config/
276

277
278
279
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
280
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
281
282
%dir %attr(0755,fts3,fts3) %{_var}/cache/fts3rest
%dir %attr(0755,fts3,fts3) %{_var}/log/fts3rest
Michal Simon's avatar
Michal Simon committed
283
284
285
%doc docs/README.md
%doc docs/install.md
%doc docs/api.md
286

Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
287
%if %{?rhel}%{!?rhel:0} >= 7
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
288
%files firewalld
289
%config(noreplace) %{_prefix}/lib/firewalld/services/fts3rest.xml
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
290
%endif
291

292
293
294
295
296
297
298
299
300
301
302
303
304
%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
305
%{python_sitelib}/fts3rest/templates/app_register.html
306
307
308
%{python_sitelib}/fts3rest/templates/apps.html
%{python_sitelib}/fts3rest/templates/authz_confirm.html
%{python_sitelib}/fts3rest/templates/authz_failure.html
309
%{python_sitelib}/fts3rest/templates/authz_noredirect.html
310

311
312
313
%files http-authz-signed-cert
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/http.py*

ayllon's avatar
ayllon committed
314
315
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
316
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
317
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
318

319
320
%files selinux

Michal Simon's avatar
Michal Simon committed
321
322
%files -n python-fts
%{python_sitelib}/fts3
323
%{python_sitelib}/fts3.egg-info
Michal Simon's avatar
Michal Simon committed
324
325
%doc LICENSE

326
327


328
%changelog
Andrea Manzi's avatar
Andrea Manzi committed
329
330
331
* Thu Feb 21 2019 Andrea Manzi <amanzi@cern.ch> - 3.8.3-1
- New bugfix release

Andrea Manzi's avatar
Andrea Manzi committed
332
333
334
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
* 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

370
371
* Tue Apr 19 2016 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.4.0-1
- Update for new upstream release
372

373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
* 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
389
390
- First EPEL release

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

394
395
396
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

403
404
405
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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