Blame python-pyobd.spec

9aed3d
%global srcname pyobd
9aed3d
%global ver_major 0
9aed3d
%global ver_minor 9
9aed3d
%global ver_patch 3
9aed3d
%global ver %{ver_major}.%{ver_minor}.%{ver_patch}
9aed3d
9aed3d
Name:           python-%{srcname}
9aed3d
Version:        %{ver}
239e43
Release:        16%{?dist}
9aed3d
Summary:        OBD-II (SAE-J1979) compliant scan tool software
331066
# CC-BY-SA for icon, see README.Fedora for details
331066
License:        GPLv2+ and CC-BY-SA
9aed3d
# contact for patches: support@secons.com
9aed3d
# upstream refuses patches to support "Chinese" ELM32X
9aed3d
URL:            http://www.obdtester.com/
9aed3d
Source0:        http://www.obdtester.com/download/%{srcname}_%{ver_major}.%{ver_minor}.%{ver_patch}.tar.gz
9aed3d
Source1:        pyobd-icon.svg
9aed3d
Source2:        README.Fedora
9aed3d
BuildArch:      noarch
9aed3d
# import from pyobd module
9aed3d
Patch0:         python-pyobd-0.9.3-pyobd-module.patch
239e43
Patch1:         python-pyobd-0.9.3-invalid-device-traceback-fix.patch
239e43
Patch2:         python-pyobd-0.9.3-configure-dialog-traceback-fix.patch
9aed3d
BuildRequires:  desktop-file-utils
9aed3d
BuildRequires:  dos2unix, ImageMagick
9aed3d
9aed3d
%global _description \
9aed3d
pyOBD is an OBD-II (SAE-J1979) compliant scan tool software written \
9aed3d
entirely in Python. It is meant to interface with the low cost ELM 32x \
9aed3d
devices such as ELM-USB.
9aed3d
9aed3d
%description
9aed3d
%{_description}
9aed3d
9aed3d
%package -n python2-%{srcname}
81d36e
Summary:        %{summary}
9aed3d
%{?python_provide:%python_provide python2-%{srcname}}
81d36e
BuildRequires:  python2-devel, python2-wxpython
81d36e
Provides:       pyobd = %{ver}
81d36e
Obsoletes:      pyobd < 0.9.3-7
81d36e
Requires:       python2-pyserial, python2-wxpython, hicolor-icon-theme
9aed3d
9aed3d
%description -n python2-%{srcname}
9aed3d
%{_description}
9aed3d
9aed3d
Python 2 version.
9aed3d
9aed3d
%prep
9aed3d
%setup -q -n %{srcname}-%{ver_major}.%{ver_minor}.%{ver_patch}
9aed3d
9aed3d
cp -p %{SOURCE2} README.Fedora
9aed3d
9aed3d
# convert CR/LF to LF
9aed3d
dos2unix pyobd.desktop
9aed3d
# fix encoding settings
9aed3d
sed -i '/Encoding=/ s|UTF8|UTF-8|' pyobd.desktop
9aed3d
# change icon in pyobd.desktop
9aed3d
sed -i 's|/usr/share/pyobd/pyobd.gif|pyobd|' pyobd.desktop
9aed3d
# create dummy module init
9aed3d
[ -f __init__.py ] || echo '# module init' > __init__.py
9aed3d
9aed3d
# remove hashbangs
9aed3d
for f in *.py
9aed3d
do
9aed3d
  sed -i '/^[ \t]*#!\/usr\/bin\/env/ d' $f
9aed3d
done
9aed3d
9aed3d
# fix hashbang
9aed3d
sed -i '1 s|/usr/bin/env python|%{__python2}|' pyobd
9aed3d
9aed3d
%patch0 -p1 -b .pyobd-module
239e43
%patch1 -p1 -b .invalid-device-traceback-fix
239e43
%patch2 -p1 -b .configure-dialog-traceback-fix
9aed3d
9aed3d
%build
9aed3d
9aed3d
%install
9aed3d
mkdir -p %{buildroot}%{_bindir}
9aed3d
install -pm 0755 pyobd %{buildroot}%{_bindir}
9aed3d
9aed3d
mkdir -p %{buildroot}%{python2_sitelib}/%{srcname}
9aed3d
install -pm 0644 -t %{buildroot}%{python2_sitelib}/%{srcname} *.py
9aed3d
9aed3d
# icon
9aed3d
install -Dpm 0644 %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/pyobd.svg
9aed3d
9aed3d
# desktop file
9aed3d
mkdir -p  %{buildroot}%{_datadir}/applications
9aed3d
desktop-file-install --add-category="Utility" \
9aed3d
  --dir=%{buildroot}%{_datadir}/applications \
9aed3d
  pyobd.desktop
9aed3d
9aed3d
%files -n python2-%{srcname}
9aed3d
%license COPYING
9aed3d
%doc README.Fedora
1ad507
%{_datadir}/icons/hicolor/scalable/apps/%{srcname}.svg
9aed3d
%{_datadir}/applications/pyobd.desktop
9aed3d
%{python2_sitelib}/pyobd/
9aed3d
%{_bindir}/pyobd
9aed3d
9aed3d
%changelog
239e43
* Tue Jun 18 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-16
239e43
- Fixed configure dialog traceback
239e43
- Unified names of patches
239e43
81d36e
* Mon Mar 25 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-15
81d36e
- Fixed requires
81d36e
  Resolves: rhbz#1692145
81d36e
2299d7
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-14
2299d7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
2299d7
1ad507
* Thu Aug  9 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-13
1ad507
- Dropped ownership of icon directories
1ad507
  Resolves: rhbz#1607835
1ad507
c76e4c
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-12
c76e4c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
c76e4c
e379d0
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-11
e379d0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e379d0
483290
* Thu Jan 18 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.9.3-10
483290
- Remove obsolete scriptlets
483290
331066
* Mon Jan 15 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-9
331066
- Added license for icon
331066
  Resolves: rhbz#1534147
331066
9aed3d
* Fri Nov  3 2017 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-8
9aed3d
- Fixed according to re-review
9aed3d
  Resolves: rhbz#1481645
9aed3d
9aed3d
* Tue Aug 15 2017 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-7
9aed3d
- Renamed to be compliant with Fedora Packaging Guidelines
9aed3d
  Resolves: rhbz#1471175
9aed3d
9aed3d
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-6
9aed3d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
9aed3d
9aed3d
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-5
9aed3d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9aed3d
9aed3d
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-4
9aed3d
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
9aed3d
9aed3d
* Tue Jun 28 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-3
9aed3d
- Fixed exception if device cannot be opened
9aed3d
  Resolves: rhbz#1231476
9aed3d
9aed3d
* Tue Mar 22 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-2
9aed3d
- New SVG icon
9aed3d
9aed3d
* Fri Feb 19 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.3-1
9aed3d
- New version
9aed3d
  Resolves: rhbz#1310008
9aed3d
9aed3d
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2.2-6
9aed3d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9aed3d
9aed3d
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2.2-5
9aed3d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
9aed3d
9aed3d
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2.2-4
9aed3d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
9aed3d
9aed3d
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2.2-3
9aed3d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
9aed3d
9aed3d
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2.2-2
9aed3d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
9aed3d
9aed3d
* Wed Jul 18 2012 Jaroslav Škarvada <jskarvad@redhat.com> - 0.9.2.2-1
9aed3d
- Initial release