skeleton/DISTNAME.spec.tmpl
changeset 11057 0b59724cb3f2
parent 11052 058bb3dc685f
child 11058 23eb30449fe5
equal deleted inserted replaced
11052:058bb3dc685f 11057:0b59724cb3f2
     1 # for el5, force use of python2.6
       
     2 %%if 0%%{?el5}
       
     3 %%define python python26
       
     4 %%define __python /usr/bin/python2.6
       
     5 %%else
       
     6 %%define python python
       
     7 %%define __python /usr/bin/python
       
     8 %%endif
       
     9 %%{!?_python_sitelib: %%define _python_sitelib %%(%%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
       
    10 
       
    11 Name:           %(distname)s
       
    12 Version:        0.1.0
       
    13 Release:        logilab.1%%{?dist}
       
    14 Summary:        %(shortdesc)s
       
    15 Group:          Applications/Internet
       
    16 License:        %(license)s
       
    17 Source0:        %(distname)s-%%{version}.tar.gz
       
    18 
       
    19 BuildArch:      noarch
       
    20 BuildRoot:      %%{_tmppath}/%%{name}-%%{version}-%%{release}-buildroot
       
    21 
       
    22 BuildRequires:  %%{python} %%{python}-setuptools
       
    23 Requires:       cubicweb >= %(version)s
       
    24 Requires:       %%{python}-six >= 1.4.0
       
    25 
       
    26 %%description
       
    27 %(longdesc)s
       
    28 
       
    29 %%prep
       
    30 %%setup -q -n %(distname)s-%%{version}
       
    31 %%if 0%%{?el5}
       
    32 # change the python version in shebangs
       
    33 find . -name '*.py' -type f -print0 |  xargs -0 sed -i '1,3s;^#!.*python.*$;#! /usr/bin/python2.6;'
       
    34 %%endif
       
    35 
       
    36 %%install
       
    37 NO_SETUPTOOLS=1 %%{__python} setup.py --quiet install --no-compile --prefix=%%{_prefix} --root="$RPM_BUILD_ROOT"
       
    38 # remove generated .egg-info file
       
    39 rm -rf $RPM_BUILD_ROOT/usr/lib/python*
       
    40 
       
    41 
       
    42 %%clean
       
    43 rm -rf $RPM_BUILD_ROOT
       
    44 
       
    45 %%files
       
    46 %%defattr(-, root, root)
       
    47 /*