diff --git a/add-setup.py.patch b/add-setup.py.patch new file mode 100644 index 0000000000000000000000000000000000000000..03b3eac7763404d21bcccee4c932c75c22f23fa7 --- /dev/null +++ b/add-setup.py.patch @@ -0,0 +1,11 @@ +--- c/setup.py 1970-01-01 08:00:00.000000000 +0800 ++++ a/setup.py 2022-12-15 15:38:39.095326150 +0800 +@@ -0,0 +1,8 @@ ++#!/usr/bin/env python ++from setuptools import setup ++ ++ ++setup( ++ name = "bitstring", ++ version = "4.0.1" ++ ) diff --git a/bitstring-4.0.1.tar.gz b/bitstring-4.0.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..595ff63bc795f0a001404dbe697d43a367e85b4f Binary files /dev/null and b/bitstring-4.0.1.tar.gz differ diff --git a/bitstring-bitstring-3.1.9.tar.gz b/bitstring-bitstring-3.1.9.tar.gz deleted file mode 100644 index f1fec7e554de86ce2d196b2147a18ee3373b2c8a..0000000000000000000000000000000000000000 Binary files a/bitstring-bitstring-3.1.9.tar.gz and /dev/null differ diff --git a/python-bitstring.spec b/python-bitstring.spec index 06e512202d0025ea024739060d9052ab8b76e885..7ea0f793459a8daf92e3535625edfe22f011fb68 100644 --- a/python-bitstring.spec +++ b/python-bitstring.spec @@ -1,121 +1,97 @@ -%{?!_without_python2:%global with_python2 0%{?_with_python2:1} || !(0%{?fedora} >= 30 || 0%{?rhel} >= 8)} -%{?!_without_python3:%global with_python3 0%{?_with_python3:1} || !0%{?rhel} || 0%{?rhel} >= 7} -%global srcname bitstring - -Name: python-%{srcname} -Version: 3.1.9 -Release: 1 -Summary: Simple construction, analysis and modification of binary data -License: MIT -URL: https://github.com/scott-griffiths/%{srcname} -Source0: https://github.com/scott-griffiths/%{srcname}/archive/%{srcname}-%{version}/%{srcname}-%{srcname}-%{version}.tar.gz - -BuildArch: noarch - -BuildRequires: dos2unix +%global _empty_manifest_terminate_build 0 + +Name: python-bitstring +Version: 4.0.1 +Release: 1 +Summary: Simple construction, analysis and modification of binary data +License: MIT +URL: https://github.com/scott-griffiths/%{srcname} +Source0: https://files.pythonhosted.org/packages/d2/64/e733b18349be383a4b7859c865d6c9e5ccc5845e9b4258504055607ec1cb/bitstring-4.0.1.tar.gz +Patch0: add-setup.py.patch +BuildArch: noarch %description bitstring is a pure Python module designed to help make the creation and analysis of binary data as simple and natural as possible. - Bitstrings can be constructed from integers (big and little endian), hex, octal, binary, strings or files. They can be sliced, joined, reversed, inserted into, overwritten, etc. with simple functions or slice notation. They can also be read from, searched and replaced, and navigated in, similar to a file or stream. - -%if 0%{?with_python2} -%package -n python2-%{srcname} -Summary: %{summary} -BuildRequires: python2-devel -BuildRequires: python2-pytest -%{?python_provide:%python_provide python2-%{srcname}} - -%description -n python2-%{srcname} +%package -n python3-bitstring +Summary: Simple construction, analysis and modification of binary data +Provides: python-bitstring = %{version}-%{release} +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-pytest +%description -n python3-bitstring bitstring is a pure Python module designed to help make the creation and analysis of binary data as simple and natural as possible. - Bitstrings can be constructed from integers (big and little endian), hex, octal, binary, strings or files. They can be sliced, joined, reversed, inserted into, overwritten, etc. with simple functions or slice notation. They can also be read from, searched and replaced, and navigated in, similar to a file or stream. -%endif - -%if 0%{?with_python3} -%package -n python%{python3_pkgversion}-%{srcname} -Summary: %{summary} -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-pytest -%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} -%description -n python%{python3_pkgversion}-%{srcname} +%package help +Summary: Development documents and examples for bitstring +Provides: python3-bitstring-doc +%description help bitstring is a pure Python module designed to help make the creation and analysis of binary data as simple and natural as possible. - Bitstrings can be constructed from integers (big and little endian), hex, octal, binary, strings or files. They can be sliced, joined, reversed, inserted into, overwritten, etc. with simple functions or slice notation. They can also be read from, searched and replaced, and navigated in, similar to a file or stream. -%endif %prep -%autosetup -n %{srcname}-%{srcname}-%{version} - -dos2unix README.rst release_notes.txt -sed -i '1{s|^#!/usr/bin/env python||}' %{srcname}.py +%autosetup -n bitstring-%{version} %build -%if 0%{?with_python2} -%py2_build -%endif - -%if 0%{?with_python3} %py3_build -%endif %install -%if 0%{?with_python2} -%py2_install -%endif - -%if 0%{?with_python3} %py3_install -%endif - -%check -pushd test -%if 0%{?with_python2} -%{__python2} -m pytest -%endif - -%if 0%{?with_python3} -%{__python3} -m pytest -%endif +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 +if [ -f README.rst ]; then cp -af README.rst %{buildroot}/%{_pkgdocdir}; fi +if [ -f README.md ]; then cp -af README.md %{buildroot}/%{_pkgdocdir}; fi +if [ -f README.txt ]; then cp -af README.txt %{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 . -%if 0%{?with_python2} -%files -n python2-%{srcname} -%license LICENSE -%doc README.rst release_notes.txt -%{python2_sitelib}/%{srcname}.py -%{python2_sitelib}/%{srcname}.py[co] -%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info -%endif - -%if 0%{?with_python3} -%files -n python%{python3_pkgversion}-%{srcname} -%license LICENSE -%doc README.rst release_notes.txt -%{python3_sitelib}/%{srcname}.py -%{python3_sitelib}/__pycache__/%{srcname}.cpython-%{python3_version_nodots}*.pyc -%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info -%endif +%files -n python3-bitstring -f filelist.lst +%dir %{python3_sitelib}/* +%files help -f doclist.lst +%{_docdir}/* %changelog +* Thu Dec 15 2022 wangjunqi - 4.0.1-1 +- Update package to version 4.0.1 + * Tue Nov 15 2022 hkgy - 3.1.9-1 - Upgrade to v3.1.9