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 | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 11 | file://gpsd.init \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 12 | " |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 13 | SRC_URI[md5sum] = "cf7fdec7ce7221d20bee1a7246362b05" |
| 14 | SRC_URI[sha256sum] = "172a7805068eacb815a3c5225436fcb0be46e7e49a5001a94034eac43df85e50" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 15 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | inherit scons update-rc.d python3-dir python3native systemd update-alternatives |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | |
| 18 | INITSCRIPT_PACKAGES = "gpsd-conf" |
| 19 | INITSCRIPT_NAME = "gpsd" |
| 20 | INITSCRIPT_PARAMS = "defaults 35" |
| 21 | |
| 22 | SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}" |
| 23 | |
| 24 | export STAGING_INCDIR |
| 25 | export STAGING_LIBDIR |
| 26 | |
Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 27 | CLEANBROKEN = "1" |
| 28 | |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 29 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 30 | PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 31 | PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase" |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 32 | PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 33 | EXTRA_OESCONS = " \ |
| 34 | sysroot=${STAGING_DIR_TARGET} \ |
| 35 | libQgpsmm='false' \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 36 | debug='false' \ |
| 37 | nostrip='true' \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 38 | systemd='${SYSTEMD_OESCONS}' \ |
| 39 | libdir='${libdir}' \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 40 | manbuild='false' \ |
Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 41 | LINK='${CC}' \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 42 | ${PACKAGECONFIG_CONFARGS} \ |
| 43 | " |
| 44 | # this cannot be used, because then chrpath is not found and only static lib is built |
| 45 | # target=${HOST_SYS} |
| 46 | |
| 47 | do_compile_prepend() { |
| 48 | export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" |
| 49 | export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" |
| 50 | export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" |
Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 51 | export LD="${CC}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 52 | export LINKFLAGS="${LDFLAGS}" |
| 53 | } |
| 54 | |
| 55 | do_install() { |
| 56 | export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" |
| 57 | export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" |
| 58 | export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" |
Andrew Geissler | 2ee498a | 2020-05-29 15:52:06 -0500 | [diff] [blame] | 59 | export LD="${CC}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 60 | export LINKFLAGS="${LDFLAGS}" |
| 61 | |
| 62 | export DESTDIR="${D}" |
| 63 | # prefix is used for RPATH and DESTDIR/prefix for instalation |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 64 | ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 65 | bbfatal "scons install execution failed." |
| 66 | } |
| 67 | |
| 68 | do_install_append() { |
| 69 | install -d ${D}/${sysconfdir}/init.d |
Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 70 | install -m 0755 ${WORKDIR}/gpsd.init ${D}/${sysconfdir}/init.d/gpsd |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 71 | install -d ${D}/${sysconfdir}/default |
| 72 | install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default |
| 73 | |
| 74 | #support for udev |
| 75 | install -d ${D}/${sysconfdir}/udev/rules.d |
| 76 | install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/ |
| 77 | install -d ${D}${base_libdir}/udev/ |
| 78 | install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/ |
| 79 | |
| 80 | #support for python |
| 81 | install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps |
| 82 | install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps |
| 83 | |
| 84 | #support for systemd |
| 85 | install -d ${D}${systemd_unitdir}/system/ |
| 86 | 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] | 87 | 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] | 88 | 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] | 89 | 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] | 90 | install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket |
| 91 | } |
| 92 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 93 | 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] | 94 | |
| 95 | RPROVIDES_${PN}-dbg += "python-pygps-dbg" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 96 | |
| 97 | FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \ |
| 98 | ${libdir}/libQgpsmm.prl" |
| 99 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 100 | RDEPENDS_${PN} = "gpsd-gpsctl" |
| 101 | RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf" |
| 102 | |
| 103 | SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging" |
| 104 | FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*" |
| 105 | RDEPENDS_gpsd-udev += "udev gpsd-conf" |
| 106 | |
| 107 | SUMMARY_libgpsd = "C service library used for communicating with gpsd" |
| 108 | FILES_libgpsd = "${libdir}/libgpsd.so.*" |
| 109 | |
| 110 | SUMMARY_libgps = "C service library used for communicating with gpsd" |
| 111 | FILES_libgps = "${libdir}/libgps.so.*" |
| 112 | |
| 113 | SUMMARY_gpsd-conf = "gpsd configuration files and init scripts" |
| 114 | FILES_gpsd-conf = "${sysconfdir}" |
| 115 | CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default" |
| 116 | |
| 117 | SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes" |
| 118 | FILES_gpsd-gpsctl = "${bindir}/gpsctl" |
| 119 | |
| 120 | SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 121 | # Python files are required for gps/fake, required for gpsfake. |
| 122 | FILES_gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 123 | RDEPENDS_gps-utils = "python3-pygps" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 124 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 125 | SUMMARY_python3-pygps = "Python bindings to gpsd" |
| 126 | FILES_python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info" |
| 127 | RDEPENDS_python3-pygps = " \ |
| 128 | python3-core \ |
| 129 | python3-io \ |
| 130 | python3-threading \ |
| 131 | python3-terminal \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 132 | gpsd \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 133 | python3-json" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 134 | |
| 135 | RPROVIDES_${PN} += "${PN}-systemd" |
| 136 | RREPLACES_${PN} += "${PN}-systemd" |
| 137 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 138 | SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service" |
| 139 | |
| 140 | |
| 141 | ALTERNATIVE_${PN} = "gpsd-defaults" |
| 142 | ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd" |
| 143 | ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default" |