fts-rest.spec 8.54 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
Name:           fts-rest
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
5
Version:        3.2.34
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
6
Release:        1%{?dist}
7
8
9
10
11
BuildArch:      noarch
Summary:        FTS3 Rest Interface
Group:          Applications/Internet
License:        ASL 2.0
URL:            https://svnweb.cern.ch/trac/fts3
Michal Simon's avatar
Michal Simon committed
12
Source0:        https://grid-deployment.web.cern.ch/grid-deployment/dms/fts3/tar/%{name}-%{version}.tar.gz
13

14
BuildRequires:  gfal2-python
15
BuildRequires:  cmake
16
BuildRequires:  python-jsonschema
17
%if %{?rhel}%{!?rhel:0} == 6
18
BuildRequires:  python-nose1.1
Michal Simon's avatar
added:    
Michal Simon committed
19
%endif
20
21
22
%if %{?rhel}%{!?rhel:0} >= 7
BuildRequires:  python-nose
%endif
root's avatar
.    
root committed
23
BuildRequires:  python-dateutil
24
BuildRequires:  python-pylons
25
BuildRequires:  scipy
Michal Simon's avatar
Michal Simon committed
26
BuildRequires:  m2crypto
27
BuildRequires:  python-m2ext
Michal Simon's avatar
Michal Simon committed
28
BuildRequires:  python-sqlalchemy
29
BuildRequires:  python-requests
30
%if %{?rhel}%{!?rhel:0} == 6
31
BuildRequires:  python-slimit
32
%endif
33
BuildRequires:  pandoc
Michal Simon's avatar
Michal Simon committed
34

35
36
37
38
39
40
Requires:       gridsite%{?_isa} >= 1.7
Requires:       httpd%{?_isa}
Requires:       mod_wsgi
Requires:       python-fts = %{version}-%{release}
Requires:       python-paste-deploy
Requires:       python-pylons
41
42
Requires:       python-simplejson%{?_isa}
Requires:       gfal2-python%{?_isa}
43
44
45
46

%description
This package provides the FTS3 REST interface

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%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

65
66
67
68
%package http-authz-signed-cert
Summary:        FTS3 Rest HTTP_AUTHORIZATION signed-cert method
Group:          Application/Internet

69
70
Requires:       python-dateutil
Requires:       python-m2ext
71
72
73
74
75
Requires:       fts-rest = %{version}-%{release}

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

ayllon's avatar
ayllon committed
76
%package cli
77
78
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
79

Michal Simon's avatar
Michal Simon committed
80
Requires:       python-fts = %{version}-%{release}
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
81
Requires:       python-m2ext
ayllon's avatar
ayllon committed
82
83
84
85

%description cli
Command line utilities for the FTS3 REST interface

86
%package selinux
87
88
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
89

Michal Simon's avatar
Michal Simon committed
90
Requires:       %{name} = %{version}-%{release}
91
92

%description selinux
Michal Simon's avatar
Michal Simon committed
93
SELinux support for fts-rest
94

Michal Simon's avatar
Michal Simon committed
95
96
97
98
99
100
101
102
103
104
105
%package -n python-fts
Summary:        FTS3 database model
Group:          Applications/Internet
Requires:       m2crypto
Requires:       python-pycurl
Requires:       python-sqlalchemy

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

106
107
108
109
110
111
112
113
%post
/sbin/service httpd condrestart >/dev/null 2>&1 || :

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

114
115
116
%post selinux
if [ "$1" -le "1" ] ; then # First install
semanage port -a -t http_port_t -p tcp 8446
117
118
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_setrlimit=1
119
120
semanage fcontext -a -t httpd_log_t "/var/log/fts3rest(/.*)?"
restorecon -R /var/log/fts3rest/
121
122
123
124
125
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
126
setsebool -P httpd_can_network_connect=0
127
setsebool -P httpd_setrlimit=0
128
129
fi

130
%prep
Michal Simon's avatar
Michal Simon committed
131
%setup -qc
132
133

%build
134
135
136
137
138
139
140
141
142
143
# 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
    echo "The version in api.py does not match the CMakeLists.txt version!"
    echo "$fts_api_ver != %{version}"
    exit 1
fi

Michal Simon's avatar
Michal Simon committed
144
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
145
146
make %{?_smp_mflags}

147
148
%check
pushd src/fts3rest
149
%if %{?rhel}%{!?rhel:0} == 6
Michal Simon's avatar
Michal Simon committed
150
PYTHONPATH=../ nosetests1.1 --with-xunit --xunit-file=/tmp/nosetests.xml
Michal Simon's avatar
added:    
Michal Simon committed
151
%endif
152
%if %{?rhel}%{!?rhel:0} >= 7
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
153
PYTHONPATH=../ ./setup_pylons_plugin.py install --user
154
155
156
PYTHONPATH=../ nosetests --with-xunit --xunit-file=/tmp/nosetests.xml
%endif
popd
157

158
159
160
161
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

ayllon's avatar
ayllon committed
162
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
163
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
164

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

%files
168
169
170
171
172
173
174
175
176
177
178
179
180
%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*
181
%{python_sitelib}/fts3rest/controllers/autocomplete.py*
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
%{python_sitelib}/fts3rest/controllers/banning.py*
%{python_sitelib}/fts3rest/controllers/config.py*
%{python_sitelib}/fts3rest/controllers/datamanagement.py*
%{python_sitelib}/fts3rest/controllers/delegation.py*
%{python_sitelib}/fts3rest/controllers/error.py*
%{python_sitelib}/fts3rest/controllers/__init__.py*
%{python_sitelib}/fts3rest/controllers/jobs.py*
%{python_sitelib}/fts3rest/controllers/optimizer.py*
%{python_sitelib}/fts3rest/controllers/snapshot.py*

%{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*
199
%{python_sitelib}/fts3rest/lib/JobBuilder.py*
200
201
202
%{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
203
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/ssl.py*
204
205
206
207
208

%{python_sitelib}/fts3rest/model/

%{python_sitelib}/fts3rest/public/
%{python_sitelib}/fts3rest/templates/delegation.html
209
%{python_sitelib}/fts3rest/templates/config/
210

211
212
213
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
214
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
Michal Simon's avatar
Michal Simon committed
215
216
217
218
219
%dir %attr(0755,apache,apache) %{_var}/cache/fts3rest
%dir %attr(0755,apache,apache) %{_var}/log/fts3rest
%doc docs/README.md
%doc docs/install.md
%doc docs/api.md
220

221
222
223
224
225
226
227
228
229
230
231
232
233
%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
234
%{python_sitelib}/fts3rest/templates/app_register.html
235
236
237
%{python_sitelib}/fts3rest/templates/apps.html
%{python_sitelib}/fts3rest/templates/authz_confirm.html
%{python_sitelib}/fts3rest/templates/authz_failure.html
238
%{python_sitelib}/fts3rest/templates/authz_noredirect.html
239

240
241
242
%files http-authz-signed-cert
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/http.py*

ayllon's avatar
ayllon committed
243
244
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
245
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
246
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
247

248
249
%files selinux

Michal Simon's avatar
Michal Simon committed
250
251
252
253
%files -n python-fts
%{python_sitelib}/fts3
%doc LICENSE

254
%changelog
255
256
257
* Fri Aug 15 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.27-1
- Package separately oauth2 and cloud storage support

Michal Simon's avatar
Michal Simon committed
258
259
260
* Mon Jun 30 2014 Michal Simon <michal.simon@cern.ch> - 3.2.6-1
- First EPEL release

Michal Simon's avatar
Michal Simon committed
261
262
263
* Tue May 13 2014 Michal Simon <michal.simon@cern.ch> - 3.2.5-1
- Marging fts-rest and python-fts

264
265
266
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

273
274
275
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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