fts-rest.spec 4.02 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
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
22
BuildRequires:  m2crypto
BuildRequires:  python-sqlalchemy
23
BuildRequires:  pandoc
Michal Simon's avatar
Michal Simon committed
24

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

%description
This package provides the FTS3 REST interface

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

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

%description cli
Command line utilities for the FTS3 REST interface

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

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

%description selinux
Michal Simon's avatar
Michal Simon committed
52
SELinux support for fts-rest
53

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

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

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

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

87
%prep
Michal Simon's avatar
Michal Simon committed
88
%setup -qc
89
90

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

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

101
102
103
104
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

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

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

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

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

127
128
%files selinux

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

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

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

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

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

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

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

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