summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e0a72fc1140b5e7afacf9cde67b69796b21e3f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Maintainer: Presence <dan465 at mail dot com>

pkgname=pyobd
pkgver=0.9.3
pkgrel=2
pkgdesc="An OBD-II compliant car diagnostic tool"
arch=('any')
url="http://www.obdtester.com/pyobd"
license=('GPL')
depends=('wxpython' 'python2-pyserial' 'hicolor-icon-theme')
install=pyobd.install
source=(http://www.obdtester.com/download/${pkgname}_${pkgver}.tar.gz
        fix-configure-dialog.patch
        pyobd.png)
sha256sums=('f3004db4000e2bc166aae3b4342c98aa62f74f3372c5829472af0ee56c5e110c'
            '7537ba8401e1c6dcdad8ffcbb037b9042e10cf957834f83417c60ca0fd2ae14f'
            '14d0d90dcda38c339dc8397f004923075f6d4fce37b7c8539021f4a77b3a86fd')

prepare() {
	cd "$srcdir/${pkgname}-${pkgver}"

	#Fix desktop file
	sed -i -e "s#/usr/share/pyobd/pyobd.gif#$pkgname#" \
		-e "s#python /usr/bin/pyobd#$pkgname#" \
		-e "s#Name=pyOBD: OBD2 Diagnostics#Name=pyOBD\nGenericName=OBD2 Diagnostics#" \
		"pyobd.desktop"

    #Fix configure dialog
    patch -Np1 -i "$srcdir/fix-configure-dialog.patch"

	#Set executable to run with python2
	sed -i "s%#!/usr/bin/env python%#!/usr/bin/python2%" "pyobd"
}

package() {
	cd "$srcdir/${pkgname}-${pkgver}"

	install -Dm644 "pyobd.desktop"      "$pkgdir/usr/share/applications/$pkgname.desktop"
	install -Dm644 "$srcdir/pyobd.png"  "$pkgdir/usr/share/icons/hicolor/32x32/apps/$pkgname.png"
	install -Dm644 "COPYING"            "$pkgdir/usr/share/licenses/$pkgname/COPYING"
	install -Dm755 "pyobd"              "$pkgdir/usr/lib/$pkgname/pyobd"
	install -m644 -t "$pkgdir/usr/lib/$pkgname/" *.py{,c}

	mkdir -p "$pkgdir/usr/bin/"
	ln -sf "../lib/$pkgname/pyobd" "$pkgdir/usr/bin/$pkgname"
}