fts-rest.spec 4.08 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.27
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
Michal Simon's avatar
added:    
Michal Simon committed
16
%if 0%{?rhel} > 5
17
BuildRequires:  python-nose1.1
Michal Simon's avatar
added:    
Michal Simon committed
18
%endif
19
BuildRequires:  python-pylons
20
BuildRequires:  scipy
Michal Simon's avatar
Michal Simon committed
21
BuildRequires:  m2crypto
22
BuildRequires:  python-coverage
Michal Simon's avatar
Michal Simon committed
23
BuildRequires:  python-sqlalchemy
24
BuildRequires:  python-requests
25
BuildRequires:  pandoc
Michal Simon's avatar
Michal Simon committed
26

27
28
29
Requires:     gridsite%{?_isa} >= 1.7
Requires:     httpd%{?_isa}
Requires:     mod_wsgi
Michal Simon's avatar
Michal Simon committed
30
Requires:     python-fts = %{version}-%{release}
31
32
33
Requires:     python-paste-deploy
Requires:     python-pylons
Requires:     gfal2-python
34
35
36
37

%description
This package provides the FTS3 REST interface

ayllon's avatar
ayllon committed
38
%package cli
39
40
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
41

Michal Simon's avatar
Michal Simon committed
42
Requires:       python-fts = %{version}-%{release}
ayllon's avatar
ayllon committed
43
44
45
46

%description cli
Command line utilities for the FTS3 REST interface

47
%package selinux
48
49
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
50

Michal Simon's avatar
Michal Simon committed
51
Requires:       %{name} = %{version}-%{release}
52
53

%description selinux
Michal Simon's avatar
Michal Simon committed
54
SELinux support for fts-rest
55

Michal Simon's avatar
Michal Simon committed
56
57
58
59
60
61
62
63
64
65
66
%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.

67
68
69
70
71
72
73
74
%post
/sbin/service httpd condrestart >/dev/null 2>&1 || :

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

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

89
%prep
Michal Simon's avatar
Michal Simon committed
90
%setup -qc
91
92

%build
Michal Simon's avatar
Michal Simon committed
93
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
94
95
make %{?_smp_mflags}

96
%check
Michal Simon's avatar
added:    
Michal Simon committed
97
%if 0%{?rhel} > 5
98
pushd src/fts3rest
Michal Simon's avatar
Michal Simon committed
99
PYTHONPATH=../ nosetests1.1 --with-xunit --xunit-file=/tmp/nosetests.xml
100
popd
Michal Simon's avatar
added:    
Michal Simon committed
101
%endif
102

103
104
105
106
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

ayllon's avatar
ayllon committed
107
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
108
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
109

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

%files
Michal Simon's avatar
Michal Simon committed
113
%{python_sitelib}/fts3rest*
114
115
116
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
117
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
Michal Simon's avatar
Michal Simon committed
118
119
120
121
122
%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
123

ayllon's avatar
ayllon committed
124
125
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
126
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
127
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
128

129
130
%files selinux

Michal Simon's avatar
Michal Simon committed
131
132
133
134
%files -n python-fts
%{python_sitelib}/fts3
%doc LICENSE

135
%changelog
Michal Simon's avatar
Michal Simon committed
136
137
138
* Mon Jun 30 2014 Michal Simon <michal.simon@cern.ch> - 3.2.6-1
- First EPEL release

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

142
143
144
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

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

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

151
152
153
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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