From ac897acdc31830ee6ed260aff392ff39d90078e51417a7c35409bb538ee3bda6 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 16 Jun 2025 06:22:17 +0000 Subject: [PATCH] - Switch to pyroject macros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cstruct?expand=0&rev=16 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + python-cstruct-5.3.tar.gz | 3 ++ python-cstruct.changes | 78 +++++++++++++++++++++++++++++++++++++++ python-cstruct.spec | 67 +++++++++++++++++++++++++++++++++ 5 files changed, 172 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-cstruct-5.3.tar.gz create mode 100644 python-cstruct.changes create mode 100644 python-cstruct.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-cstruct-5.3.tar.gz b/python-cstruct-5.3.tar.gz new file mode 100644 index 0000000..9d54746 --- /dev/null +++ b/python-cstruct-5.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:499f6a4356eeaf33d662fd9b4deee3b90e186a0ff12bdab2775bc657bdfc5c19 +size 38987 diff --git a/python-cstruct.changes b/python-cstruct.changes new file mode 100644 index 0000000..dbfce4f --- /dev/null +++ b/python-cstruct.changes @@ -0,0 +1,78 @@ +------------------------------------------------------------------- +Mon Jun 16 06:12:20 UTC 2025 - Steve Kowalik + +- Switch to pyroject macros. + +------------------------------------------------------------------- +Mon Jan 8 20:58:43 UTC 2024 - Dirk Müller + +- update to 5.3: + * fix struct in struct array parsing + * Python 3.12 support + +------------------------------------------------------------------- +Tue Dec 6 01:00:29 UTC 2022 - Yogalakshmi Arunachalam + +- Update to version 5.2 + Fix + - nested struct unpack fix + - nested anonymous union offset fix + - inspect offset for nested struct/union fix + +- Update to version 5.1 + Improved + * Support unpack from ctype pointers + Added + * Add support for char constants + * Add native type test + * dir.py example + +------------------------------------------------------------------- +Sat Nov 12 11:16:08 UTC 2022 - Martin Hauke + +- Update to version 5.0 + * Add support for enums + * Add support for multiple definition to cstruct.parse + * Add inspect method + +------------------------------------------------------------------- +Fri Nov 4 19:12:43 UTC 2022 - Martin Hauke + +- Update to version 4.0 + * Add enum support to cstruct.parse + * Add typedef parsing + +------------------------------------------------------------------- +Mon Oct 24 15:29:46 UTC 2022 - Martin Hauke + +- Update to version 3.3 + * Fix tests on 32bit architecture +- Update to version 3.2 + * Add more tests + +------------------------------------------------------------------- +Fri Oct 14 13:45:17 UTC 2022 - Martin Hauke + +- Update to version 3.1 + * Make CStruct/MemCStruct Pickle Friendly +- Update to version 3.0 + * Flexible array support +- Update to version 2.3 + * Fix compare with None +- Update to version 2.2 + Fixes + * Fix empty MemCStruct size + Improvements + * Python 3.10 support + * pytest + * black code style + +------------------------------------------------------------------- +Thu Oct 13 07:17:06 UTC 2022 - Dirk Müller + +- use https for urls + +------------------------------------------------------------------- +Thu Aug 13 20:29:38 UTC 2020 - Martin Hauke + +- Initial package, version 1.8 diff --git a/python-cstruct.spec b/python-cstruct.spec new file mode 100644 index 0000000..c2b4951 --- /dev/null +++ b/python-cstruct.spec @@ -0,0 +1,67 @@ +# +# spec file for package python-cstruct +# +# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2020-2022, Martin Hauke +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: python-cstruct +Version: 5.3 +Release: 0 +Summary: C-style structs for Python +License: MIT +Group: Development/Languages/Python +URL: https://github.com/andreax79/python-cstruct +Source: https://github.com/andreax79/python-cstruct/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%python_subpackages + +%description +Convert C struct definitions into Python classes with methods for +serializing/deserializing. The usage is very simple: create a class +subclassing cstruct.CStruct and add a C struct definition as a +string in the struct field. The C struct definition is parsed at +runtime and the struct format string is generated. The class offers +the method "unpack" for deserializing a string of bytes into a +Python object and the method "pack" for serializing the values into +a string. + +%prep +%setup -q + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand find %{buildroot}%{$python_sitelib} -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \; +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%license LICENSE +%doc changelog.txt README.md +%{python_sitelib}/cstruct +%{python_sitelib}/cstruct-%{version}.dist-info + +%changelog