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

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
%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

86
87
88
89
%package http-authz-signed-cert
Summary:        FTS3 Rest HTTP_AUTHORIZATION signed-cert method
Group:          Application/Internet

90
91
Requires:       python-dateutil
Requires:       python-m2ext
92
93
94
95
96
Requires:       fts-rest = %{version}-%{release}

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

ayllon's avatar
ayllon committed
97
%package cli
98
99
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
100

Michal Simon's avatar
Michal Simon committed
101
Requires:       python-fts = %{version}-%{release}
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
102
Requires:       python-m2ext
ayllon's avatar
ayllon committed
103
104
105
106

%description cli
Command line utilities for the FTS3 REST interface

107
%package selinux
108
109
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
110

Michal Simon's avatar
Michal Simon committed
111
Requires:       %{name} = %{version}-%{release}
112
113

%description selinux
Michal Simon's avatar
Michal Simon committed
114
SELinux support for fts-rest
115

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

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

131
132
%post
/sbin/service httpd condrestart >/dev/null 2>&1 || :
133
134
135
136
137
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
138
139
140
141
142
143

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

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

160
%prep
161
%setup -q
162
163

%build
164
165
166
167
168
# 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
169
    echo "The version in the spec file does not match the api.py version!"
170
171
172
173
    echo "$fts_api_ver != %{version}"
    exit 1
fi

Michal Simon's avatar
Michal Simon committed
174
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
175
176
make %{?_smp_mflags}

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

189
190
191
192
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

ayllon's avatar
ayllon committed
193
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
194
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
195

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

198
199
200
201
202
203
204
205
206
207
208
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

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

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

%{python_sitelib}/fts3rest/model/

%{python_sitelib}/fts3rest/public/
%{python_sitelib}/fts3rest/templates/delegation.html
257
%{python_sitelib}/fts3rest/templates/config/
258

259
260
261
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
262
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
263
264
%dir %attr(0755,fts3,fts3) %{_var}/cache/fts3rest
%dir %attr(0755,fts3,fts3) %{_var}/log/fts3rest
Michal Simon's avatar
Michal Simon committed
265
266
267
%doc docs/README.md
%doc docs/install.md
%doc docs/api.md
268

269
270
271
272
273
274
275
276
277
278
279
280
281
%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
282
%{python_sitelib}/fts3rest/templates/app_register.html
283
284
285
%{python_sitelib}/fts3rest/templates/apps.html
%{python_sitelib}/fts3rest/templates/authz_confirm.html
%{python_sitelib}/fts3rest/templates/authz_failure.html
286
%{python_sitelib}/fts3rest/templates/authz_noredirect.html
287

288
289
290
%files http-authz-signed-cert
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/http.py*

ayllon's avatar
ayllon committed
291
292
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
293
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
294
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
295

296
297
%files selinux

Michal Simon's avatar
Michal Simon committed
298
299
%files -n python-fts
%{python_sitelib}/fts3
300
%{python_sitelib}/fts3.egg-info
Michal Simon's avatar
Michal Simon committed
301
302
%doc LICENSE

303
%changelog
304
305
* Tue Apr 19 2016 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.4.0-1
- Update for new upstream release
306

307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
* 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
323
324
- First EPEL release

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

328
329
330
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

337
338
339
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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