Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | SUMMARY = "A TCP/IP Daemon simplifying the communication with GPS devices" |
| 2 | SECTION = "console/network" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 3 | LICENSE = "BSD-2-Clause" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=01764c35ae34d9521944bb6ab312af53" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | DEPENDS = "dbus ncurses python3 pps-tools" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 6 | PROVIDES = "virtual/gpsd" |
| 7 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 8 | SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \ |
| 9 | file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \ |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 10 | file://0001-Revert-SConstruct-Add-test-for-sizeof-time_t-result-.patch \ |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 11 | file://0001-gpsd-dbusexport.c-Fix-broken-d-bus-message-time.patch \ |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 12 | file://gpsd.init \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 13 | " |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 14 | SRC_URI[md5sum] = "cf7fdec7ce7221d20bee1a7246362b05" |
| 15 | SRC_URI[sha256sum] = "172a7805068eacb815a3c5225436fcb0be46e7e49a5001a94034eac43df85e50" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 16 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | inherit scons update-rc.d python3-dir python3native systemd update-alternatives |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 18 | |
| 19 | INITSCRIPT_PACKAGES = "gpsd-conf" |
| 20 | INITSCRIPT_NAME = "gpsd" |
| 21 | INITSCRIPT_PARAMS = "defaults 35" |
| 22 | |
| 23 | SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}" |
| 24 | |
| 25 | export STAGING_INCDIR |
| 26 | export STAGING_LIBDIR |
| 27 | |
Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 28 | CLEANBROKEN = "1" |
| 29 | |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 30 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 31 | PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 32 | PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase" |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 33 | PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 34 | EXTRA_OESCONS = " \ |
| 35 | sysroot=${STAGING_DIR_TARGET} \ |
| 36 | libQgpsmm='false' \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 37 | debug='false' \ |
| 38 | nostrip='true' \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 39 | systemd='${SYSTEMD_OESCONS}' \ |
| 40 | libdir='${libdir}' \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 41 | manbuild='false' \ |
Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 42 | LINK='${CC}' \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 43 | ${PACKAGECONFIG_CONFARGS} \ |
| 44 | " |
| 45 | # this cannot be used, because then chrpath is not found and only static lib is built |
| 46 | # target=${HOST_SYS} |
| 47 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 48 | do_compile:prepend() { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 49 | export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" |
| 50 | export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" |
| 51 | export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" |
Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 52 | export LD="${CC}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 53 | export LINKFLAGS="${LDFLAGS}" |
| 54 | } |
| 55 | |
| 56 | do_install() { |
| 57 | export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" |
| 58 | export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" |
| 59 | export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" |
Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 60 | export LD="${CC}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 61 | export LINKFLAGS="${LDFLAGS}" |
| 62 | |
| 63 | export DESTDIR="${D}" |
| 64 | # prefix is used for RPATH and DESTDIR/prefix for instalation |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 65 | ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 66 | bbfatal "scons install execution failed." |
| 67 | } |
| 68 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 69 | do_install:append() { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 70 | install -d ${D}/${sysconfdir}/init.d |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 71 | install -m 0755 ${WORKDIR}/gpsd.init ${D}/${sysconfdir}/init.d/gpsd |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 72 | install -d ${D}/${sysconfdir}/default |
| 73 | install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default |
| 74 | |
| 75 | #support for udev |
| 76 | install -d ${D}/${sysconfdir}/udev/rules.d |
| 77 | install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/ |
| 78 | install -d ${D}${base_libdir}/udev/ |
| 79 | install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/ |
| 80 | |
| 81 | #support for python |
| 82 | install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps |
| 83 | install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps |
| 84 | |
| 85 | #support for systemd |
| 86 | install -d ${D}${systemd_unitdir}/system/ |
| 87 | install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 88 | sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}.service |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 89 | install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 90 | sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}ctl@.service |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 91 | install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket |
| 92 | } |
| 93 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 94 | PACKAGES =+ "libgps libgpsd python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 95 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 96 | RPROVIDES:${PN}-dbg += "python-pygps-dbg" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 97 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 98 | FILES:${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 99 | ${libdir}/libQgpsmm.prl" |
| 100 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 101 | RDEPENDS:${PN} = "gpsd-gpsctl" |
| 102 | RRECOMMENDS:${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 103 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 104 | SUMMARY:gpsd-udev = "udev relevant files to use gpsd hotplugging" |
| 105 | FILES:gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*" |
| 106 | RDEPENDS:gpsd-udev += "udev gpsd-conf" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 107 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 108 | SUMMARY:libgpsd = "C service library used for communicating with gpsd" |
| 109 | FILES:libgpsd = "${libdir}/libgpsd.so.*" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 110 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 111 | SUMMARY:libgps = "C service library used for communicating with gpsd" |
| 112 | FILES:libgps = "${libdir}/libgps.so.*" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 113 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 114 | SUMMARY:gpsd-conf = "gpsd configuration files and init scripts" |
| 115 | FILES:gpsd-conf = "${sysconfdir}" |
| 116 | CONFFILES:gpsd-conf = "${sysconfdir}/default/gpsd.default" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 117 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 118 | SUMMARY:gpsd-gpsctl = "Tool for tweaking GPS modes" |
| 119 | FILES:gpsd-gpsctl = "${bindir}/gpsctl" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 120 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 121 | SUMMARY:gps-utils = "Utils used for simulating, monitoring,... a GPS" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 122 | # Python files are required for gps/fake, required for gpsfake. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 123 | FILES:gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so" |
| 124 | RDEPENDS:gps-utils = "python3-pygps" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 125 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 126 | SUMMARY:python3-pygps = "Python bindings to gpsd" |
| 127 | FILES:python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info" |
| 128 | RDEPENDS:python3-pygps = " \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 129 | python3-core \ |
| 130 | python3-io \ |
| 131 | python3-threading \ |
| 132 | python3-terminal \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 133 | gpsd \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 134 | python3-json" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 135 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 136 | RPROVIDES:${PN} += "${PN}-systemd" |
| 137 | RREPLACES:${PN} += "${PN}-systemd" |
| 138 | RCONFLICTS:${PN} += "${PN}-systemd" |
| 139 | SYSTEMD_SERVICE:${PN} = "${BPN}.socket ${BPN}ctl@.service" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 140 | |
| 141 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 142 | ALTERNATIVE:${PN} = "gpsd-defaults" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 143 | ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd" |
| 144 | ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default" |