Sophie

Sophie

distrib > Fedora > 16 > x86_64 > by-pkgid > 8e2c13109e6e1bf44149590f7f7c97e7 > files > 2

python-mimeparse-0.1.3-2.fc16.src.rpm

%global with_python3 0
%global srcname mimeparse

Name:           python-%{srcname}
Version:        0.1.3
Release:        2%{?dist}
Summary:        Python module for parsing mime-type names
Group:          Development/Languages
License:        MIT
URL:            https://mimeparse.googlecode.com/
Source0:        https://mimeparse.googlecode.com/files/%{srcname}-%{version}.tar.gz
BuildArch:      noarch
BuildRequires:  python2-devel
%if 0%{?with_python3}
BuildRequires:  python3-devel
%endif # if with_python3

%description
This module provides basic functions for parsing mime-type names
and matching them against a list of media-ranges.

%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary:        Python module for parsing mime-type names
Group:          Development/Languages

%description -n python3-%{srcname}
This module provides basic functions for parsing mime-type names
and matching them against a list of media-ranges.
%endif # with_python3

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

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3

%build
CFLAGS="%{optflags}" %{__python} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="%{optflags}" %{__python3} setup.py build
popd
%endif # with_python3

%check
%{__python} mimeparse_test.py

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} mimeparse_test.py
popd
%endif # with_python3

%install
# Must do the python3 install first because the scripts in /usr/bin are
# overwritten with every setup.py install (and we want the python2 version
# to be the default for now).
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3

%{__python} setup.py install --skip-build --root %{buildroot}

%files
%doc README
%{python_sitelib}/*

%if 0%{?with_python3}
%files -n python3-%{srcname}
%doc README
%{python3_sitelib}/*
%endif # with_python3

%changelog
* Tue Nov 22 2011 Jan Kaluza <jkaluza@redhat.com> - 0.1.3-2
- python3 support disabled
- removed useless spec file directives
- run upstream test

* Wed Nov 02 2011 Jan Kaluza <jkaluza@redhat.com> - 0.1.3-1
- Initial version