summaryrefslogtreecommitdiff
path: root/extra/gpsd/PKGBUILD
blob: 3068d223ff5ed6ffd4ca36bcf816c588a9a4a96b (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
# $Id: PKGBUILD 140082 2011-10-06 08:10:19Z 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.1
pkgrel=1
pkgdesc="GPS daemon and library to support USB/serial GPS devices"
arch=('i686' 'x86_64' 'mips64el')
url="http://catb.org/gpsd/"
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'
            'pygtk: GUI frontends')
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.savannah.gnu.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        'gpsd' 'gpsd.conf.d')
md5sums=('f783c2890774fcafa56bdb968a0372fc'
         '1f3402f8e33a7032b9ae6dfd077234f7'
         '3e963df3f9f7ef3572ecc648ae829315')

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}"

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

  export DESTDIR="${pkgdir}"
  scons install

  install -D -m644 "${srcdir}/gpsd.conf.d" "${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"
}