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