fts-rest.spec 2.89 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
%{!?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
# correct inerpreter
%global __os_install_post %__multiple_python_os_install_post
%endif

Name:			fts-rest
19
20
Version:		0.0.2
Release:		1
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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)

BuildRequires:	cmake
%if 0%{?with_python26}
BuildRequires:	python26-devel
%else
BuildRequires:	python-devel
%endif

Requires:		gridsite%{?_isa} >= 1.7
Requires:		httpd%{?_isa}
Requires:		mod_wsgi
Requires:		python-fts
40
41
Requires:		python-paste-deploy
Requires:		python-pylons
42
43
44
45

%description
This package provides the FTS3 REST interface

ayllon's avatar
ayllon committed
46
47
48
49
50
51
52
53
54
%package cli
Summary:		FTS3 Rest Interface CLI
Group:			Applications/Internet

Requires:		python-fts

%description cli
Command line utilities for the FTS3 REST interface

55
56
57
58
59
60
61
62
63
64
65
66
67
%package selinux
Summary:		SELinux support for fts-rest
Group:			Applications/Internet

Requires:		fts-rest

%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
ayllon's avatar
ayllon committed
68
setsebool -P httpd_can_network_connect=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
76
fi

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%prep
%setup -q -n %{name}-%{version}

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

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

%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
99
%files cli
100
%defattr(-,root,root,-)
ayllon's avatar
ayllon committed
101
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
102
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
ayllon's avatar
ayllon committed
103

104
105
%files selinux

106
%changelog
107
108
109
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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