fts-rest.spec 7.32 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
5
Version:        3.2.31
Michal Simon's avatar
Michal Simon 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:  cmake
15
BuildRequires:  python-jsonschema
16
%if %{?rhel}%{!?rhel:0} == 6
17
BuildRequires:  python-nose1.1
Michal Simon's avatar
added:    
Michal Simon committed
18
%endif
19
20
21
%if %{?rhel}%{!?rhel:0} >= 7
BuildRequires:  python-nose
%endif
22
BuildRequires:  python-pylons
23
BuildRequires:  scipy
Michal Simon's avatar
Michal Simon committed
24
BuildRequires:  m2crypto
25
BuildRequires:  python-coverage
Michal Simon's avatar
Michal Simon committed
26
BuildRequires:  python-sqlalchemy
27
BuildRequires:  python-requests
root's avatar
root committed
28
BuildRequires:  python-dateutil
29
BuildRequires:  pandoc
Michal Simon's avatar
Michal Simon committed
30

31
32
33
Requires:     gridsite%{?_isa} >= 1.7
Requires:     httpd%{?_isa}
Requires:     mod_wsgi
Michal Simon's avatar
Michal Simon committed
34
Requires:     python-fts = %{version}-%{release}
35
Requires:     python-paste-deploy
root's avatar
root committed
36
Requires:     python-dateutil
37
38
Requires:     python-pylons
Requires:     gfal2-python
39
40
41
42

%description
This package provides the FTS3 REST interface

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%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

ayllon's avatar
ayllon committed
61
%package cli
62
63
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
64

Michal Simon's avatar
Michal Simon committed
65
Requires:       python-fts = %{version}-%{release}
ayllon's avatar
ayllon committed
66
67
68
69

%description cli
Command line utilities for the FTS3 REST interface

70
%package selinux
71
72
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
73

Michal Simon's avatar
Michal Simon committed
74
Requires:       %{name} = %{version}-%{release}
75
76

%description selinux
Michal Simon's avatar
Michal Simon committed
77
SELinux support for fts-rest
78

Michal Simon's avatar
Michal Simon committed
79
80
81
82
83
84
85
86
87
88
89
%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.

90
91
92
93
94
95
96
97
%post
/sbin/service httpd condrestart >/dev/null 2>&1 || :

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

98
99
100
%post selinux
if [ "$1" -le "1" ] ; then # First install
semanage port -a -t http_port_t -p tcp 8446
101
102
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_setrlimit=1
103
104
semanage fcontext -a -t httpd_log_t "/var/log/fts3rest(/.*)?"
restorecon -R /var/log/fts3rest/
105
106
107
108
109
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
110
setsebool -P httpd_can_network_connect=0
111
setsebool -P httpd_setrlimit=0
112
113
fi

114
%prep
Michal Simon's avatar
Michal Simon committed
115
%setup -qc
116
117

%build
Michal Simon's avatar
Michal Simon committed
118
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
119
120
make %{?_smp_mflags}

121
122
%check
pushd src/fts3rest
123
%if %{?rhel}%{!?rhel:0} == 6
Michal Simon's avatar
Michal Simon committed
124
PYTHONPATH=../ nosetests1.1 --with-xunit --xunit-file=/tmp/nosetests.xml
Michal Simon's avatar
added:    
Michal Simon committed
125
%endif
126
127
128
129
130
%if %{?rhel}%{!?rhel:0} >= 7
PYTHONPATH=../ ./setup_pylons_plugin.py install --user 
PYTHONPATH=../ nosetests --with-xunit --xunit-file=/tmp/nosetests.xml
%endif
popd
131

132
133
134
135
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

ayllon's avatar
ayllon committed
136
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
137
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
138

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

%files
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
%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*
%{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/misc.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*
%{python_sitelib}/fts3rest/lib/middleware/*.py*
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/*.py*
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/__init__.py*
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/ssl.py*

%{python_sitelib}/fts3rest/model/

%{python_sitelib}/fts3rest/public/
%{python_sitelib}/fts3rest/templates/delegation.html

183
184
185
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
186
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
Michal Simon's avatar
Michal Simon committed
187
188
189
190
191
%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
192

193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
%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
%{python_sitelib}/fts3rest/templates/apps.html
%{python_sitelib}/fts3rest/templates/authz_confirm.html
%{python_sitelib}/fts3rest/templates/authz_failure.html
%{python_sitelib}/fts3rest/templates/register.html

ayllon's avatar
ayllon committed
211
212
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
213
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
214
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
215

216
217
%files selinux

Michal Simon's avatar
Michal Simon committed
218
219
220
221
%files -n python-fts
%{python_sitelib}/fts3
%doc LICENSE

222
%changelog
223
224
225
* 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
226
227
228
* Mon Jun 30 2014 Michal Simon <michal.simon@cern.ch> - 3.2.6-1
- First EPEL release

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

232
233
234
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

241
242
243
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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