desktop/gpsd/PKGBUILD
2015-01-07 06:03:34 +00:00

73 lines
2.5 KiB
Bash

# Maintainer Bruce Liu <brli@users.sourceforge.net>
pkgname=gpsd
pkgver=3.11
pkgrel=1
pkgdesc="GPS daemon and library to support USB/serial GPS devices"
arch=('x86_64')
url="http://catb.org/gpsd/"
screenshot="http://www.catb.org/gpsd/gpsd2.png"
license=('BSD')
depends=('python2' 'libusb' 'bluez-libs' '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')
options=('!libtool')
install="${pkgname}.install"
source=("http://download.savannah.gnu.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig})
md5sums=('ba28369992886fccb85ce560e4727e20'
'SKIP')
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}"
msg 'Fix man pages path '
sed -i 's|.so gps.1|.so man1/gps.1|' cgps.1 lcdgps.1 xgps.1 xgpsspeed.1
msg 'Installation'
export DESTDIR="${pkgdir}"
scons install
sed -i 's|/lib/udev/gpsd|/usr/lib/udev/gpsd|' gpsd.rules
install -D -m644 "gpsd.rules" "${pkgdir}/usr/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}/usr/lib/udev/gpsd.hotplug"
msg '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}
# chrpath -r /usr/lib/ "${pkgdir}"/usr/lib/python2.7/site-packages/gps/{clienthelpers,packet}.so
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 -m644 systemd/gpsd.service "${pkgdir}/usr/lib/systemd/system/gpsd.service"
install -D -m644 systemd/gpsd.socket "${pkgdir}/usr/lib/systemd/system/gpsd.socket"
install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}