python-logilab-constraint.spec 1.67 KB
Newer Older
Pierre GM's avatar
Pierre GM committed
1 2 3 4 5 6 7 8 9 10 11
# 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()")}

%define project_name logilab-constraint
Julien Cristau's avatar
Julien Cristau committed
12
%define project_version 0.6.0
Pierre GM's avatar
Pierre GM committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26

Summary:        constraints satisfaction solver in Python
Name:           %{python}-%{project_name}
Version:        %{project_version}
Release:        logilab.1%{?dist}
Source0:        http://download.logilab.org/pub/constraint/%{project_name}-%{version}.tar.gz
License:        LGPLv2+
Group:          Development/Languages/Python
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch:      noarch
Vendor:         Logilab <contact@logilab.fr>
Url:            http://www.logilab.org/project/%{project_name}

BuildRequires:  %{python}
27
BuildRequires:  %{python}-setuptools
Julien Cristau's avatar
Julien Cristau committed
28 29
Requires:       %{python}, %{python}-logilab-common >= 0.63.2
Requires:       %{python}-six >= 1.4.0
30
Requires:       %{python}-setuptools
Pierre GM's avatar
Pierre GM committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

%description
constraints satisfaction solver in Python

%prep
%setup -q -n %{project_name}-%{version}

%build
%{__python} setup.py build
%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
rm -rf $RPM_BUILD_ROOT
47
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
Pierre GM's avatar
Pierre GM committed
48 49 50 51 52 53 54 55 56
rm -rf $RPM_BUILD_ROOT%{_python_sitelib}/logilab/__init__.py*

%clean
rm -rf $RPM_BUILD_ROOT

%files 
%defattr(-, root, root)
%doc README ChangeLog COPYING.LESSER
%{_python_sitelib}/logilab*