fts-rest.spec 3.79 KB
Newer Older
1
2
3
%{!?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))")}

4
Name:           fts-rest
Alejandro Alvarez Ayllon's avatar
Alejandro Alvarez Ayllon committed
5
Version:        3.2.8
Michal Simon's avatar
Michal Simon committed
6
Release:        1%{?dist}
7
8
9
10
11
BuildArch:      noarch
Summary:        FTS3 Rest Interface
Group:          Applications/Internet
License:        ASL 2.0
URL:            https://svnweb.cern.ch/trac/fts3
Michal Simon's avatar
Michal Simon committed
12
Source0:        https://grid-deployment.web.cern.ch/grid-deployment/dms/fts3/tar/%{name}-%{version}.tar.gz
13

14
BuildRequires:  cmake
15
BuildRequires:  python-jsonschema
16
BuildRequires:  python-nose1.1
17
BuildRequires:  python-pylons
18
BuildRequires:  scipy
Michal Simon's avatar
Michal Simon committed
19
20
21
BuildRequires:  m2crypto
BuildRequires:  python-sqlalchemy

22
23
24
Requires:     gridsite%{?_isa} >= 1.7
Requires:     httpd%{?_isa}
Requires:     mod_wsgi
Michal Simon's avatar
Michal Simon committed
25
Requires:     python-fts = %{version}-%{release}
26
27
28
Requires:     python-paste-deploy
Requires:     python-pylons
Requires:     gfal2-python
29
30
31
32

%description
This package provides the FTS3 REST interface

ayllon's avatar
ayllon committed
33
%package cli
34
35
Summary:        FTS3 Rest Interface CLI
Group:          Applications/Internet
ayllon's avatar
ayllon committed
36

Michal Simon's avatar
Michal Simon committed
37
Requires:       python-fts = %{version}-%{release}
ayllon's avatar
ayllon committed
38
39
40
41

%description cli
Command line utilities for the FTS3 REST interface

42
%package selinux
43
44
Summary:        SELinux support for fts-rest
Group:          Applications/Internet
45

Michal Simon's avatar
Michal Simon committed
46
Requires:       %{name} = %{version}-%{release}
47
48

%description selinux
Michal Simon's avatar
Michal Simon committed
49
SELinux support for fts-rest
50

Michal Simon's avatar
Michal Simon committed
51
52
53
54
55
56
57
58
59
60
61
%package -n python-fts
Summary:        FTS3 database model
Group:          Applications/Internet
Requires:       m2crypto
Requires:       python-pycurl
Requires:       python-sqlalchemy

%description -n python-fts
This package provides an object model of the FTS3
database, using sqlalchemy ORM.

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

76
%prep
Michal Simon's avatar
Michal Simon committed
77
%setup -qc
78
79

%build
Michal Simon's avatar
Michal Simon committed
80
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
81
82
make %{?_smp_mflags}

83
84
%check
pushd src/fts3rest
Michal Simon's avatar
Michal Simon committed
85
PYTHONPATH=../ nosetests1.1 --with-xunit --xunit-file=/tmp/nosetests.xml
86
87
popd

88
89
90
91
%install
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}

ayllon's avatar
ayllon committed
92
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
93
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
ayllon's avatar
ayllon committed
94

Michal Simon's avatar
Michal Simon committed
95
cp --preserve=timestamps -r src/fts3 %{buildroot}/%{python_sitelib}
96
97

%files
Michal Simon's avatar
Michal Simon committed
98
%{python_sitelib}/fts3rest*
99
100
101
%{_libexecdir}/fts3
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
102
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
Michal Simon's avatar
Michal Simon committed
103
104
105
106
107
%dir %attr(0755,apache,apache) %{_var}/cache/fts3rest
%dir %attr(0755,apache,apache) %{_var}/log/fts3rest
%doc docs/README.md
%doc docs/install.md
%doc docs/api.md
108

ayllon's avatar
ayllon committed
109
110
%files cli
%{_bindir}/fts-rest-*
Martin Hellmich's avatar
Martin Hellmich committed
111
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
Michal Simon's avatar
Michal Simon committed
112
%{_mandir}/man1/fts-rest*
ayllon's avatar
ayllon committed
113

114
115
%files selinux

Michal Simon's avatar
Michal Simon committed
116
117
118
119
%files -n python-fts
%{python_sitelib}/fts3
%doc LICENSE

120
%changelog
Michal Simon's avatar
Michal Simon committed
121
122
123
* Mon Jun 30 2014 Michal Simon <michal.simon@cern.ch> - 3.2.6-1
- First EPEL release

Michal Simon's avatar
Michal Simon committed
124
125
126
* Tue May 13 2014 Michal Simon <michal.simon@cern.ch> - 3.2.5-1
- Marging fts-rest and python-fts

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

Michal Simon's avatar
Michal Simon committed
130
* Fri Jan 03 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.1.0-1
131
132
- Major and minor versions follow FTS3

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

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

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