Skip to content

Commit

Permalink
#3494 add python3-pkgconfig so we can build python3-lz4 against the s…
Browse files Browse the repository at this point in the history
…ystem library
  • Loading branch information
totaam committed Mar 21, 2022
1 parent fccf2cc commit d8ddb50
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 6 deletions.
1 change: 1 addition & 0 deletions packaging/rpm/centos-8-rpms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gstreamer1-plugin-timestamp
libyuv
x264-xpra
ffmpeg-xpra
python3-pkgconfig
python3-lz4
python3-pbr
python3-rencode
Expand Down
13 changes: 7 additions & 6 deletions packaging/rpm/python3-lz4.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name: python3-%{srcname}
Version: 3.0.2
Release: 6%{?dist}
Release: 8%{?dist}
URL: https://github.com/%{name}/%{name}
Summary: LZ4 Bindings for Python
License: BSD
Expand All @@ -16,21 +16,22 @@ BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
#BuildRequires: python3-pkgconfig
BuildRequires: python3-pkgconfig


%description
Python 3 bindings for the lz4 compression library.


%prep
sha256=`sha256sum %{SOURCE0} | awk '{print $1}'`
if [ "${sha256}" != "9c9f6a8b71c18c24bd83537a4d616f0301623a5e98db7c7ca956d608e1bcd4c7" ]; then
echo "invalid checksum for %{SOURCE0}"
exit 1
fi
%autosetup -n %{srcname}-%{version} -p1
# Keep the bundled lz4 instead of the system lib
# since we don't have python3-pkgconfig to locate it
#rm lz4libs/lz4*.[ch]
# remove bundled lib so we build against the system lib:
rm lz4libs/lz4*.[ch]


%build
Expand All @@ -56,5 +57,5 @@ PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch} %{__python3} -c "import lz4"


%changelog
* Mon Mar 21 2022 Antoine Martin <antoine@xpra.org> - 3.0.2-6
* Mon Mar 21 2022 Antoine Martin <antoine@xpra.org> - 3.0.2-8
- initial packaging for CentOS 8 based on the Fedora spec file
58 changes: 58 additions & 0 deletions packaging/rpm/python3-pkgconfig.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
%define _disable_source_fetch 0
%global srcname pkgconfig
%{?python_provide:%python_provide python3-%{srcname}}

Name: python3-%{srcname}
Version: 1.5.5
Release: 1%{?dist}
Summary: Python interface to the pkg-config command line tool

License: MIT
URL: https://github.com/matze/pkgconfig
Source: %{pypi_source}

BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: %{_bindir}/pkg-config


%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.


%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
%py3_build


%install
%py3_install


%files -n python3-%{srcname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/


%changelog
* Mon Mar 21 2022 Antoine Martin <antoine@xpra.org> - 1.5.5-1
- initial packaging for CentOS 8 based on the Fedora spec file

0 comments on commit d8ddb50

Please sign in to comment.