cubicweb/skeleton/DISTNAME.spec.tmpl
author Philippe Pepiot <philippe.pepiot@logilab.fr>
Tue, 17 Mar 2020 13:29:08 +0100
branch3.27
changeset 12914 87c3562b3bae
parent 11978 9d27e426adc2
permissions -rw-r--r--
[pkg] require python >= 3.4 This avoid pip pulling a version that does not run on python2 when using a python2 environment. Since we already released some 3.27 releases in pypi, I think we should release 3.27.3 and remove releases 3.27.2, 3.27.1 and 3.27.0 from pypi.

# for el5, force use of python2.6
%%if 0%%{?el5}
%%define python python26
%%define __python /usr/bin/python2.6
%%else
%%define python python
%%define __python /usr/bin/python
%%endif
%%{!?_python_sitelib: %%define _python_sitelib %%(%%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           %(distname)s
Version:        0.1.0
Release:        logilab.1%%{?dist}
Summary:        %(shortdesc)s
Group:          Applications/Internet
License:        %(license)s
Source0:        %(distname)s-%%{version}.tar.gz

BuildArch:      noarch
BuildRoot:      %%{_tmppath}/%%{name}-%%{version}-%%{release}-buildroot

BuildRequires:  %%{python} %%{python}-setuptools
Requires:       cubicweb >= %(version)s
Requires:       %%{python}-six >= 1.4.0

%%description
%(longdesc)s

%%prep
%%setup -q -n %(distname)s-%%{version}
%%if 0%%{?el5}
# change the python version in shebangs
find . -name '*.py' -type f -print0 |  xargs -0 sed -i '1,3s;^#!.*python.*$;#! /usr/bin/python2.6;'
%%endif

%%install
%%{__python} setup.py --quiet install --no-compile --prefix=%%{_prefix} --root="$RPM_BUILD_ROOT"

%%clean
rm -rf $RPM_BUILD_ROOT

%%files
%%defattr(-, root, root)
%%{_python_sitelib}/*