fts-rest.spec 3.6 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.0
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
31
32
33
34
BuildRequires:  m2crypto
BuildRequires:  python-fts
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
40
%endif

41
42
43
44
45
46
47
48
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
49
50
51
52

%description
This package provides the FTS3 REST interface

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

57
Requires:       python-fts
ayllon's avatar
ayllon committed
58
59
60
61

%description cli
Command line utilities for the FTS3 REST interface

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

66
Requires:       fts-rest
67
68
69
70
71
72
73
74

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

86
87
88
89
90
91
92
%prep
%setup -q -n %{name}-%{version}

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

93
94
95
96
97
%check
pushd src/fts3rest
nosetests -x
popd

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

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

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

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

121
122
%files selinux

123
%changelog
124
125
126
* Mon Jan 03 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.1.0-1
- Major and minor versions follow FTS3

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

130
131
132
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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