[packages/python3-zstd] - new

baggins baggins at pld-linux.org
Sat Apr 9 11:47:35 CEST 2022


commit 80096f57aedf99e8629442a3f7330c6d7b36b5cb
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Apr 9 11:47:18 2022 +0200

    - new

 python3-zstd.spec   | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 unbundle-zstd.patch | 14 ++++++++++
 2 files changed, 90 insertions(+)
---
diff --git a/python3-zstd.spec b/python3-zstd.spec
new file mode 100644
index 0000000..fcd3c7e
--- /dev/null
+++ b/python3-zstd.spec
@@ -0,0 +1,76 @@
+#
+# Conditional build:
+%bcond_without	tests	# unit tests
+
+%define		module	zstd
+Summary:	Simple python bindings to Yann Collet ZSTD compression library
+Name:		python3-%{module}
+Version:	1.5.1.0
+Release:	0.1
+License:	- (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/zstd/
+Source0:	https://files.pythonhosted.org/packages/source/z/zstd/%{module}-%{version}.tar.gz
+# Source0-md5:	fe5e894d6925ee1ff13b824eababf13b
+Patch0:		unbundle-zstd.patch
+URL:		https://pypi.org/project/zstd/
+BuildRequires:	python3-devel >= 1:3.2
+#BuildRequires:	python3-setuptools
+%if %{with tests}
+#BuildRequires:	python3-
+%endif
+# if using noarch subpackage:
+#BuildRequires:	rpm-build >= 4.6
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+BuildRequires:	zstd-devel
+# when using /usr/bin/env or other in-place substitutions
+#BuildRequires:        sed >= 4.0
+%if %{with doc}
+BuildRequires:	sphinx-pdg-3
+%endif
+# replace with other requires if defined in setup.py
+Requires:	python3-modules >= 1:3.2
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Simple python bindings to Yann Collet ZSTD compression library.
+
+%package apidocs
+Summary:	API documentation for Python %{module} module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona %{module}
+Group:		Documentation
+BuildArch:	noarch
+
+%description apidocs
+API documentation for Python %{module} module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona %{module}.
+
+%prep
+%setup -q -n %{module}-%{version}
+%patch0 -p1
+
+# Remove bundled lib
+%{__rm} -rf zstd
+
+# fix #!/usr/bin/env python -> #!/usr/bin/python:
+#%{__sed} -i -e '1s,^#!.*python3,#!%{__python3},' %{name}.py
+
+%build
+%py3_build %{?with_tests:test}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README.rst
+%attr(755,root,root) %{py3_sitedir}/%{module}*.so
+%{py3_sitedir}/%{module}-%{version}-py*.egg-info
diff --git a/unbundle-zstd.patch b/unbundle-zstd.patch
new file mode 100644
index 0000000..6aced25
--- /dev/null
+++ b/unbundle-zstd.patch
@@ -0,0 +1,14 @@
+--- zstd-1.5.1.0/setup.py~	2022-01-03 03:30:38.000000000 +0100
++++ zstd-1.5.1.0/setup.py	2022-04-09 11:41:50.737112512 +0200
+@@ -35,10 +35,9 @@
+ 
+ SUP_EXTERNAL=0
+ ext_libraries=[]
+-if "--external" in sys.argv:
++if True:
+     # You want use external Zstd library?
+     SUP_EXTERNAL=1
+-    sys.argv.remove("--external")
+     # You should add external library by option: --libraries zstd
+     # And probably include paths by option: --include-dirs /usr/include/zstd
+     # And probably library paths by option: --library-dirs /usr/lib/i386-linux-gnu
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-zstd.git/commitdiff/80096f57aedf99e8629442a3f7330c6d7b36b5cb



More information about the pld-cvs-commit mailing list