commit e58956ed7ff53e41d971808735e54ac9be1d4e01875de3c7e33cba4331df4979 Author: Matej Cepl Date: Thu Jul 4 23:16:17 2024 +0000 Accepting request 1185437 from home:adrianSuSE:branches:devel:languages:python Required for python-esptool 4.7 OBS-URL: https://build.opensuse.org/request/show/1185437 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-intelhex?expand=0&rev=1 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/intelhex-2.3.0.tar.gz b/intelhex-2.3.0.tar.gz new file mode 100644 index 0000000..bcf1ac6 --- /dev/null +++ b/intelhex-2.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:892b7361a719f4945237da8ccf754e9513db32f5628852785aea108dcd250093 +size 44513 diff --git a/python-intelhex.changes b/python-intelhex.changes new file mode 100644 index 0000000..91aecd3 --- /dev/null +++ b/python-intelhex.changes @@ -0,0 +1,10 @@ +------------------------------------------------------------------- +Sun May 2 22:45:38 UTC 2021 - Matej Cepl + +- Rename executables to ih_* as not to conflict with the ones from + the hex2bin package. + +------------------------------------------------------------------- +Fri Apr 2 17:08:33 UTC 2021 - Matej Cepl + +- Initial packaging of intelhex 2.3.0 diff --git a/python-intelhex.spec b/python-intelhex.spec new file mode 100644 index 0000000..b44c240 --- /dev/null +++ b/python-intelhex.spec @@ -0,0 +1,93 @@ +# +# spec file for package python-intelhex +# +# Copyright (c) 2021 SUSE LLC +# +# 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/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-intelhex +Version: 2.3.0 +Release: 0 +Summary: Python library for Intel HEX files manipulations +License: BSD-3-Clause +URL: https://github.com/python-intelhex/intelhex +Source: https://files.pythonhosted.org/packages/source/i/intelhex/intelhex-%{version}.tar.gz +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun):update-alternatives +BuildArch: noarch +%python_subpackages + +%description +The Intel HEX file format is widely used in microprocessors and +microcontrollers area (embedded systems etc) as the de facto standard +for representation of code to be programmed into microelectronic +devices. + +This work implements an ``intelhex`` Python library to read, write, +create from scratch and manipulate data from Intel HEX file format. + +The distribution package also includes several convenience Python scripts, +including "classic" ``hex2bin`` and ``bin2hex`` converters and more, +those based on the library itself. Check the docs to know more. + +%prep +%autosetup -p1 -n intelhex-%{version} + +sed -i -e '/^#!\s*\/usr\/bin\/.*python/d' intelhex/bench.py + +%build +%python_build + +%install +%python_install +for exe in bin2hex hex2bin hex2dump hexdiff hexinfo hexmerge ; do +mv %{buildroot}%{_bindir}/$exe.py %{buildroot}%{_bindir}/ih_$exe +%python_clone -a %{buildroot}%{_bindir}/ih_$exe +done +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pyunittest discover -v + +%post +%python_install_alternative ih_bin2hex +%python_install_alternative ih_hex2bin +%python_install_alternative ih_hex2dump +%python_install_alternative ih_hexdiff +%python_install_alternative ih_hexinfo +%python_install_alternative ih_hexmerge + +%postun +%python_uninstall_alternative ih_bin2hex +%python_uninstall_alternative ih_hex2bin +%python_uninstall_alternative ih_hex2dump +%python_uninstall_alternative ih_hexdiff +%python_uninstall_alternative ih_hexinfo +%python_uninstall_alternative ih_hexmerge + +%files %{python_files} +%python_alternative %{_bindir}/ih_bin2hex +%python_alternative %{_bindir}/ih_hex2bin +%python_alternative %{_bindir}/ih_hex2dump +%python_alternative %{_bindir}/ih_hexdiff +%python_alternative %{_bindir}/ih_hexinfo +%python_alternative %{_bindir}/ih_hexmerge + +%{python_sitelib}/intelhex* + +%changelog