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