summaryrefslogtreecommitdiff
path: root/testing/gpsd/PKGBUILD
blob: d26892a8abc52c504df34f4ce1c5fef0adf8612a (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# $Id: PKGBUILD 116032 2011-03-22 16:23:53Z 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=2.96
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=('lesstif' 'libxaw' 'python2' 'pth' 'libusb' 'desktop-file-utils')
optdepends=('php: generate a PHP status page for your GPS'
            'php-gd: image support for the PHP status page')
makedepends=('docbook-xsl')
backup=('etc/conf.d/gpsd' 'lib/udev/rules.d/99-gpsd-usb.rules')
options=('!libtool')
install="${pkgname}.install"
source=("http://download.berlios.de/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        'gpsd' 'LICENSE')
md5sums=('26a7a04d4298bc3a3a5d89fef4582b64'
         'f929322fc4670543fcb36dafc7bb9e03'
         'd217a23f408e91c94359447735bc1800')

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

  # install python to the same DESTDIR given make
  sed -i 's|--prefix=${prefix} # --root=$(DESTDIR)|--prefix=${prefix} --root=$(DESTDIR)|' Makefile.am Makefile.in

  # fix python 2.7 path
  sed -i 's|/usr/bin/python|/usr/bin/python2|' gpsd.hotplug{,.wrapper}
  sed -i 's|/usr/bin/python2.6|/usr/bin/python2|' valgrind-audit
  sed -i 's|/usr/bin/env python|/usr/bin/env python2|' gpscat \
    gpsfake gpsprof xgps xgpsspeed gps/gps.py
  
  PYTHON=/usr/bin/python2 ./configure --prefix=/usr \
    --disable-libQgpsmm \
    --disable-static
  make
}

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

  # Fix man pages path (FS#21715)
  sed -i 's|.so gps.1|.so man1/gps.1|' cgps.1 lcdgps.1 xgps.1 xgpsspeed.1

  make DESTDIR="${pkgdir}" 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.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"

  sed -i 's|Id: gpsd.rules|Id: 99-gpsd-usb.rules|' gpsd.rules
  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.wrapper
  install -D -m755 gpsd.hotplug.wrapper "${pkgdir}/lib/udev/gpsd.hotplug.wrapper"

  # Patch a path bug. Check to see if fixed in ensuing releases
  sed -i 's|gpsdcmd = "gpsd %s|gpsdcmd = "/usr/sbin/gpsd %s|' gpsd.hotplug
  install -D -m755 gpsd.hotplug "${pkgdir}/lib/udev/gpsd.hotplug"

  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 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}