fts-rest.spec 4.47 KB
Newer Older
1
2
3
4
5
%if 0%{?rhel} == 5
%global with_python26 1
%endif

%if 0%{?with_python26}
6
7
%global __python %{_bindir}/python2.6
%global __os_install_post %{?__python26_os_install_post}
8
9
%endif

10
11
12
%{!?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))")}

13
Name:           fts-rest
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
14
Version:        3.2.7
15
Release:        1
16
17
18
19
20
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
21
Source0:        https://grid-deployment.web.cern.ch/grid-deployment/dms/fts3/tar/%{name}-%{version}.tar.gz
22

23
BuildRequires:  cmake
Michal Simon's avatar
Michal Simon committed
24
BuildRequires:  python2-devel
25
26

%if 0%{?rhel} > 5
27
BuildRequires:  python-jsonschema
28
BuildRequires:  python-nose1.1
29
BuildRequires:  python-pylons
30
BuildRequires:  scipy
31
%endif
32

Michal Simon's avatar
Michal Simon committed
33
34
35
36
37
38
39
40
%if 0%{?with_python26}
BuildRequires:  python26-m2crypto
BuildRequires:  python26-sqlalchemy
%else
BuildRequires:  m2crypto
BuildRequires:  python-sqlalchemy
%endif

41
42
43
Requires:     gridsite%{?_isa} >= 1.7
Requires:     httpd%{?_isa}
Requires:     mod_wsgi
Michal Simon's avatar
Michal Simon committed
44
Requires:     python-fts = %{version}-%{release}
45
46
47
Requires:     python-paste-deploy
Requires:     python-pylons
Requires:     gfal2-python
48
49
50
51

%description
This package provides the FTS3 REST interface

ayllon's avatar
ayllon committed
52
%package cli
53
54
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
55

Michal Simon's avatar
Michal Simon committed
56
Requires:       python-fts = %{version}-%{release}
ayllon's avatar
ayllon committed
57
58
59
60

%description cli
Command line utilities for the FTS3 REST interface

61
%package selinux
62
63
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
64

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

%description selinux
This package labels port 8446, used by fts-rest, as http_port_t,
so Apache can bind to it.

Michal Simon's avatar
Michal Simon committed
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
%package -n python-fts
Summary:        FTS3 database model
Group:          Applications/Internet

%if 0%{?with_python26}
BuildRequires:  python26-devel
Requires:       python26-m2crypto
Requires:       python26-pycurl
Requires:       python26-sqlalchemy
%else
Requires:       m2crypto
BuildRequires:  python-devel
Requires:       python-pycurl
Requires:       python-sqlalchemy
%endif

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

91
92
93
%post selinux
if [ "$1" -le "1" ] ; then # First install
semanage port -a -t http_port_t -p tcp 8446
94
95
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_setrlimit=1
96
97
98
99
100
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
101
setsebool -P httpd_can_network_connect=0
102
setsebool -P httpd_setrlimit=0
103
104
fi

105
%prep
Michal Simon's avatar
Michal Simon committed
106
%setup -qc
107
108

%build
Michal Simon's avatar
Michal Simon committed
109
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
110
111
make %{?_smp_mflags}

112
113
114
115
116
# In EL5, use Python2.6
%if 0%{?with_python26}
sed -i 's:#!/usr/bin/env python:#!/usr/bin/env python26:g' src/cli/fts-rest-*
%endif

117
%check
118
%if 0%{?rhel} > 5
119
pushd src/fts3rest
Michal Simon's avatar
Michal Simon committed
120
PYTHONPATH=../ nosetests1.1 --with-xunit --xunit-file=/tmp/nosetests.xml
121
popd
122
%endif
123

124
125
126
127
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

ayllon's avatar
ayllon committed
128
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
129
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
130

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

%files
Michal Simon's avatar
Michal Simon committed
134
%{python_sitelib}/fts3rest*
135
%{_libexecdir}/fts3
Michal Simon's avatar
Michal Simon committed
136
%dir %config(noreplace) %{_sysconfdir}/fts3
137
138
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
Michal Simon's avatar
Michal Simon committed
139
140
141
142
143
%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
144

ayllon's avatar
ayllon committed
145
146
%files cli
%{_bindir}/fts-rest-*
Michal Simon's avatar
Michal Simon committed
147
%dir %config(noreplace) %{_sysconfdir}/fts3
Martin Hellmich's avatar
Martin Hellmich committed
148
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
149
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
150

151
152
%files selinux

Michal Simon's avatar
Michal Simon committed
153
154
155
156
%files -n python-fts
%{python_sitelib}/fts3
%doc LICENSE

157
%changelog
Michal Simon's avatar
Michal Simon committed
158
159
160
* Tue May 13 2014 Michal Simon <michal.simon@cern.ch> - 3.2.5-1
- Marging fts-rest and python-fts

161
162
163
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

170
171
172
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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