From 29e430d3632e0cf74386dcd15acf96520e346d78 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Fri, 2 Feb 2024 20:00:00 +0000 Subject: [PATCH] Version 1.2.4 --- README.md | 13 +++++++--- archlinux/PKGBUILD | 43 ++++++++++++++++++++++++++++++++ debian/changelog | 4 +-- debian/control | 2 +- debian/copyright | 2 +- debian/deb.sh | 8 +++--- fedora/python-radexreader.spec | 19 ++++++++------ fedora/rpm.sh | 14 +++++------ opensuse/python-radexreader.spec | 15 ++++++----- opensuse/rpm.sh | 14 +++++------ pypi/pypi.sh | 6 ++--- src/radexreader.py | 2 +- src/radexreader/__init__.py | 16 ++++++------ src/setup.py | 8 +++--- 14 files changed, 113 insertions(+), 53 deletions(-) create mode 100644 archlinux/PKGBUILD diff --git a/README.md b/README.md index 6a710fa..43ad2fe 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,20 @@ pub rsa4096 2020-10-31 [SC] ## Copyright -- Current version: 1.2.3 (10/10/2023) +- Current version: 1.2.4 (02/02/2024) - Compatibility: Python 3.3 / 3.4 / 3.5 / 3.6 / 3.7 / 3.8 / 3.9 / 3.10 / 3.11 / 3.12 -- Links: [luigifab.fr](https://www.luigifab.fr/python/radexreader) - [github.com](https://github.com/luigifab/python-radexreader) - [pypi.org](https://pypi.org/project/radexreader/)\ -[Debian python-radexreader.deb](https://packages.debian.org/python3-radexreader)\ +- Links: [luigifab.fr](https://www.luigifab.fr/python/radexreader) - [github.com](https://github.com/luigifab/python-radexreader) - [PyPI](https://pypi.org/project/radexreader/)\ +[Arch Linux python-radexreader.zst](https://aur.archlinux.org/packages/python-radexreader)\ +[Debian python-radexreader.deb](https://packages.debian.org/python3-radexreader) + *([ITP](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973447), + [RFS](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=974217))*\ [Fedora python-radexreader.rpm](https://src.fedoraproject.org/rpms/python-radexreader)\ [openSUSE python-radexreader.rpm](https://software.opensuse.org/package/python-radexreader)\ [Ubuntu PPA](https://launchpad.net/~luigifab/+archive/ubuntu/packages) This program is provided under the terms of the **GNU GPLv2+** license.\ If you like, take some of your time to improve some translations, go to https://bit.ly/2HyCCEc. + +## Packages in official distros repositories + +[![Packages status](https://repology.org/badge/vertical-allrepos/python:radexreader.svg?header=radexreader)](https://repology.org/project/python:radexreader/versions) diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD new file mode 100644 index 0000000..1197d48 --- /dev/null +++ b/archlinux/PKGBUILD @@ -0,0 +1,43 @@ +pkgname=python-radexreader +pkgver=1.2.4 +pkgrel=1 +pkgdesc="Reader for the RADEX RD1212 and ONE Geiger counters" +arch=('any') +url='https://github.com/luigifab/python-radexreader' +license=('GPL2') +depends=('python-pyusb' 'python-pyserial') +makedepends=('python-setuptools') +source=("https://github.com/luigifab/python-radexreader/archive/v${pkgver}/python-radexreader-${pkgver}.tar.gz") +md5sums=("...") + +prepare() { + cd "$pkgname-$pkgver" + sed -i 's/python3-radexreader /python3-radexreader-zst /g' src/radexreader.py + sed -i 's/\#\!\/usr\/bin\/python3/\#/g' src/radexreader/__init__.py +} + +build() { + cd "$pkgname-$pkgver/src" + python setup.py build +} + +package() { + cd "$pkgname-$pkgver/src" + python setup.py install --root="${pkgdir}" --optimize=1 --skip-build + + mkdir -p "$pkgdir/usr/bin/" + install -pm 755 radexreader.py "$pkgdir/usr/bin/" + + mkdir -p "$pkgdir/usr/share/doc/$pkgname/" + install -pm 644 ../README.md "$pkgdir/usr/share/doc/$pkgname/" + + mkdir -p "$pkgdir/usr/share/licenses/$pkgname/" + install -pm 644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/" + + mkdir -p "$pkgdir/usr/share/man/man1/" "$pkgdir/usr/share/man/fr/man1/" + install -pm 644 ../debian/radexreader.1 "$pkgdir/usr/share/man/man1/$pkgname.1" + install -pm 644 ../debian/radexreader.fr.1 "$pkgdir/usr/share/man/fr/man1/$pkgname.1" + + mkdir -p "$pkgdir/usr/lib/udev/rules.d/" + install -pm 644 ../debian/udev "$pkgdir/usr/lib/udev/rules.d/60-$pkgname.rules" +} \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index 07e5957..38618ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -python-radexreader (1.2.3-1) experimental; urgency=low +python-radexreader (1.2.4-1) experimental; urgency=low * Initial Debian package release (Closes: #973447) - -- Fabrice Creuzot Tue, 10 Oct 2023 20:00:00 +0000 + -- Fabrice Creuzot Fri, 02 Feb 2024 20:00:00 +0000 diff --git a/debian/control b/debian/control index 1b417a5..332e574 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Fabrice Creuzot Build-Depends: debhelper-compat (= 13), python3-all, dh-python, dh-exec Rules-Requires-Root: no -Standards-Version: 4.6.1.0 +Standards-Version: 4.6.2 Homepage: https://github.com/luigifab/python-radexreader Vcs-Browser: https://github.com/luigifab/python-radexreader Vcs-Git: https://github.com/luigifab/python-radexreader.git diff --git a/debian/copyright b/debian/copyright index 16427de..0909460 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,7 +3,7 @@ Source: https://github.com/luigifab/python-radexreader Upstream-Contact: Fabrice Creuzot Files: * -Copyright: 2020-2023 Fabrice Creuzot (luigifab) +Copyright: 2020-2024 Fabrice Creuzot (luigifab) License: GPL-2+ License: GPL-2+ diff --git a/debian/deb.sh b/debian/deb.sh index 2981dc4..87cee96 100644 --- a/debian/deb.sh +++ b/debian/deb.sh @@ -3,11 +3,11 @@ cd "$(dirname "$0")" -version="1.2.3" +version="1.2.4" -rm -rf builder/ mkdir builder +rm -rf builder/* # copy to a tmp directory if [ true ]; then @@ -31,10 +31,10 @@ fi # create packages for Debian and Ubuntu -for serie in experimental mantic lunar jammy focal bionic xenial trusty; do +for serie in experimental noble mantic jammy focal bionic xenial trusty; do if [ $serie = "experimental" ]; then - # for Ubuntu + # copy for Ubuntu cp -a builder/python-radexreader-$version/ builder/python-radexreader-$version+src/ # Debian only cd builder/python-radexreader-$version/ diff --git a/fedora/python-radexreader.spec b/fedora/python-radexreader.spec index 26b0c8d..0e6f515 100644 --- a/fedora/python-radexreader.spec +++ b/fedora/python-radexreader.spec @@ -18,7 +18,7 @@ Pour éviter un Access denied (insufficient permissions), n'oubliez pas de débrancher l'appareil après l'installation.} Name: python-radexreader -Version: 1.2.3 +Version: 1.2.4 Release: 1%{?dist} Summary: %{common_summary_en} Summary(fr): %{common_summary_fr} @@ -61,12 +61,14 @@ cd src cd src %py3_install mkdir -p %{buildroot}%{_bindir}/ -mkdir -p %{buildroot}/lib/udev/rules.d/ +install -pm 755 radexreader.py %{buildroot}%{_bindir}/radexreader + mkdir -p %{buildroot}%{_mandir}/man1/ %{buildroot}%{_mandir}/fr/man1/ -install -p -m 755 ../src/radexreader.py %{buildroot}%{_bindir}/radexreader -install -p -m 644 ../debian/radexreader.1 %{buildroot}%{_mandir}/man1/radexreader.1 -install -p -m 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/radexreader.1 -install -p -m 644 ../debian/udev %{buildroot}/lib/udev/rules.d/60-python3-radexreader.rules +install -pm 644 ../debian/radexreader.1 %{buildroot}%{_mandir}/man1/radexreader.1 +install -pm 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/radexreader.1 + +mkdir -p %{buildroot}/lib/udev/rules.d/ +install -pm 644 ../debian/udev %{buildroot}/lib/udev/rules.d/60-%{name}.rules %files -n python3-radexreader %license LICENSE @@ -76,10 +78,13 @@ install -p -m 644 ../debian/udev %{buildroot}/lib/udev/rules.d/60-python3-radexr %{_bindir}/radexreader %{_mandir}/man1/radexreader.1* %{_mandir}/*/man1/radexreader.1* -/lib/udev/rules.d/60-python3-radexreader.rules +/lib/udev/rules.d/60-%{name}.rules %changelog +* Fri Feb 02 2024 Fabrice Creuzot - 1.2.4-1 +- New upstream release + * Tue Oct 10 2023 Fabrice Creuzot - 1.2.3-1 - New upstream release diff --git a/fedora/rpm.sh b/fedora/rpm.sh index e75c1e0..568a48e 100644 --- a/fedora/rpm.sh +++ b/fedora/rpm.sh @@ -3,11 +3,11 @@ # Fedora: configure: error: C compiler cannot create executables? remove and reinstall glibc-devel gcc cd "$(dirname "$0")" -version="1.2.3" +version="1.2.4" -rm -rf builder/ mkdir -p builder ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} +find builder/* ! -name "*$version*.rpm" ! -name "*$version*.gz" -exec rm -rf {} + 2>/dev/null # copy to a tmp directory if [ true ]; then @@ -20,7 +20,7 @@ else rm -rf /tmp/$temp/*/builder/ /tmp/$temp/radexreader/__pycache__/ mv /tmp/$temp builder/ - cp /usr/share/licenses/linux-firmware/GPL-2 builder/$temp/LICENSE + cp /usr/share/licenses/*-firmware/GPL-2 builder/$temp/LICENSE # * = linux cd builder/ tar czf $temp.tar.gz $temp @@ -32,10 +32,10 @@ fi # create package (rpm sign https://access.redhat.com/articles/3359321) rpmbuild -ba python-radexreader.spec -rpm --addsign ~/rpmbuild/RPMS/*/*.rpm -rpm --addsign ~/rpmbuild/SRPMS/*.rpm -mv ~/rpmbuild/RPMS/*/*.rpm builder/ -mv ~/rpmbuild/SRPMS/*.rpm builder/ +rpm --addsign ~/rpmbuild/RPMS/*/python*radexreader*.rpm +rpm --addsign ~/rpmbuild/SRPMS/python*radexreader*.rpm +mv ~/rpmbuild/RPMS/*/python*radexreader*.rpm builder/ +mv ~/rpmbuild/SRPMS/python*radexreader*.rpm builder/ echo "===========================" rpm --checksig builder/*.rpm echo "===========================" diff --git a/opensuse/python-radexreader.spec b/opensuse/python-radexreader.spec index cd30d22..6989f7a 100644 --- a/opensuse/python-radexreader.spec +++ b/opensuse/python-radexreader.spec @@ -1,6 +1,6 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-radexreader -Version: 1.2.3 +Version: 1.2.4 Release: 0 Summary: Reader for the RADEX RD1212 and ONE Geiger counters License: GPL-2.0-or-later @@ -45,23 +45,23 @@ cd src mkdir -p %{buildroot}%{_bindir}/ mkdir -p %{buildroot}%{_mandir}/man1/ %{buildroot}%{_mandir}/fr/man1/ mkdir -p %{buildroot}%{_udevrulesdir}/ -install -p -m 755 ../src/radexreader.py %{buildroot}%{_bindir}/radexreader -install -p -m 644 ../debian/radexreader.1 %{buildroot}%{_mandir}/man1/radexreader.1 -install -p -m 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/radexreader.1 -%python_expand install -p -m 644 ../debian/udev %{buildroot}%{_udevrulesdir}/60-python%{$python_bin_suffix}-radexreader.rules +install -pm 755 radexreader.py %{buildroot}%{_bindir}/radexreader +install -pm 644 ../debian/radexreader.1 %{buildroot}%{_mandir}/man1/radexreader.1 +install -pm 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/radexreader.1 %python_clone -a %{buildroot}%{_bindir}/radexreader %python_clone -a %{buildroot}%{_mandir}/man1/radexreader.1 %python_clone -a %{buildroot}%{_mandir}/fr/man1/radexreader.1 +%python_expand install -pm 644 ../debian/udev %{buildroot}%{_udevrulesdir}/60-python%{$python_bin_suffix}-radexreader.rules %files %{python_files} %license LICENSE %doc README.md %{python_sitelib}/radexreader/ %{python_sitelib}/radexreader*egg-info/ -%{_udevrulesdir}/60-python%{python_bin_suffix}-radexreader.rules %python_alternative %{_bindir}/radexreader %python_alternative %{_mandir}/man1/radexreader.1%{?ext_man} %python_alternative %{_mandir}/fr/man1/radexreader.1%{?ext_man} +%{_udevrulesdir}/60-python%{python_bin_suffix}-radexreader.rules %post %{python_install_alternative radexreader radexreader.1} @@ -71,6 +71,9 @@ install -p -m 644 ../debian/radexreader.fr.1 %{buildroot}%{_mandir}/fr/man1/rade %changelog +* Fri Feb 02 2024 Fabrice Creuzot - 1.2.4-1 +- New upstream release + * Tue Oct 10 2023 Fabrice Creuzot - 1.2.3-1 - New upstream release diff --git a/opensuse/rpm.sh b/opensuse/rpm.sh index 4dc117c..b1ccb14 100644 --- a/opensuse/rpm.sh +++ b/opensuse/rpm.sh @@ -3,11 +3,11 @@ cd "$(dirname "$0")" -version="1.2.3" +version="1.2.4" -rm -rf builder/ mkdir -p builder ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} +find builder/* ! -name "*$version*.rpm" ! -name "*$version*.gz" -exec rm -rf {} + 2>/dev/null # copy to a tmp directory if [ true ]; then @@ -20,7 +20,7 @@ else rm -rf /tmp/$temp/*/builder/ /tmp/$temp/radexreader/__pycache__/ mv /tmp/$temp builder/ - cp /usr/share/licenses/kernel-firmware/GPL-2 builder/$temp/LICENSE + cp /usr/share/licenses/*-firmware/GPL-2 builder/$temp/LICENSE # * = kernel cd builder/ tar czf $temp.tar.gz $temp @@ -32,10 +32,10 @@ fi # create package (rpm sign https://access.redhat.com/articles/3359321) rpmbuild -ba python-radexreader.spec -rpm --addsign ~/rpmbuild/RPMS/*/*.rpm -rpm --addsign ~/rpmbuild/SRPMS/*.rpm -mv ~/rpmbuild/RPMS/*/*.rpm builder/ -mv ~/rpmbuild/SRPMS/*.rpm builder/ +rpm --addsign ~/rpmbuild/RPMS/*/python*radexreader*.rpm +rpm --addsign ~/rpmbuild/SRPMS/python*radexreader*.rpm +mv ~/rpmbuild/RPMS/*/python*radexreader*.rpm builder/ +mv ~/rpmbuild/SRPMS/python*radexreader*.rpm builder/ echo "===========================" rpm --checksig builder/*.rpm echo "===========================" diff --git a/pypi/pypi.sh b/pypi/pypi.sh index 6d393ce..1463705 100644 --- a/pypi/pypi.sh +++ b/pypi/pypi.sh @@ -3,14 +3,13 @@ # Fedora: sudo dnf install python3-devel cd "$(dirname "$0")" -version="1.2.3" +version="1.2.4" rm -rf builder/ - -# copy to a tmp directory mkdir builder mkdir builder/radexreader-${version} +# copy to a tmp directory cp -r ../src/* builder/radexreader-${version}/ cp ../README.md builder/radexreader-${version}/ cp /usr/share/common-licenses/GPL-2 builder/radexreader-${version}/LICENSE @@ -30,6 +29,7 @@ sed -i 's/Usage: radexreader /Usage: radexreader.py /g' builder/radexreader- + # create package (https://packaging.python.org/tutorials/packaging-projects/) cd builder/radexreader-${version}/ python3 -m pip install --user --upgrade setuptools wheel --no-warn-script-location diff --git a/src/radexreader.py b/src/radexreader.py index 1f45836..ba8ed07 100644 --- a/src/radexreader.py +++ b/src/radexreader.py @@ -3,7 +3,7 @@ # Created L/19/10/2020 # Updated D/08/10/2023 # -# Copyright 2020-2023 | Fabrice Creuzot (luigifab) +# Copyright 2020-2024 | Fabrice Creuzot (luigifab) # https://github.com/luigifab/python-radexreader # # This program is free software, you can redistribute it or modify diff --git a/src/radexreader/__init__.py b/src/radexreader/__init__.py index 419208b..a3f50a4 100644 --- a/src/radexreader/__init__.py +++ b/src/radexreader/__init__.py @@ -1,9 +1,9 @@ #!/usr/bin/python3 # -*- coding: utf8 -*- # Created L/19/10/2020 -# Updated S/07/10/2023 +# Updated L/01/01/2024 # -# Copyright 2020-2023 | Fabrice Creuzot (luigifab) +# Copyright 2020-2024 | Fabrice Creuzot (luigifab) # https://github.com/luigifab/python-radexreader # # This program is free software, you can redistribute it or modify @@ -27,7 +27,7 @@ import serial import serial.tools.list_ports -__version__ = '1.2.3' +__version__ = '1.2.4' class RadexReader(): @@ -218,11 +218,12 @@ def read(self, last=False): 'time': timestamp, 'interval': interval[hexa[8]] } - # to get last measure with RD1212v1 - if last and self.com == 'RD1212v1': - break - # sort by date + # most recent measure + if last: + return dict({ max(values): values[max(values)] }) if len(values) > 0 else values + + # sort measures by date return dict(sorted(values.items(), key=operator.itemgetter(0))) def readOne(self): @@ -279,3 +280,4 @@ def erase(self): self.hid_set_report((0x12, 0x12, 0x01, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0x3c, 0x84)) elif self.com == 'RD1212v1': self.hid_set_report((0x12, 0x12, 0x01, 0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0x3c, 0x84)) + diff --git a/src/setup.py b/src/setup.py index b58f2d1..4825865 100644 --- a/src/setup.py +++ b/src/setup.py @@ -1,9 +1,9 @@ #!/usr/bin/python3 # -*- coding: utf8 -*- # Created L/19/10/2020 -# Updated S/07/10/2023 +# Updated J/12/10/2023 # -# Copyright 2020-2023 | Fabrice Creuzot (luigifab) +# Copyright 2020-2024 | Fabrice Creuzot (luigifab) # https://github.com/luigifab/python-radexreader # # This program is free software, you can redistribute it or modify @@ -26,7 +26,7 @@ long_description = fh.read().replace('(images/', '(https://raw.githubusercontent.com/luigifab/python-radexreader/master/images/') setup( name='radexreader', - version='1.2.3', + version='1.2.4', description='Python library for the RADEX RD1212 and the RADEX ONE Geiger counters.', long_description=long_description, long_description_content_type='text/markdown', @@ -40,7 +40,7 @@ except: setup( name='radexreader', - version='1.2.3', + version='1.2.4', description='Python library for the RADEX RD1212 and the RADEX ONE Geiger counters.', license='GPL 2', author='Fabrice Creuzot',