fts-rest.spec 10.5 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
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
7
Version:        3.6.3
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon 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/
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
14
15
16
# git clone https://gitlab.cern.ch/fts/fts-rest.git --depth 1 -b master fts-rest-3.6.3
# cd fts-rest-3.6.3
# git checkout v3.6.3
17
18
# git submodule init && git submodule update
# cd ..
Maria Arsuaga Rios's avatar
Maria Arsuaga Rios committed
19
# tar vczf fts-rest-3.6.3.tar.gz --exclude-vcs fts-rest-3.6.3
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
root's avatar
.    
root committed
32
BuildRequires:  python-dateutil
33
BuildRequires:  python-pylons
34
BuildRequires:  scipy
Michal Simon's avatar
Michal Simon committed
35
BuildRequires:  m2crypto
36
BuildRequires:  python-mock
37
BuildRequires:  python-m2ext
38
%if %{?rhel}%{!?rhel:0} >= 7
Michal Simon's avatar
Michal Simon committed
39
BuildRequires:  python-sqlalchemy
40
41
42
%else
BuildRequires:  python-sqlalchemy0.8
%endif
43
BuildRequires:  python-requests
44
%if %{?rhel}%{!?rhel:0} == 6
45
BuildRequires:  python-slimit
46
%endif
47
BuildRequires:  pandoc
48
BuildRequires:  python-dirq
Michal Simon's avatar
Michal Simon committed
49

50
51
52
Requires:       gridsite%{?_isa} >= 1.7
Requires:       httpd%{?_isa}
Requires:       mod_wsgi
53
Requires:       python-dirq
54
55
56
Requires:       python-fts = %{version}-%{release}
Requires:       python-paste-deploy
Requires:       python-pylons
57
58
Requires:       python-simplejson%{?_isa}
Requires:       gfal2-python%{?_isa}
59
Requires: 	python-requests
60
61
62
%description
This package provides the FTS3 REST interface

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
%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

81
82
83
84
%package http-authz-signed-cert
Summary:        FTS3 Rest HTTP_AUTHORIZATION signed-cert method
Group:          Application/Internet

85
86
Requires:       python-dateutil
Requires:       python-m2ext
87
88
89
90
91
Requires:       fts-rest = %{version}-%{release}

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

ayllon's avatar
ayllon committed
92
%package cli
93
94
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
95

Michal Simon's avatar
Michal Simon committed
96
Requires:       python-fts = %{version}-%{release}
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
97
Requires:       python-m2ext
ayllon's avatar
ayllon committed
98
99
100
101

%description cli
Command line utilities for the FTS3 REST interface

102
%package selinux
103
104
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
105

Michal Simon's avatar
Michal Simon committed
106
Requires:       %{name} = %{version}-%{release}
107
108

%description selinux
Michal Simon's avatar
Michal Simon committed
109
SELinux support for fts-rest
110

Michal Simon's avatar
Michal Simon committed
111
112
113
114
115
%package -n python-fts
Summary:        FTS3 database model
Group:          Applications/Internet
Requires:       m2crypto
Requires:       python-pycurl
116
%if %{?rhel}%{!?rhel:0} >= 7
Michal Simon's avatar
Michal Simon committed
117
Requires:       python-sqlalchemy
118
119
120
%else
Requires:       python-sqlalchemy0.8
%endif
Michal Simon's avatar
Michal Simon committed
121
122
123
124
125

%description -n python-fts
This package provides an object model of the FTS3
database, using sqlalchemy ORM.

126
127
%post
/sbin/service httpd condrestart >/dev/null 2>&1 || :
128
129
130
131
132
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
133
134
135
136
137
138

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

139
140
141
%post selinux
if [ "$1" -le "1" ] ; then # First install
semanage port -a -t http_port_t -p tcp 8446
142
143
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_setrlimit=1
144
145
semanage fcontext -a -t httpd_log_t "/var/log/fts3rest(/.*)?"
restorecon -R /var/log/fts3rest/
146
147
148
149
150
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
151
setsebool -P httpd_can_network_connect=0
152
setsebool -P httpd_setrlimit=0
153
154
fi

155
%prep
156
%setup -q
157
158

%build
159
160
161
162
163
# 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
164
    echo "The version in the spec file does not match the api.py version!"
165
166
167
168
    echo "$fts_api_ver != %{version}"
    exit 1
fi

Michal Simon's avatar
Michal Simon committed
169
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
170
171
make %{?_smp_mflags}

172
173
%check
pushd src/fts3rest
174
%if %{?rhel}%{!?rhel:0} == 6
175
PYTHONPATH=../:/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/ \
176
    nosetests1.1 --with-xunit --xunit-file=%{?nosetest_path}/nosetests.xml
Michal Simon's avatar
added:    
Michal Simon committed
177
%endif
178
%if %{?rhel}%{!?rhel:0} >= 7
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
179
PYTHONPATH=../ ./setup_pylons_plugin.py install --user
180
PYTHONPATH=../ nosetests --with-xunit --xunit-file=%{?nosetest_path}/nosetests.xml
181
182
%endif
popd
183

184
185
186
187
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

ayllon's avatar
ayllon committed
188
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
189
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
190

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

193
194
195
196
197
198
199
200
201
202
203
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

204
%files
205
206
207
208
209
210
211
212
213
214
215
216
217
%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*
218
%{python_sitelib}/fts3rest/controllers/autocomplete.py*
219
%{python_sitelib}/fts3rest/controllers/banning.py*
220
%{python_sitelib}/fts3rest/controllers/config/*.py*
221
222
223
224
%{python_sitelib}/fts3rest/controllers/datamanagement.py*
%{python_sitelib}/fts3rest/controllers/delegation.py*
%{python_sitelib}/fts3rest/controllers/error.py*
%{python_sitelib}/fts3rest/controllers/__init__.py*
225
%{python_sitelib}/fts3rest/controllers/files.py*
226
227
%{python_sitelib}/fts3rest/controllers/jobs.py*
%{python_sitelib}/fts3rest/controllers/optimizer.py*
228
%{python_sitelib}/fts3rest/controllers/serverstatus.py*
229
230
231
232
233
234
235
236

%{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*
%{python_sitelib}/fts3rest/lib/helpers/
%{python_sitelib}/fts3rest/lib/http_exceptions.py*
%{python_sitelib}/fts3rest/lib/__init__.py*
237
%{python_sitelib}/fts3rest/lib/JobBuilder.py*
238
239
240
%{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
241
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/ssl.py*
242
243
244
245
%{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*
246
247
248
249
250

%{python_sitelib}/fts3rest/model/

%{python_sitelib}/fts3rest/public/
%{python_sitelib}/fts3rest/templates/delegation.html
251
%{python_sitelib}/fts3rest/templates/config/
252

253
254
255
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
256
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
257
258
%dir %attr(0755,fts3,fts3) %{_var}/cache/fts3rest
%dir %attr(0755,fts3,fts3) %{_var}/log/fts3rest
Michal Simon's avatar
Michal Simon committed
259
260
261
%doc docs/README.md
%doc docs/install.md
%doc docs/api.md
262

263
264
265
266
267
268
269
270
271
272
273
274
275
%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
276
%{python_sitelib}/fts3rest/templates/app_register.html
277
278
279
%{python_sitelib}/fts3rest/templates/apps.html
%{python_sitelib}/fts3rest/templates/authz_confirm.html
%{python_sitelib}/fts3rest/templates/authz_failure.html
280
%{python_sitelib}/fts3rest/templates/authz_noredirect.html
281

282
283
284
%files http-authz-signed-cert
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/http.py*

ayllon's avatar
ayllon committed
285
286
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
287
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
288
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
289

290
291
%files selinux

Michal Simon's avatar
Michal Simon committed
292
293
%files -n python-fts
%{python_sitelib}/fts3
294
%{python_sitelib}/fts3.egg-info
Michal Simon's avatar
Michal Simon committed
295
296
%doc LICENSE

297
%changelog
298
299
* Tue Apr 19 2016 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.4.0-1
- Update for new upstream release
300

301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
* 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
317
318
- First EPEL release

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

322
323
324
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

331
332
333
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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