diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..0a80fdce31f59c062e2abba28776e9521eddff30 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..d0d47074223525afc9c248e9203f8391d48bf198 --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/python-zstd diff --git a/python-zstd-1.5.5.1-test-external.patch b/python-zstd-1.5.5.1-test-external.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d34fa61284065e1bd90940fa7aa30dca9e91f1e --- /dev/null +++ b/python-zstd-1.5.5.1-test-external.patch @@ -0,0 +1,11 @@ +--- a/setup.py ++++ b/setup.py +@@ -119,6 +119,8 @@ else: + class ZstdBuildExt( build_ext ): + + def build_extensions(self): ++ if 'test' in sys.argv: return ++ + c = self.compiler.compiler_type + if c in COPT: + for e in self.extensions: diff --git a/python-zstd.spec b/python-zstd.spec index 3b138b4137e14a9bbf0bd4fcde46ce232ba8da56..4f66ffe23f07238645b5557f9d90b52eeb51eca2 100644 --- a/python-zstd.spec +++ b/python-zstd.spec @@ -1,76 +1,74 @@ -%global _empty_manifest_terminate_build 0 Name: python-zstd -Version: 1.5.5.1 +Version: 1.5.7.2 Release: 1 Summary: ZSTD Bindings for Python License: BSD-2-Clause URL: https://github.com/sergey-dryabzhinsky/python-zstd -Source0: https://files.pythonhosted.org/packages/ba/b4/bf8c6a6b73c6b267a13df955f821f041fcc770b56820b135849f33e3b888/zstd-1.5.5.1.tar.gz +Source0: %{pypi_source zstd} +Patch0: python-zstd-1.5.5.1-test-external.patch %description Simple Python bindings for the Zstd compression library. %package -n python3-zstd Summary: %{summary} -Provides: python3-zstd # Base build requires BuildRequires: gcc BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-cffi +BuildRequires: pkgconfig(libzstd) >= 1.5.7 +Requires: zstd%{?_isa} >= %(rpm -q --queryformat="%%{VERSION}" zstd) + %description -n python3-zstd Simple Python bindings for the Zstd compression library. %package help Summary: ZSTD Bindings for Python Provides: python3-zstd-doc +Buildarch: noarch %description help Simple Python bindings for the Zstd compression library. %prep -%autosetup -n zstd-%{version} +%autosetup -n zstd-%{version} -p1 +# Remove bundled egg-info +rm -rf src/%{pypi_name}.egg-info +# Remove bundled zstd library +rm -rf zstd/ +# do not test the version matching, we don't really need exact version of +# zstd here +rm tests/test_version.py +sed -i -e '/tests\.test_version/d' setup.py +sed -i -e '/test_version/d' tests/__init__.py +# do not test the spped when building with external libs +rm tests/test_speed.py +sed -i -e '/tests\.test_speed/d' setup.py +sed -i -e '/test_speed/d' tests/__init__.py %build -%py3_build +%py3_build -- --external %install %py3_install -install -d -m755 %{buildroot}/%{_pkgdocdir} -if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi -if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi -if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi -if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi -pushd %{buildroot} -if [ -d usr/lib ]; then - find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/lib64 ]; then - find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/bin ]; then - find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/sbin ]; then - find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst -fi -touch doclist.lst -if [ -d usr/share/man ]; then - find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst -fi -popd -mv %{buildroot}/filelist.lst . -mv %{buildroot}/doclist.lst . %check -%{__python3} setup.py test +PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \ +%{__python3} -m unittest -v -%files -n python3-zstd -f filelist.lst -%dir %{python3_sitearch}/* +%files -n python3-zstd +%license LICENSE +%{python3_sitearch}/zstd* -%files help -f doclist.lst -%{_docdir}/* +%files help +%doc README.rst %changelog +* Mon Jul 14 2025 Funda Wang - 1.5.7.2-1 +- update to version 1.5.7.2 +- build with system zstd +- fix test usage + * Fri Apr 07 2023 Ge Wang - 1.5.5.1-1 - Update to version 1.5.5.1 diff --git a/zstd-1.5.5.1.tar.gz b/zstd-1.5.5.1.tar.gz deleted file mode 100644 index 9ddcf1e687d23eae0203a4937823c986e40ab93c..0000000000000000000000000000000000000000 Binary files a/zstd-1.5.5.1.tar.gz and /dev/null differ diff --git a/zstd-1.5.7.2.tar.gz b/zstd-1.5.7.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1709476cb4c3f195d0476941aed8cb6c77fb8cca --- /dev/null +++ b/zstd-1.5.7.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d8684c69009be49e1b18ec251a5eb0d7e24f93624990a8a124a1da66a92fc8a +size 670481