[pyobd] Initial release
Jaroslav Škarvada
jskarvad at fedoraproject.org
Wed Aug 15 11:44:47 UTC 2012
commit 49d4567ce0aa041f3a7c37c90806c372e4219d30
Author: Jaroslav Škarvada <jskarvad at redhat.com>
Date: Wed Aug 15 13:44:09 2012 +0200
Initial release
.gitignore | 1 +
pyobd-0.9.2-pyobd-module.patch | 32 +++++++++++++++
pyobd.spec | 87 ++++++++++++++++++++++++++++++++++++++++
sources | 1 +
4 files changed, 121 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..1089373 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/pyobd_0.9.2-2.tar.gz
diff --git a/pyobd-0.9.2-pyobd-module.patch b/pyobd-0.9.2-pyobd-module.patch
new file mode 100644
index 0000000..0d55e2b
--- /dev/null
+++ b/pyobd-0.9.2-pyobd-module.patch
@@ -0,0 +1,32 @@
+diff -up pyobd-0.9.2/pyobd.orig pyobd-0.9.2/pyobd
+--- pyobd-0.9.2/pyobd.orig 2010-06-20 16:47:06.000000000 +0200
++++ pyobd-0.9.2/pyobd 2012-07-18 12:19:44.287953089 +0200
+@@ -27,7 +27,7 @@
+ #wxversion.select("2.6")
+ import wx
+
+-import obd_io #OBD2 funcs
++import pyobd.obd_io as obd_io #OBD2 funcs
+ import os #os.environ
+
+ import threading
+@@ -38,8 +38,8 @@ import time
+ import ConfigParser #safe application configuration
+ import webbrowser #open browser from python
+
+-from obd2_codes import pcodes
+-from obd2_codes import ptest
++from pyobd.obd2_codes import pcodes
++from pyobd.obd2_codes import ptest
+
+ from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin
+
+@@ -104,7 +104,7 @@ class TestEvent(wx.PyEvent):
+ self.data = data
+
+ #defines notification event for debug tracewindow
+-from debugEvent import *
++from pyobd.debugEvent import *
+
+ class MyApp(wx.App):
+ # A listctrl which auto-resizes the column boxes to fill
diff --git a/pyobd.spec b/pyobd.spec
new file mode 100644
index 0000000..1844c33
--- /dev/null
+++ b/pyobd.spec
@@ -0,0 +1,87 @@
+%global ver_major 0
+%global ver_minor 9
+%global ver_patch 2
+%global ver_rel 2
+%global ver %{ver_major}.%{ver_minor}.%{ver_patch}.%{ver_rel}
+
+Name: pyobd
+Version: %{ver}
+Release: 1%{?dist}
+Summary: OBD-II (SAE-J1979) compliant scantool software
+Group: Applications/Engineering
+License: GPLv2+
+URL: http://www.obdtester.com/
+Source0: http://www.obdtester.com/download/%{name}_%{ver_major}.%{ver_minor}.%{ver_patch}-%{ver_rel}.tar.gz
+BuildArch: noarch
+# import from pyobd module
+Patch0: pyobd-0.9.2-pyobd-module.patch
+Requires: pyserial, wxPython
+BuildRequires: python2-devel, pyserial, wxPython, desktop-file-utils
+BuildRequires: dos2unix, ImageMagick
+
+%description
+pyOBD is an OBD-II (SAE-J1979) compliant scantool software written
+entirely in Python. It is meant to interface with the low cost ELM 32x
+devices such as ELM-USB.
+
+%prep
+%setup -q -n %{name}-%{ver_major}.%{ver_minor}.%{ver_patch}
+
+# convert CR/LF to LF
+dos2unix pyobd.desktop
+# fix encoding settings
+sed -i '/Encoding=/ s|UTF8|UTF-8|' pyobd.desktop
+# convert GIF icon to PNG
+convert pyobd.gif pyobd.png
+# change icon in pyobd.desktop
+sed -i 's|/usr/share/pyobd/pyobd.gif|pyobd|' pyobd.desktop
+# create dummy module init
+[ -f __init__.py ] || echo '# module init' > __init__.py
+
+# remove hashbangs
+for f in *.py
+do
+ sed -i '/^[ \t]*#!\/usr\/bin\/env/ d' $f
+done
+
+%patch0 -p1 -b .pyobd-module
+
+%build
+
+%install
+mkdir -p %{buildroot}%{_bindir}
+install -m 0755 pyobd %{buildroot}%{_bindir}
+
+mkdir -p %{buildroot}%{python_sitelib}/%{name}
+install -m 0644 -t %{buildroot}%{python_sitelib}/%{name} *.py
+
+mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
+install -m 0644 pyobd.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
+
+mkdir -p %{buildroot}%{_datadir}/applications
+desktop-file-install --add-category="Utility" \
+ --dir=%{buildroot}%{_datadir}/applications \
+ pyobd.desktop
+
+%post
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
+%postun
+if [ $1 -eq 0 ] ; then
+ /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ /usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
+%posttrans
+/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
+
+%files
+%doc COPYING
+%{_datadir}/icons/*
+%{_datadir}/applications/pyobd.desktop
+%{python_sitelib}/pyobd/
+%{_bindir}/pyobd
+
+%changelog
+* Wed Jul 18 2012 Jaroslav Škarvada <jskarvad at redhat.com> - 0.9.2.2-1
+- Initial release
diff --git a/sources b/sources
index e69de29..19beb36 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+6f376dfdf461036cceb7ad7a9496c35d pyobd_0.9.2-2.tar.gz
More information about the scm-commits
mailing list