# Contributor: Nathan Angelacos # Maintainer: Nathan Angelacos pkgname=gpsd pkgver=3.18.1 pkgrel=2 pkgdesc="A GPS daemon" arch=all url="http://catb.org/gpsd/" license="BSD" makedepends="scons python3-dev libcap-dev ncurses-dev" subpackages="$pkgname-dev $pkgname-doc py3-$pkgname:_py $pkgname-clients:_clients" source="https://download-mirror.savannah.gnu.org/releases/gpsd/$pkgname-$pkgver.tar.gz timepps.h gpsd-use-local-timepps-header.patch 0001-workaround-for-scons-using-python2.patch ttydefaults.patch gpsd.initd gpsd.confd" builddir="$srcdir/$pkgname-$pkgver" options="!check" # FIXME: tests fails prepare() { # We copy timepps.h to the local build directory instead of # creating a pps-tools-dev package for ppstime.h # (See https://github.com/ago/pps-tools) mkdir -p "$builddir"/sys cp "$srcdir"/timepps.h "$builddir"/sys/ default_prepare } build() { cd "$builddir" CPPFLAGS="-I. -DHAVE_SYS_TIMEPPS_H" scons -j${JOBS:-1} \ prefix=/usr \ target_python=python3 } check() { cd "$builddir" scons check } package() { cd "$builddir" DESTDIR="$pkgdir" scons install # fix python interpreter path sed -e "s,#!/usr/bin/\(python[23]\?\|env \+python[23]\?\),#!/usr/bin/python3},g" -i \ gegps gpscat gpsfake xgps xgpsspeed gpsprof gps/*.py install -m755 -D "$srcdir"/gpsd.initd "$pkgdir"/etc/init.d/gpsd install -m644 -D "$srcdir"/gpsd.confd "$pkgdir"/etc/conf.d/gpsd } _py() { local _py=${subpkgname##-*} local _pyver=${_py%py} pkgdesc="$pkgname library and clients for python $_pyver" mkdir -p "$subpkgdir"/usr/lib # As of 3.18.1, gpsd wants to put the python stuff in /usr/local mv "$pkgdir"/usr/local/lib/python* "$subpkgdir"/usr/lib/ rm -rf "$pkgdir"/usr/local mkdir -p "$subpkgdir"/usr/bin for n in gpscat gpsfake gpsprof; do mv "$pkgdir"/usr/bin/${n} "$subpkgdir"/usr/bin/ done } _clients() { pkgdesc="$pkgname clients" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin } sha512sums="b381b177fcd29089a61aa11f5df2c67473720a6bbc5590ca1c4fda627331c407de01c62caceeddae780626b9a02392e9a770d52a143357e1babdcc2fbff0ed38 gpsd-3.18.1.tar.gz eb11fc19243d1789016d88eb7645bfe67c46304547781489bf36eb1dd4c252d523681ff835a6488fa0ef62b6b9e2f781c672279f4439f5d5640a3f214a113048 timepps.h b918e4b32a6e8bcd25d126e4f1a78dfdda30837a64e7d829f04b27e138843a1dbec83e64677edd6f88eca8cead511949ee664066de4429641ba248fe5a7768ef gpsd-use-local-timepps-header.patch ab64ec2e28a00d94e71218462b755131f4c5c7ac39db5e914135c9009a3b8d7dca2b5762ea0b9b5859785294ed0db42234ff044ef82185b2c08f96a9ba50f4f0 0001-workaround-for-scons-using-python2.patch e2af8f52fc2d7e663882b6d12c5f4d709aa267b16eb9aeca2a70d8ecc681ae72359f3efcd1636cde576bc8579e008f242574bc0adfab7252d3e763f039e86135 ttydefaults.patch a0e7bf206ad51c31195f86f79ef92adca425d7f988534c0f70a2dd3053613f6fc46820d62d0330aaef7ca100b5f2ab781ce9643f25b4c99c844ae66e7eec5cbc gpsd.initd 55d4a51f82d445d3ac93b2855132ef4380908ed045feba6298ed1d0b607cd9054b5325c024dc52b370983ebd5d9b377537aee7d7128c97aa22e3075f4134d404 gpsd.confd"