Commit 8498a12c authored by Alejandro Alvarez Ayllon's avatar Alejandro Alvarez Ayllon
Browse files

FTS-66: Packaging for EL5

parent 8290ef6c
......@@ -3,9 +3,11 @@ cmake_minimum_required (VERSION 2.6)
project (fts3-misc)
# Python libraries location
execute_process (COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT DEFINED PYTHON_SITE_PACKAGES)
execute_process (COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif (NOT DEFINED PYTHON_SITE_PACKAGES)
# Subdirectories
add_subdirectory (src)
%{!?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 interpreter
%global __os_install_post %__multiple_python_os_install_post
%global __python %{_bindir}/python2.6
%global __os_install_post %{?__python26_os_install_post}
%endif
%{!?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))")}
Name: fts-rest
Version: 3.2.2
Release: 1
......@@ -27,21 +22,17 @@ Source0: %{name}-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: cmake
BuildRequires: m2crypto
%if 0%{?rhel} > 5
BuildRequires: python-fts >= %{version}
BuildRequires: python-jsonschema
BuildRequires: python-nose
BuildRequires: python-pylons
%if 0%{?with_python26}
BuildRequires: python26-devel
%else
BuildRequires: python-devel
%endif
BuildRequires: scipy
%endif
Requires: gridsite%{?_isa} >= 1.7
Requires: httpd%{?_isa}
Requires: m2crypto
Requires: mod_wsgi
Requires: python-fts
Requires: python-paste-deploy
......@@ -56,7 +47,6 @@ Summary: FTS3 Rest Interface CLI
Group: Applications/Internet
Requires: python-fts
Requires: python-pycurl
%description cli
Command line utilities for the FTS3 REST interface
......@@ -89,13 +79,20 @@ fi
%setup -q -n %{name}-%{version}
%build
%cmake . -DCMAKE_INSTALL_PREFIX=/
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DPYTHON_SITE_PACKAGES=%{python_sitearch}
make %{?_smp_mflags}
# In EL5, use Python2.6
%if 0%{?with_python26}
sed -i 's:#!/usr/bin/env python:#!/usr/bin/env python26:g' src/cli/fts-rest-*
%endif
%check
%if 0%{?rhel} > 5
pushd src/fts3rest
nosetests -x
popd
%endif
%install
rm -rf %{buildroot}
......
%{!?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
%global __python %{_bindir}/python2.6
%global __os_install_post %{?__python26_os_install_post}
%endif
%{!?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))")}
Name: python-fts
Version: 3.2.2
Release: 1
......@@ -28,12 +23,15 @@ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?with_python26}
BuildRequires: python26-devel
Requires: python26-m2crypto
Requires: python26-pycurl
Requires: python26-sqlalchemy
%else
Requires: m2crypto
BuildRequires: python-devel
%endif
Requires: python-pycurl
Requires: python-sqlalchemy
Requires: m2crypto
%endif
%description
This package provides an object model of the FTS3
......@@ -55,6 +53,9 @@ rm -rf %{buildroot}
%{python_sitearch}/*
%changelog
* Mon Apr 14 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.2-1
- Adapted for EL5
* Mon Jan 03 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.1.0-1
- Major and minor versions follow FTS3
......
......@@ -5,6 +5,7 @@ install(PROGRAMS fts-rest-transfer-cancel
fts-rest-transfer-status
fts-rest-transfer-submit
fts-rest-delegate
fts-rest-whoami
DESTINATION usr/bin
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment