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" |
| 3 | LICENSE = "BSD" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800" |
| 5 | DEPENDS = "dbus dbus-glib ncurses python libusb1 chrpath-replacement-native pps-tools" |
| 6 | PROVIDES = "virtual/gpsd" |
| 7 | |
| 8 | EXTRANATIVEPATH += "chrpath-native" |
| 9 | |
| 10 | SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \ |
| 11 | file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \ |
| 12 | file://0004-SConstruct-disable-html-and-man-docs-building-becaus.patch \ |
| 13 | file://0001-include-sys-ttydefaults.h.patch \ |
| 14 | " |
| 15 | SRC_URI[md5sum] = "e0cfadcf4a65dfbdd2afb11c58f4e4a1" |
| 16 | SRC_URI[sha256sum] = "68e0dbecfb5831997f8b3d6ba48aed812eb465d8c0089420ab68f9ce4d85e77a" |
| 17 | |
| 18 | inherit scons update-rc.d python-dir pythonnative systemd bluetooth update-alternatives |
| 19 | |
| 20 | INITSCRIPT_PACKAGES = "gpsd-conf" |
| 21 | INITSCRIPT_NAME = "gpsd" |
| 22 | INITSCRIPT_PARAMS = "defaults 35" |
| 23 | |
| 24 | SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}" |
| 25 | |
| 26 | export STAGING_INCDIR |
| 27 | export STAGING_LIBDIR |
| 28 | |
| 29 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}" |
| 30 | PACKAGECONFIG[bluez] = "bluez='true',bluez='false',${BLUEZ}" |
| 31 | PACKAGECONFIG[qt] = "qt='yes',qt='no',qt4-x11-free" |
| 32 | EXTRA_OESCONS = " \ |
| 33 | sysroot=${STAGING_DIR_TARGET} \ |
| 34 | libQgpsmm='false' \ |
| 35 | debug='true' \ |
| 36 | strip='false' \ |
| 37 | chrpath='yes' \ |
| 38 | systemd='${SYSTEMD_OESCONS}' \ |
| 39 | libdir='${libdir}' \ |
| 40 | ${PACKAGECONFIG_CONFARGS} \ |
| 41 | " |
| 42 | # this cannot be used, because then chrpath is not found and only static lib is built |
| 43 | # target=${HOST_SYS} |
| 44 | |
| 45 | do_compile_prepend() { |
| 46 | export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" |
| 47 | export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" |
| 48 | export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" |
| 49 | export LINKFLAGS="${LDFLAGS}" |
| 50 | } |
| 51 | |
| 52 | do_install() { |
| 53 | export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" |
| 54 | export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" |
| 55 | export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" |
| 56 | export LINKFLAGS="${LDFLAGS}" |
| 57 | |
| 58 | export DESTDIR="${D}" |
| 59 | # prefix is used for RPATH and DESTDIR/prefix for instalation |
| 60 | ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} install ${EXTRA_OESCONS}|| \ |
| 61 | bbfatal "scons install execution failed." |
| 62 | } |
| 63 | |
| 64 | do_install_append() { |
| 65 | install -d ${D}/${sysconfdir}/init.d |
| 66 | install -m 0755 ${S}/packaging/deb/etc_init.d_gpsd ${D}/${sysconfdir}/init.d/gpsd |
| 67 | install -d ${D}/${sysconfdir}/default |
| 68 | install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default |
| 69 | |
| 70 | #support for udev |
| 71 | install -d ${D}/${sysconfdir}/udev/rules.d |
| 72 | install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/ |
| 73 | install -d ${D}${base_libdir}/udev/ |
| 74 | install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/ |
| 75 | |
| 76 | #support for python |
| 77 | install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps |
| 78 | install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps |
| 79 | |
| 80 | #support for systemd |
| 81 | install -d ${D}${systemd_unitdir}/system/ |
| 82 | install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service |
| 83 | install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service |
| 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" |
| 115 | FILES_gps-utils = "${bindir}/*" |
| 116 | RDEPENDS_gps-utils = "python-pygps" |
| 117 | |
| 118 | SUMMARY_python-pygps = "Python bindings to gpsd" |
| 119 | FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/*" |
| 120 | RDEPENDS_python-pygps = " \ |
| 121 | python-core \ |
| 122 | python-io \ |
| 123 | python-threading \ |
| 124 | python-terminal \ |
| 125 | python-curses \ |
| 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" |