fts-rest.spec 3.43 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
19
20
21
22
23
24
25
26
27
Name:           fts-rest
Version:        0.1.0
Release:        2
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
ayllon's avatar
ayllon committed
75
setsebool -P httpd_can_network_connect=1 
76
77
78
79
80
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
81
setsebool -P httpd_can_network_connect=0
82
83
fi

84
85
86
87
88
89
90
%prep
%setup -q -n %{name}-%{version}

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

91
92
93
94
95
%check
pushd src/fts3rest
nosetests -x
popd

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

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

103
104
105
106
107
108
109
110
111
%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
112
%dir %attr(0775,apache,apache) %{_var}/cache/fts3rest
113

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

119
120
%files selinux

121
%changelog
ayllon's avatar
ayllon committed
122
123
124
* Tue Aug 13 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.2-2
- Packaging /var/cache/fts3rest

125
126
127
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
- Introduced -selinux package

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