fts-rest.spec 3.44 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
14
Version:        3.2.3
15
Release:        1
16
17
18
19
20
21
22
BuildArch:      noarch
Summary:        FTS3 Rest Interface
Group:          Applications/Internet
License:        ASL 2.0
URL:            https://svnweb.cern.ch/trac/fts3
Source0:        %{name}-%{version}.tar.gz
Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
23

24
BuildRequires:  cmake
25
26

%if 0%{?rhel} > 5
27
BuildRequires:  python-fts >= %{version}
28
29
30
BuildRequires:  python-jsonschema
BuildRequires:  python-nose
BuildRequires:  python-pylons
31
BuildRequires:  scipy
32
%endif
33

34
35
36
37
38
39
40
Requires:     gridsite%{?_isa} >= 1.7
Requires:     httpd%{?_isa}
Requires:     mod_wsgi
Requires:     python-fts
Requires:     python-paste-deploy
Requires:     python-pylons
Requires:     gfal2-python
41
42
43
44

%description
This package provides the FTS3 REST interface

ayllon's avatar
ayllon committed
45
%package cli
46
47
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
48

49
Requires:       python-fts
ayllon's avatar
ayllon committed
50
51
52
53

%description cli
Command line utilities for the FTS3 REST interface

54
%package selinux
55
56
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
57

58
Requires:       fts-rest
59
60
61
62
63
64
65
66

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

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

78
79
80
81
%prep
%setup -q -n %{name}-%{version}

%build
82
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitearch}
83
84
make %{?_smp_mflags}

85
86
87
88
89
# 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

90
%check
91
%if 0%{?rhel} > 5
92
93
94
pushd src/fts3rest
nosetests -x
popd
95
%endif
96

97
98
99
100
101
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

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

105
106
107
108
109
110
111
112
113
%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{python_sitearch}/*
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
ayllon's avatar
ayllon committed
114
%dir %attr(0775,apache,apache) %{_var}/cache/fts3rest
115
%dir %attr(0775,apache,apache) %{_var}/log/fts3rest
116

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

122
123
%files selinux

124
%changelog
125
126
127
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory

128
129
130
* Mon Jan 03 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.1.0-1
- Major and minor versions follow FTS3

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

134
135
136
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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