fts-rest.spec 3.84 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
%{!?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))")}

%if 0%{?rhel} == 5
%global with_python26 1
%endif

%if 0%{?with_python26}
%global __python26 %{_bindir}/python2.6
%global py26dir %{_builddir}/python26-%{name}-%{version}-%{release}
%{!?python26_sitelib: %global python26_sitelib %(%{__python26} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
%{!?python26_sitearch: %global python26_sitearch %(%{__python26} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")}
# Update rpm byte compilation script so that we get the modules compiled by the
14
# correct interpreter
15
16
17
%global __os_install_post %__multiple_python_os_install_post
%endif

18
Name:           fts-rest
19
Version:        3.2.2
20
Release:        1
21
22
23
24
25
26
27
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)
28

29
BuildRequires:  cmake
30
BuildRequires:  m2crypto
31
BuildRequires:  python-fts >= %{version}
32
33
34
BuildRequires:  python-jsonschema
BuildRequires:  python-nose
BuildRequires:  python-pylons
35
%if 0%{?with_python26}
36
BuildRequires:  python26-devel
37
%else
38
BuildRequires:  python-devel
39
%endif
40
BuildRequires:  scipy
41

42
43
44
45
46
47
48
49
Requires:     gridsite%{?_isa} >= 1.7
Requires:     httpd%{?_isa}
Requires:     m2crypto
Requires:     mod_wsgi
Requires:     python-fts
Requires:     python-paste-deploy
Requires:     python-pylons
Requires:     gfal2-python
50
51
52
53

%description
This package provides the FTS3 REST interface

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

58
Requires:       python-fts
59
Requires:       python-pycurl
ayllon's avatar
ayllon committed
60
61
62
63

%description cli
Command line utilities for the FTS3 REST interface

64
%package selinux
65
66
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
67

68
Requires:       fts-rest
69
70
71
72
73
74
75
76

%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
77
78
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_setrlimit=1
79
80
81
82
83
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
84
setsebool -P httpd_can_network_connect=0
85
setsebool -P httpd_setrlimit=0
86
87
fi

88
89
90
91
92
93
94
%prep
%setup -q -n %{name}-%{version}

%build
%cmake . -DCMAKE_INSTALL_PREFIX=/
make %{?_smp_mflags}

95
96
97
98
99
%check
pushd src/fts3rest
nosetests -x
popd

100
101
102
103
104
%install
rm -rf %{buildroot}
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

108
109
110
111
112
113
114
115
116
%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
117
%dir %attr(0775,apache,apache) %{_var}/cache/fts3rest
118
%dir %attr(0775,apache,apache) %{_var}/log/fts3rest
119

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

125
126
%files selinux

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

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

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

137
138
139
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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