Commit 59210edf authored by Julien Cristau's avatar Julien Cristau
Browse files

[packaging] spec file fixups

parent 36f4b954cf65
# for el5, force use of python2.6
%if 0%{?el5}
%define python python26
%define __python /usr/bin/python2.6
%{!?python_scriptarch: %define python_scriptarch %(%{__python} -c "from distutils.sysconfig import get_python_lib; from os.path import join; print join(get_python_lib(1, 1), 'scripts')")}
%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-mtconverter
%define project_version 0.8.4
%define project_release logilab
Name: %{python}-%{project_name}
Version: 0.8.4
Release: %{project_release}%{?dist}
Summary: a library to convert from a MIME type to another
Source0: http://download.logilab.org/pub/mtconverter/%{project_name}-%{version}.tar.gz
License: LGPLv2+
Group: Development/Languages/Python
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Vendor: Logilab <contact@logilab.fr>
Packager: Pierre GM <pierre.gerard-marchant@logilab.fr>
Url: http://www.logilab.org/project/%{project_name}
Requires: %{python}, %{python}-logilab-common >= 0.55.2
BuildRequires: %{python}
Name: %{python}-%{project_name}
Version: %{project_version}
Release: logilab.1%{?dist}
Summary: a library to convert from a MIME type to another
Group: Development/Languages/Python
License: LGPLv2+
Vendor: Logilab <contact@logilab.fr>
URL: http://www.logilab.org/project/%{project_name}
Source0: http://download.logilab.org/pub/mtconverter/%{project_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: %{python}
Requires: %{python}, %{python}-logilab-common >= 0.55.2
%description
......@@ -34,19 +34,23 @@ all Zope's internal removed (i.e. most of the code).
%prep
%setup -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
NO_SETUPTOOLS=1 %{__python} setup.py --quiet install --no-compile --prefix=%{_prefix} --root="$RPM_BUILD_ROOT" %{?python_scriptarch: --install-scripts=%{python_scriptarch}}
find ${RPM_BUILD_ROOT} -regex '.*/logilab/__init__\.py.?$' -delete
rm -rf $RPM_BUILD_ROOT
NO_SETUPTOOLS=1 %{__python} setup.py install -O1 --skip-build --root="$RPM_BUILD_ROOT"
rm -rf $RPM_BUILD_ROOT%{_python_sitelib}/logilab/__init__.py*
%clean
rm -rf $RPM_BUILD_ROOT
%files
%files
%defattr(-, root, root)
/*
%doc README ChangeLog COPYING.LESSER
%{_python_sitelib}/logilab*
Markdown is supported
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