fts-rest.spec 3.95 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.26
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
BuildRequires:  python-nose1.1
17
BuildRequires:  python-pylons
18
BuildRequires:  scipy
Michal Simon's avatar
Michal Simon committed
19
20
21
BuildRequires:  m2crypto
BuildRequires:  python-sqlalchemy

22
23
24
Requires:     gridsite%{?_isa} >= 1.7
Requires:     httpd%{?_isa}
Requires:     mod_wsgi
Michal Simon's avatar
Michal Simon committed
25
Requires:     python-fts = %{version}-%{release}
26
27
28
Requires:     python-paste-deploy
Requires:     python-pylons
Requires:     gfal2-python
29
30
31
32

%description
This package provides the FTS3 REST interface

ayllon's avatar
ayllon committed
33
%package cli
34
35
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
36

Michal Simon's avatar
Michal Simon committed
37
Requires:       python-fts = %{version}-%{release}
ayllon's avatar
ayllon committed
38
39
40
41

%description cli
Command line utilities for the FTS3 REST interface

42
%package selinux
43
44
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
45

Michal Simon's avatar
Michal Simon committed
46
Requires:       %{name} = %{version}-%{release}
47
48

%description selinux
Michal Simon's avatar
Michal Simon committed
49
SELinux support for fts-rest
50

Michal Simon's avatar
Michal Simon committed
51
52
53
54
55
56
57
58
59
60
61
%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.

62
63
64
65
66
67
68
69
%post
/sbin/service httpd condrestart >/dev/null 2>&1 || :

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

70
71
72
%post selinux
if [ "$1" -le "1" ] ; then # First install
semanage port -a -t http_port_t -p tcp 8446
73
74
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_setrlimit=1
75
76
77
78
79
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
80
setsebool -P httpd_can_network_connect=0
81
setsebool -P httpd_setrlimit=0
82
83
fi

84
%prep
Michal Simon's avatar
Michal Simon committed
85
%setup -qc
86
87

%build
Michal Simon's avatar
Michal Simon committed
88
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
89
90
make %{?_smp_mflags}

91
92
%check
pushd src/fts3rest
Michal Simon's avatar
Michal Simon committed
93
PYTHONPATH=../ nosetests1.1 --with-xunit --xunit-file=/tmp/nosetests.xml
94
95
popd

96
97
98
99
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

ayllon's avatar
ayllon committed
100
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
101
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
102

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

%files
Michal Simon's avatar
Michal Simon committed
106
%{python_sitelib}/fts3rest*
107
108
109
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
110
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
Michal Simon's avatar
Michal Simon committed
111
112
113
114
115
%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
116

ayllon's avatar
ayllon committed
117
118
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
119
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
120
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
121

122
123
%files selinux

Michal Simon's avatar
Michal Simon committed
124
125
126
127
%files -n python-fts
%{python_sitelib}/fts3
%doc LICENSE

128
%changelog
Michal Simon's avatar
Michal Simon committed
129
130
131
* Mon Jun 30 2014 Michal Simon <michal.simon@cern.ch> - 3.2.6-1
- First EPEL release

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

135
136
137
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

144
145
146
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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