c7584c6
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
c7584c6
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")}
c7584c6
c7584c6
Name:           fts-rest
Alejandro Alvarez Ayllon 293c11f
Version:        3.3.3
e74fe19
Release:        2%{?dist}
c7584c6
BuildArch:      noarch
c7584c6
Summary:        FTS3 Rest Interface
c7584c6
Group:          Applications/Internet
c7584c6
License:        ASL 2.0
Alejandro Alvarez Ayllon 293c11f
URL:            http://fts3-service.web.cern.ch/
Alejandro Alvarez Ayllon 293c11f
# git clone https://gitlab.cern.ch/fts/fts-rest.git --depth 1 -b master fts-rest-3.3.3
Alejandro Alvarez Ayllon 293c11f
# cd fts-rest-3.3.3
Alejandro Alvarez Ayllon 293c11f
# git submodule init && git submodule update
Alejandro Alvarez Ayllon 293c11f
# cd ..
Alejandro Alvarez Ayllon 293c11f
# tar vczf fts-rest-3.3.3.tar.gz --exclude-vcs fts-rest-3.3.3 
Alejandro Alvarez Ayllon bbe89d9
Source0:        %{name}-%{version}.tar.gz
c7584c6
Alejandro Alvarez Ayllon 8b1f448
BuildRequires:  gfal2-python
c7584c6
BuildRequires:  cmake
c7584c6
BuildRequires:  python-jsonschema
bee1edb
%if 0%{?el6}
c7584c6
BuildRequires:  python-nose1.1
4fe8987
%endif
Alejandro Alvarez Ayllon 8b1f448
%if %{?rhel}%{!?rhel:0} >= 7
Alejandro Alvarez Ayllon 8b1f448
BuildRequires:  python-nose
Alejandro Alvarez Ayllon 8b1f448
%endif
Alejandro Alvarez Ayllon 8b1f448
BuildRequires:  python-dateutil
c7584c6
BuildRequires:  python-pylons
c7584c6
BuildRequires:  scipy
c7584c6
BuildRequires:  m2crypto
Alejandro Alvarez Ayllon 293c11f
BuildRequires:  python-mock
Alejandro Alvarez Ayllon 8b1f448
BuildRequires:  python-m2ext
c7584c6
BuildRequires:  python-sqlalchemy
Alejandro Alvarez Ayllon 8b1f448
BuildRequires:  python-requests
Alejandro Alvarez Ayllon 8b1f448
%if %{?rhel}%{!?rhel:0} == 6
Alejandro Alvarez Ayllon 8b1f448
BuildRequires:  python-slimit
Alejandro Alvarez Ayllon 8b1f448
%endif
Alejandro Alvarez Ayllon bbe89d9
BuildRequires:  pandoc
c7584c6
c7584c6
Requires:     gridsite%{?_isa} >= 1.7
c7584c6
Requires:     httpd%{?_isa}
c7584c6
Requires:     mod_wsgi
c7584c6
Requires:     python-fts = %{version}-%{release}
c7584c6
Requires:     python-paste-deploy
c7584c6
Requires:     python-pylons
c7584c6
Requires:     gfal2-python
c7584c6
c7584c6
%description
c7584c6
This package provides the FTS3 REST interface
c7584c6
Alejandro Alvarez Ayllon bbe89d9
%package cloud-storage
Alejandro Alvarez Ayllon bbe89d9
Summary:        FTS3 Rest Cloud Storage extensions
Alejandro Alvarez Ayllon bbe89d9
Group:          Applications/Internet
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
Requires:       fts-rest = %{version}-%{release}
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%description cloud-storage
Alejandro Alvarez Ayllon bbe89d9
FTS3 Rest Cloud Storage extensions. Includes support for Dropbox
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%package oauth2
Alejandro Alvarez Ayllon bbe89d9
Summary:        FTS3 Rest OAuth2 provider
Alejandro Alvarez Ayllon bbe89d9
Group:          Applications/Internet
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
Requires:       fts-rest = %{version}-%{release}
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%description oauth2
Alejandro Alvarez Ayllon bbe89d9
FTS3 Rest OAuth2 provider
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%package http-authz-signed-cert
Alejandro Alvarez Ayllon bbe89d9
Summary:        FTS3 Rest HTTP_AUTHORIZATION signed-cert method
Alejandro Alvarez Ayllon bbe89d9
Group:          Application/Internet
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
Requires:       python-dateutil
Alejandro Alvarez Ayllon bbe89d9
Requires:       python-m2ext
Alejandro Alvarez Ayllon bbe89d9
Requires:       fts-rest = %{version}-%{release}
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%description http-authz-signed-cert
Alejandro Alvarez Ayllon bbe89d9
FTS3 Rest HTTP_AUTHORIZATION signed-cert method
Alejandro Alvarez Ayllon bbe89d9
c7584c6
%package cli
c7584c6
Summary:        FTS3 Rest Interface CLI
c7584c6
Group:          Applications/Internet
c7584c6
c7584c6
Requires:       python-fts = %{version}-%{release}
c7584c6
c7584c6
%description cli
c7584c6
Command line utilities for the FTS3 REST interface
c7584c6
c7584c6
%package selinux
c7584c6
Summary:        SELinux support for fts-rest
c7584c6
Group:          Applications/Internet
c7584c6
c7584c6
Requires:       %{name} = %{version}-%{release}
c7584c6
c7584c6
%description selinux
c7584c6
SELinux support for fts-rest
c7584c6
c7584c6
%package -n python-fts
c7584c6
Summary:        FTS3 database model
c7584c6
Group:          Applications/Internet
c7584c6
Requires:       m2crypto
c7584c6
Requires:       python-pycurl
c7584c6
Requires:       python-sqlalchemy
c7584c6
c7584c6
%description -n python-fts
c7584c6
This package provides an object model of the FTS3
c7584c6
database, using sqlalchemy ORM.
c7584c6
c7584c6
%post
c7584c6
/sbin/service httpd condrestart >/dev/null 2>&1 || :
c7584c6
c7584c6
%postun
c7584c6
if [ "$1" -eq "0" ] ; then
c7584c6
    /sbin/service httpd condrestart >/dev/null 2>&1 || :
c7584c6
fi
c7584c6
c7584c6
%post selinux
c7584c6
if [ "$1" -le "1" ] ; then # First install
c7584c6
semanage port -a -t http_port_t -p tcp 8446
c7584c6
setsebool -P httpd_can_network_connect=1
c7584c6
setsebool -P httpd_setrlimit=1
c7584c6
fi
c7584c6
c7584c6
%preun selinux
c7584c6
if [ "$1" -lt "1" ] ; then # Final removal
c7584c6
semanage port -d -t http_port_t -p tcp 8446
c7584c6
setsebool -P httpd_can_network_connect=0
c7584c6
setsebool -P httpd_setrlimit=0
c7584c6
fi
c7584c6
c7584c6
%prep
Alejandro Alvarez Ayllon 293c11f
%setup -q
c7584c6
c7584c6
%build
Alejandro Alvarez Ayllon 293c11f
# Make sure the version in the spec file and the version used
Alejandro Alvarez Ayllon 293c11f
# for building matches
Alejandro Alvarez Ayllon 293c11f
fts_api_ver=`awk 'match($0, /^API_VERSION = dict\(major=([0-9]+), minor=([0-9]+), patch=([0-9]+)\)/, m) {print m[1]"."m[2]"."m[3]; }' src/fts3rest/fts3rest/controllers/api.py`
Alejandro Alvarez Ayllon 293c11f
fts_spec_ver=`expr "%{version}" : '\([0-9]*\\.[0-9]*\\.[0-9]*\)'`
Alejandro Alvarez Ayllon 293c11f
if [ "$fts_api_ver" != "$fts_spec_ver" ]; then
Alejandro Alvarez Ayllon 293c11f
    echo "The version in the spec file does not match the api.py version!"
Alejandro Alvarez Ayllon 293c11f
    echo "$fts_api_ver != %{version}"
Alejandro Alvarez Ayllon 293c11f
    exit 1
Alejandro Alvarez Ayllon 293c11f
fi
Alejandro Alvarez Ayllon 293c11f
c7584c6
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitelib}
c7584c6
make %{?_smp_mflags}
c7584c6
c7584c6
%check
bee1edb
%if 0%{?el6}
c7584c6
pushd src/fts3rest
c7584c6
PYTHONPATH=../ nosetests1.1 --with-xunit --xunit-file=/tmp/nosetests.xml
c7584c6
popd
4fe8987
%endif
c7584c6
c7584c6
%install
c7584c6
mkdir -p %{buildroot}
c7584c6
make install DESTDIR=%{buildroot}
c7584c6
c7584c6
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
c7584c6
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
c7584c6
c7584c6
cp --preserve=timestamps -r src/fts3 %{buildroot}/%{python_sitelib}
c7584c6
c7584c6
%files
Alejandro Alvarez Ayllon bbe89d9
%dir %{python_sitelib}/fts3rest/
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest.egg-info/*
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/__init__.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/websetup.py*
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/config/*.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/config/routing/__init__.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/config/routing/base.py*
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/api.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/archive.py*
Alejandro Alvarez Ayllon 293c11f
%{python_sitelib}/fts3rest/controllers/autocomplete.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/banning.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/config.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/datamanagement.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/delegation.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/error.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/__init__.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/jobs.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/optimizer.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/snapshot.py*
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/api/
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/app_globals.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/base.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/gfal2_wrapper.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/helpers/
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/http_exceptions.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/__init__.py*
Alejandro Alvarez Ayllon 293c11f
%{python_sitelib}/fts3rest/lib/JobBuilder.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/middleware/*.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/*.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/__init__.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/ssl.py*
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/model/
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/public/
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/templates/delegation.html
Alejandro Alvarez Ayllon 293c11f
%{python_sitelib}/fts3rest/templates/config/
Alejandro Alvarez Ayllon bbe89d9
c7584c6
%{_libexecdir}/fts3
c7584c6
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
c7584c6
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
bee1edb
%config(noreplace) %{_sysconfdir}/logrotate.d/fts-rest
c7584c6
%dir %attr(0755,apache,apache) %{_var}/cache/fts3rest
c7584c6
%dir %attr(0755,apache,apache) %{_var}/log/fts3rest
c7584c6
%doc docs/README.md
c7584c6
%doc docs/install.md
c7584c6
%doc docs/api.md
c7584c6
Alejandro Alvarez Ayllon bbe89d9
%files cloud-storage
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/config/routing/cstorage.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/cloudStorage.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/CSdropbox.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/CSInterface.py*
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%files oauth2
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/config/routing/oauth2.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/controllers/oauth2.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/oauth2lib/
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/oauth2provider.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/oauth2.py*
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/templates/app.html
Alejandro Alvarez Ayllon 293c11f
%{python_sitelib}/fts3rest/templates/app_register.html
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/templates/apps.html
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/templates/authz_confirm.html
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/templates/authz_failure.html
Alejandro Alvarez Ayllon 293c11f
%{python_sitelib}/fts3rest/templates/authz_noredirect.html
Alejandro Alvarez Ayllon bbe89d9
Alejandro Alvarez Ayllon bbe89d9
%files http-authz-signed-cert
Alejandro Alvarez Ayllon bbe89d9
%{python_sitelib}/fts3rest/lib/middleware/fts3auth/methods/http.py*
Alejandro Alvarez Ayllon bbe89d9
c7584c6
%files cli
c7584c6
%{_bindir}/fts-rest-*
c7584c6
%config(noreplace) %{_sysconfdir}/fts3/fts3client.cfg
c7584c6
%{_mandir}/man1/fts-rest*
c7584c6
c7584c6
%files selinux
c7584c6
c7584c6
%files -n python-fts
c7584c6
%{python_sitelib}/fts3
c7584c6
%doc LICENSE
c7584c6
c7584c6
%changelog
e74fe19
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.3-2
e74fe19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e74fe19
57c5ba1
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.32-3
57c5ba1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
57c5ba1
Alejandro Alvarez Ayllon 8b1f448
* Fri Mar 13 2015 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.2.32-2
Alejandro Alvarez Ayllon 8b1f448
- Missing dependencies
Alejandro Alvarez Ayllon 8b1f448
Alejandro Alvarez Ayllon bbe89d9
* Fri Mar 13 2015 Alejandro Alvarez Ayllon <aalvarez@cern.ch> - 3.2.32-1
Alejandro Alvarez Ayllon bbe89d9
- Update for new upstream release
Alejandro Alvarez Ayllon bbe89d9
bee1edb
* Fri Aug 15 2014 Michal Simon <michal.simon@cern.ch> - 3.2.26-2
Alejandro Alvarez Ayllon bbe89d9
- Update for new upstream release
bee1edb
bee1edb
* Mon Jun 30 2014 Michal Simon <michal.simon@cern.ch> - 3.2.26-1
c7584c6
- First EPEL release
c7584c6
bee1edb
* Tue May 13 2014 Michal Simon <michal.simon@cern.ch> - 3.2.25-1
c7584c6
- Marging fts-rest and python-fts
c7584c6
c7584c6
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
c7584c6
- Creating log directory
c7584c6
c7584c6
* Fri Jan 03 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.1.0-1
c7584c6
- Major and minor versions follow FTS3
c7584c6
c7584c6
* Tue Aug 13 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.2-2
c7584c6
- Packaging /var/cache/fts3rest
c7584c6
c7584c6
* Tue Jul 02 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-9
c7584c6
- Introduced -selinux package
c7584c6
c7584c6
* Thu Mar 21 2013 Alejandro Álvarez <aalvarez@cern.ch> - 0.0.1-1
c7584c6
- Initial build