9aed3df
%global srcname pyobd
9aed3df
%global ver_major 0
9aed3df
%global ver_minor 9
9aed3df
%global ver_patch 3
9aed3df
%global ver %{ver_major}.%{ver_minor}.%{ver_patch}
9aed3df
9aed3df
Name:           python-%{srcname}
9aed3df
Version:        %{ver}
9b07d2f
Release:        27%{?dist}
9aed3df
Summary:        OBD-II (SAE-J1979) compliant scan tool software
3310668
# CC-BY-SA for icon, see README.Fedora for details
3310668
License:        GPLv2+ and CC-BY-SA
9aed3df
# contact for patches: support@secons.com
9aed3df
# upstream refuses patches to support "Chinese" ELM32X
9aed3df
URL:            http://www.obdtester.com/
9aed3df
Source0:        http://www.obdtester.com/download/%{srcname}_%{ver_major}.%{ver_minor}.%{ver_patch}.tar.gz
9aed3df
Source1:        pyobd-icon.svg
9aed3df
Source2:        README.Fedora
9aed3df
BuildArch:      noarch
9aed3df
# import from pyobd module
9aed3df
Patch0:         python-pyobd-0.9.3-pyobd-module.patch
239e431
Patch1:         python-pyobd-0.9.3-invalid-device-traceback-fix.patch
239e431
Patch2:         python-pyobd-0.9.3-configure-dialog-traceback-fix.patch
4f9408a
# part of the patch provided by Lumír Balhar <lbalhar@redhat.com>
4f9408a
Patch3:         python-pyobd-0.9.3-python3.patch
9aed3df
BuildRequires:  desktop-file-utils
9aed3df
BuildRequires:  dos2unix, ImageMagick
9aed3df
9aed3df
%global _description \
9aed3df
pyOBD is an OBD-II (SAE-J1979) compliant scan tool software written \
9aed3df
entirely in Python. It is meant to interface with the low cost ELM 32x \
9aed3df
devices such as ELM-USB.
9aed3df
9aed3df
%description
9aed3df
%{_description}
9aed3df
4f9408a
%package -n python3-%{srcname}
81d36ed
Summary:        %{summary}
4f9408a
%{?python_provide:%python_provide python3-%{srcname}}
4f9408a
BuildRequires:  python3-devel, python3-wxpython4
81d36ed
Provides:       pyobd = %{ver}
81d36ed
Obsoletes:      pyobd < 0.9.3-7
4f9408a
Requires:       python3-pyserial, python3-wxpython4, hicolor-icon-theme
9aed3df
4f9408a
%description -n python3-%{srcname}
9aed3df
%{_description}
9aed3df
4f9408a
Python 3 version of the pyOBD.
9aed3df
9aed3df
%prep
9aed3df
%setup -q -n %{srcname}-%{ver_major}.%{ver_minor}.%{ver_patch}
9aed3df
9aed3df
cp -p %{SOURCE2} README.Fedora
9aed3df
9aed3df
# convert CR/LF to LF
9aed3df
dos2unix pyobd.desktop
9aed3df
# fix encoding settings
9aed3df
sed -i '/Encoding=/ s|UTF8|UTF-8|' pyobd.desktop
9aed3df
# change icon in pyobd.desktop
9aed3df
sed -i 's|/usr/share/pyobd/pyobd.gif|pyobd|' pyobd.desktop
9aed3df
# create dummy module init
9aed3df
[ -f __init__.py ] || echo '# module init' > __init__.py
9aed3df
9aed3df
# remove hashbangs
9aed3df
for f in *.py
9aed3df
do
9aed3df
  sed -i '/^[ \t]*#!\/usr\/bin\/env/ d' $f
9aed3df
done
9aed3df
9aed3df
# fix hashbang
4f9408a
sed -i '1 s|/usr/bin/env python|%{__python3}|' pyobd
9aed3df
4f9408a
%patch0 -p1
4f9408a
%patch1 -p1
4f9408a
%patch2 -p1
4f9408a
%patch3 -p1
9aed3df
9aed3df
%build
9aed3df
9aed3df
%install
9aed3df
mkdir -p %{buildroot}%{_bindir}
9aed3df
install -pm 0755 pyobd %{buildroot}%{_bindir}
9aed3df
4f9408a
mkdir -p %{buildroot}%{python3_sitelib}/%{srcname}
4f9408a
install -pm 0644 -t %{buildroot}%{python3_sitelib}/%{srcname} *.py
9aed3df
9aed3df
# icon
9aed3df
install -Dpm 0644 %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/pyobd.svg
9aed3df
9aed3df
# desktop file
9aed3df
mkdir -p  %{buildroot}%{_datadir}/applications
9aed3df
desktop-file-install --add-category="Utility" \
9aed3df
  --dir=%{buildroot}%{_datadir}/applications \
9aed3df
  pyobd.desktop
9aed3df
4f9408a
%files -n python3-%{srcname}
9aed3df
%license COPYING
9aed3df
%doc README.Fedora
1ad507b
%{_datadir}/icons/hicolor/scalable/apps/%{srcname}.svg
9aed3df
%{_datadir}/applications/pyobd.desktop
4f9408a
%{python3_sitelib}/pyobd/
9aed3df
%{_bindir}/pyobd
9aed3df
9aed3df
%changelog
9b07d2f
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-27
9b07d2f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
9b07d2f
0c1592d
* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 0.9.3-26
0c1592d
- Rebuilt for Python 3.11
0c1592d
6c48b15
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-25
6c48b15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
6c48b15
46f788a
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-24
46f788a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
46f788a
782c833
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.9.3-23
782c833
- Rebuilt for Python 3.10
782c833
6e44db4
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-22
6e44db4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
6e44db4
b4c7db7
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-21
b4c7db7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
b4c7db7
bddd7f2
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.9.3-20
bddd7f2
- Rebuilt for Python 3.9
bddd7f2
b160c63
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-19
b160c63
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
b160c63
4f9408a
* Fri Nov  8 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-18
4f9408a
- Switched to python3
4f9408a
  Resolves: rhbz#1738099
4f9408a
f8ea025
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-17
f8ea025
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
f8ea025
239e431
* Tue Jun 18 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-16
239e431
- Fixed configure dialog traceback
239e431
- Unified names of patches
239e431
81d36ed
* Mon Mar 25 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-15
81d36ed
- Fixed requires
81d36ed
  Resolves: rhbz#1692145
81d36ed
2299d75
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-14
2299d75
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
2299d75
1ad507b
* Thu Aug  9 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-13
1ad507b
- Dropped ownership of icon directories
1ad507b
  Resolves: rhbz#1607835
1ad507b
c76e4c8
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-12
c76e4c8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
c76e4c8
e379d0d
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-11
e379d0d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e379d0d
4832903
* Thu Jan 18 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.9.3-10
4832903
- Remove obsolete scriptlets
4832903
3310668
* Mon Jan 15 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-9
3310668
- Added license for icon
3310668
  Resolves: rhbz#1534147
3310668
9aed3df
* Fri Nov  3 2017 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-8
9aed3df
- Fixed according to re-review
9aed3df
  Resolves: rhbz#1481645
9aed3df
9aed3df
* Tue Aug 15 2017 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-7
9aed3df
- Renamed to be compliant with Fedora Packaging Guidelines
9aed3df
  Resolves: rhbz#1471175
9aed3df
9aed3df
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-6
9aed3df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
9aed3df
9aed3df
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-5
9aed3df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9aed3df
9aed3df
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-4
9aed3df
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
9aed3df
9aed3df
* Tue Jun 28 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-3
9aed3df
- Fixed exception if device cannot be opened
9aed3df
  Resolves: rhbz#1231476
9aed3df
9aed3df
* Tue Mar 22 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-2
9aed3df
- New SVG icon
9aed3df
9aed3df
* Fri Feb 19 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-1
9aed3df
- New version
9aed3df
  Resolves: rhbz#1310008
9aed3df
9aed3df
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2.2-6
9aed3df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9aed3df
9aed3df
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2.2-5
9aed3df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
9aed3df
9aed3df
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2.2-4
9aed3df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
9aed3df
9aed3df
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2.2-3
9aed3df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
9aed3df
9aed3df
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2.2-2
9aed3df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
9aed3df
9aed3df
* Wed Jul 18 2012 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.2.2-1
9aed3df
- Initial release