diff options
author | root <root@rshg054.dnsready.net> | 2011-08-20 23:14:32 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2011-08-20 23:14:32 +0000 |
commit | 839141249778baa4dba0f0511c52b5eded3cd934 (patch) | |
tree | 6c3df2941048911b4126ea70a46816110bddf514 /testing/gpsd | |
parent | c6a4d3790fc33558d9af322dac15d2bd6d34ac0b (diff) |
Sat Aug 20 23:14:32 UTC 2011
Diffstat (limited to 'testing/gpsd')
-rw-r--r-- | testing/gpsd/PKGBUILD | 78 | ||||
-rwxr-xr-x | testing/gpsd/gpsd | 43 | ||||
-rw-r--r-- | testing/gpsd/gpsd.install | 16 |
3 files changed, 137 insertions, 0 deletions
diff --git a/testing/gpsd/PKGBUILD b/testing/gpsd/PKGBUILD new file mode 100644 index 000000000..d4c1119cd --- /dev/null +++ b/testing/gpsd/PKGBUILD @@ -0,0 +1,78 @@ +# $Id: PKGBUILD 135847 2011-08-19 16:38:40Z andrea $ +# Maintainer: Andrea Scarpino <andrea@archlinux.org> +# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org +# Contributor: Giacomo Rizzo <alt@free-os.it> + +pkgname=gpsd +pkgver=3.0 +pkgrel=1 +pkgdesc="GPS daemon and library to support USB/serial GPS devices" +arch=('i686' 'x86_64') +url="http://gpsd.berlios.de" +license=('BSD') +depends=('python2' 'libusb' 'bluez' 'desktop-file-utils') +optdepends=('php: generate a PHP status page for your GPS' + 'php-gd: image support for the PHP status page') +makedepends=('scons' 'docbook-xsl' 'chrpath') +backup=('etc/conf.d/gpsd' 'lib/udev/rules.d/99-gpsd-usb.rules') +options=('!libtool' '!buildflags') +install="${pkgname}.install" +source=("http://download.berlios.de/${pkgname}/${pkgname}-${pkgver}.tar.gz" + 'gpsd') +md5sums=('c63d41a26868e9bdd48d9e311a9cc42c' + 'e287d4b34a4eb1da27f12533ae9b6dd5') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + # fix python 2.7 path + 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 + + scons prefix=/usr \ + systemd=yes \ + libQgpsmm=no \ + PYTHONPATH=/usr/bin/python2 + scons build +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + export DESTDIR="${pkgdir}" + scons install + + # Our own udev-install since the Makefile uses absolute paths + # Original file names are [mostly] unmodified: useful to match process name in case of error + # Following the switch from hotplug to udev helper scripts now live in /lib/udev/ instead of /etc/hotplug/ + sed -i 's|GPSD_OPTIONS=""|GPSD_OPTIONS="-P /var/run/gpsd/gpsd.pid"|' packaging/deb/etc_default_gpsd + sed -i 's|"/var/run/gpsd.sock"|"/var/run/gpsd/gpsd.sock"|' packaging/deb/etc_default_gpsd + install -D -m644 "packaging/deb/etc_default_gpsd" "${pkgdir}/etc/conf.d/gpsd" + + install -D -m644 "gpsd.rules" "${pkgdir}/lib/udev/rules.d/99-gpsd-usb.rules" + + sed -i 's|/etc/default/gpsd|/etc/conf.d/gpsd|' gpsd.hotplug + install -D -m755 gpsd.hotplug "${pkgdir}/lib/udev/gpsd.hotplug" + + # GPSD needs RPATH + chrpath -r /usr/lib/ "${pkgdir}"/usr/lib/libgps{,d}.so.20.0.0 + chrpath -r /usr/lib/ "${pkgdir}"/usr/bin/{gpsdecode,gpsctl,gpspipe,gpxlogger,lcdgps} + chrpath -r /usr/lib/ "${pkgdir}"/usr/sbin/{gpsd,gpsdctl} + + install -D -m644 packaging/X11/xgps.desktop \ + "${pkgdir}/usr/share/applications/xgps.desktop" + install -D -m644 packaging/X11/xgpsspeed.desktop \ + "${pkgdir}/usr/share/applications/xgpsspeed.desktop" + install -D -m644 packaging/X11/gpsd-logo.png \ + "${pkgdir}/usr/share/gpsd/gpsd-logo.png" + + install -D -m755 "${srcdir}/gpsd" "${pkgdir}/etc/rc.d/gpsd" + + install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} +md5sums=('c63d41a26868e9bdd48d9e311a9cc42c' + '0d5879df32833ca67a5491ce1ff98dcc') diff --git a/testing/gpsd/gpsd b/testing/gpsd/gpsd new file mode 100755 index 000000000..cc8b1ec74 --- /dev/null +++ b/testing/gpsd/gpsd @@ -0,0 +1,43 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +[ -f /etc/conf.d/gpsd ] && . /etc/conf.d/gpsd + +NAME=gpsd +DAEMON=/usr/sbin/$NAME +PID=$(pidof -o %PPID /usr/sbin/gpsd) + +case "$1" in + start) + stat_busy "Starting gpsd" + [ ! -d /var/run/gpsd ] && install -d /var/run/gpsd + [ -z "$PID" ] && "$DAEMON" ${GPSD_OPTIONS} -F ${GPSD_SOCKET} ${DEVICES} + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon gpsd + stat_done + fi + ;; + stop) + stat_busy "Stopping gpsd" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm -f /var/run/gpsd/$PID.pid &>/dev/null + rm_daemon gpsd + stat_done + fi + ;; + + restart) + $0 stop + sleep 2 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/gpsd/gpsd.install b/testing/gpsd/gpsd.install new file mode 100644 index 000000000..ee661fcb1 --- /dev/null +++ b/testing/gpsd/gpsd.install @@ -0,0 +1,16 @@ +post_install() { + echo ">>> Note: the supplied gpsd udev rules are device-specific, so" + echo ">>> if your device isn't detected correctly, please use lsusb or" + echo ">>> another suitable tool to determine the proper device IDs and" + echo ">>> use the commented rules to fill in the blanks for your device." + + update-desktop-database -q +} + +post_upgrade() { + update-desktop-database -q +} + +post_remove() { + update-desktop-database -q +} |