summaryrefslogtreecommitdiffstats
path: root/gpsd/Pkgfile
blob: ffb75dc7c728fe9bfaded6586e4c20d34099fc7c (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
48
49
50
# Description: Démon et bibliothèque de gestion de GPS
# URL: http://catb.org/gpsd/
# Packager: piernov <piernov@piernov.org>
# Maintainer: NuTyX Core Team
# Depends on: scons, chrpath, libusb, bluez, desktop-file-utils, pygtk
# Run on: libusb,bluez,desktop-file-utils,pygtk

name=gpsd
version=3.4
release=1
source=(http://download-mirror.savannah.gnu.org/releases/$name/$name-$version.tar.gz
	gpsd.conf
	gpsd.rc)

build() {
	cd $name-$version
	# Correction de chemins pour Python2.7
	sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" $(find . -name '*.py')
	sed -i "s|/usr/bin/env python|/usr/bin/env python2|" gegps gpscat gpsfake gpsprof xgps xgpsspeed

	python2 /usr/bin/scons prefix=/usr \
		systemd=yes \
		libQgpsmm=no \
		PYTHONPATH=/usr/bin/python2
	python2 /usr/bin/scons build

	# Correction du chemin des pages man
	sed -i 's|.so gps.1|.so man1/gps.1|' cgps.1 lcdgps.1 xgps.1 xgpsspeed.1

	export DESTDIR=$PKG
	python2 /usr/bin/scons install

	install -D -m644 ../gpsd.conf $PKG/etc/sysconfig/gpsd
	install -D -m644 gpsd.rules $PKG/lib/udev/rules.d/99-gpsd-usb.rules

	sed -i 's|/etc/default/gpsd|/etc/sysconfig/gpsd|' gpsd.hotplug
	install -D -m755 gpsd.hotplug $PKG/lib/udev/gpsd.hotplug

	# GPSD needs RPATH
	chrpath -r /usr/lib/ $PKG/usr/lib/libgps{,d}.so.20.0.0
	chrpath -r /usr/lib/ $PKG/usr/bin/{gpsdecode,gpsctl,gpspipe,gpxlogger,lcdgps}
	chrpath -r /usr/lib/ $PKG/usr/sbin/{gpsd,gpsdctl}
	chrpath -r /usr/lib/ $PKG/usr/lib/python2.7/site-packages/gps/{clienthelpers,packet}.so

	install -D -m644 packaging/X11/xgps.desktop $PKG/usr/share/applications/xgps.desktop
	install -D -m644 packaging/X11/xgpsspeed.desktop $PKG/usr/share/applications/xgpsspeed.desktop
	install -D -m644 packaging/X11/gpsd-logo.png $PKG/usr/share/gpsd/gpsd-logo.png

	install -D -m755 ../gpsd.rc $PKG/etc/rc.d/init.d/gpsd
}