fts-rest.spec 11 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
Andrea Manzi's avatar
Andrea Manzi committed
7
8
Version:        3.8.2
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
33
34
%if %{?rhel}%{!?rhel:0} >= 7
BuildRequires:  firewalld-filesystem
%endif
root's avatar
.    
root committed
35
BuildRequires:  python-dateutil
36
BuildRequires:  python-pylons
37
BuildRequires:  scipy
Michal Simon's avatar
Michal Simon committed
38
BuildRequires:  m2crypto
39
BuildRequires:  python-mock
40
BuildRequires:  python-m2ext
41
%if %{?rhel}%{!?rhel:0} >= 7
Michal Simon's avatar
Michal Simon committed
42
BuildRequires:  python-sqlalchemy
43
44
45
%else
BuildRequires:  python-sqlalchemy0.8
%endif
46
BuildRequires:  python-requests
47
%if %{?rhel}%{!?rhel:0} == 6
48
BuildRequires:  python-slimit
49
%endif
50
BuildRequires:  pandoc
51
BuildRequires:  python-dirq
52
BuildRequires:  MySQL-python
Michal Simon's avatar
Michal Simon committed
53

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

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
%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

93
94
95
96
%package http-authz-signed-cert
Summary:        FTS3 Rest HTTP_AUTHORIZATION signed-cert method
Group:          Application/Internet

97
98
Requires:       python-dateutil
Requires:       python-m2ext
99
100
101
102
103
Requires:       fts-rest = %{version}-%{release}

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

ayllon's avatar
ayllon committed
104
%package cli
105
106
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
107

Michal Simon's avatar
Michal Simon committed
108
Requires:       python-fts = %{version}-%{release}
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
109
Requires:       python-m2ext
ayllon's avatar
ayllon committed
110
111
112
113

%description cli
Command line utilities for the FTS3 REST interface

114
%package selinux
115
116
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
117

Michal Simon's avatar
Michal Simon committed
118
Requires:       %{name} = %{version}-%{release}
119
120

%description selinux
Michal Simon's avatar
Michal Simon committed
121
SELinux support for fts-rest
122

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

%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
137

Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
138
%if %{?rhel}%{!?rhel:0} >= 7
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
139
%files 
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
140
141
142
%{_prefix}/lib/firewalld/services
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.xml
%endif
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
143

144
145
%post
/sbin/service httpd condrestart >/dev/null 2>&1 || :
146
147
148
149
150
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
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
151
152
153
154
%if %{?rhel}%{!?rhel:0} >= 7
%firewalld_reload
%endif

155
156
157
158
159
160

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

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

177
%prep
178
%setup -q
179
180

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

Michal Simon's avatar
Michal Simon committed
191
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
192
193
make %{?_smp_mflags}

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

206
207
208
209
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

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

Michal Simon's avatar
Michal Simon committed
213
cp --preserve=timestamps -r src/fts3 %{buildroot}/%{python_sitelib}
214

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

287
288
289
290
291
292
293
294
295
296
297
298
299
%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
300
%{python_sitelib}/fts3rest/templates/app_register.html
301
302
303
%{python_sitelib}/fts3rest/templates/apps.html
%{python_sitelib}/fts3rest/templates/authz_confirm.html
%{python_sitelib}/fts3rest/templates/authz_failure.html
304
%{python_sitelib}/fts3rest/templates/authz_noredirect.html
305

306
307
308
%files http-authz-signed-cert
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/http.py*

ayllon's avatar
ayllon committed
309
310
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
311
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
312
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
313

314
315
%files selinux

Michal Simon's avatar
Michal Simon committed
316
317
%files -n python-fts
%{python_sitelib}/fts3
318
%{python_sitelib}/fts3.egg-info
Michal Simon's avatar
Michal Simon committed
319
320
%doc LICENSE

321
322


323
%changelog
324
325
* Tue Apr 19 2016 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.4.0-1
- Update for new upstream release
326

327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
* 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
343
344
- First EPEL release

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

348
349
350
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

357
358
359
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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