Oreon-Lime-R2/python-pkgconfig/python-pkgconfig.spec

113 lines
2.8 KiB
RPMSpec
Raw Permalink Normal View History

%global srcname pkgconfig
%if 0%{?fedora} && 0%{?fedora} <= 30
%bcond_without python2
%else
%bcond_with python2
%endif
Name: python-%{srcname}
Version: 1.5.5
Release: 9%{?dist}
Summary: Python interface to the pkg-config command line tool
License: MIT
URL: https://github.com/matze/pkgconfig
Source: %{pypi_source}
BuildArch: noarch
%description
pkgconfig is a Python module to interface with the pkg-config command line
tool and supports Python 2.6+.
It can be used to
* check if a package exists
* check if a package meets certain version requirements
* query CFLAGS and LDFLAGS
* parse the output to build extensions with setup.py
If pkg-config is not on the path, raises EnvironmentError.
%if %{with python2}
%package -n python2-%{srcname}
Summary: Python2 interface to the pkg-config ocmmand line tool
%{?python_provide:%python_provide python2-%{srcname}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
Requires: %{_bindir}/pkg-config
%description -n python2-%{srcname}
pkgconfig is a Python module to interface with the pkg-config command line
tool and supports Python 2.6+.
It can be used to
* check if a package exists
* check if a package meets certain version requirements
* query CFLAGS and LDFLAGS
* parse the output to build extensions with setup.py
If pkg-config is not on the path, raises EnvironmentError.
Python 2 version.
%endif
%package -n python3-%{srcname}
Summary: Python3 interface to the pkg-config command line tool
%{?python_provide:%python_provide python3-%{srcname}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: %{_bindir}/pkg-config
%description -n python3-%{srcname}
pkgconfig is a Python module to interface with the pkg-config command line
tool and supports Python 2.6+.
It can be used to
* check if a package exists
* check if a package meets certain version requirements
* query CFLAGS and LDFLAGS
* parse the output to build extensions with setup.py
If pkg-config is not on the path, raises EnvironmentError.
Python 3 version.
%prep
%autosetup -n %{srcname}-%{version}
# We need to keep egg-info as a directory
# https://github.com/sdispater/poetry/issues/866
sed -i -e s/distutils.core/setuptools/ setup.py
%build
%if %{with python2}
%py2_build
%endif
%py3_build
%install
%if %{with python2}
%py2_install
%endif
%py3_install
%if %{with python2}
%files -n python2-%{srcname}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{srcname}-*.egg-info/
%{python2_sitelib}/%{srcname}/
%endif
%files -n python3-%{srcname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/
%changelog
* Fri May 24 2024 Brandon Lester <blester@oreonproject.org> - 1.5.5-9
- Port to Oreon