Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [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-respect-sysroot-also-in-SPLINTOPTS.patch \ |
| 12 | file://0002-SConstruct-remove-rpath.patch \ |
| 13 | file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \ |
| 14 | file://0004-SConstruct-disable-html-and-man-docs-building-becaus.patch \ |
| 15 | file://0001-Check-for-__STDC_NO_ATOMICS__-before-using-stdatomic.patch \ |
| 16 | file://0002-Add-a-test-for-C11-and-check-we-have-C11-before-usin.patch \ |
| 17 | file://0003-Whoops-check-for-C11-not-for-not-C11-in-stdatomic.h-.patch \ |
| 18 | file://0001-Include-stdatomic.h-only-in-C-mode.patch \ |
| 19 | file://0001-libgpsd-core-Fix-issue-with-ACTIVATE-hook-not-being-.patch \ |
| 20 | file://gpsd-default \ |
| 21 | file://gpsd \ |
| 22 | file://60-gpsd.rules \ |
| 23 | file://gpsd.service \ |
| 24 | " |
| 25 | SRC_URI[md5sum] = "bc7467009b99e07ba461377b5da6c039" |
| 26 | SRC_URI[sha256sum] = "504fc812f3c1525a1a48e04bf4d77f9a8066c201448d98089df89d58ef53a8cb" |
| 27 | |
| 28 | inherit scons update-rc.d python-dir pythonnative systemd bluetooth |
| 29 | |
| 30 | INITSCRIPT_NAME = "gpsd" |
| 31 | INITSCRIPT_PARAMS = "defaults 35" |
| 32 | |
| 33 | SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}" |
| 34 | |
| 35 | export STAGING_INCDIR |
| 36 | export STAGING_LIBDIR |
| 37 | |
| 38 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}" |
| 39 | PACKAGECONFIG[bluez] = "bluez='true',bluez='false',${BLUEZ}" |
| 40 | PACKAGECONFIG[qt] = "qt='yes',qt='no',qt4-x11-free" |
| 41 | EXTRA_OESCONS = " \ |
| 42 | sysroot=${STAGING_DIR_TARGET} \ |
| 43 | libQgpsmm='false' \ |
| 44 | debug='true' \ |
| 45 | strip='false' \ |
| 46 | chrpath='yes' \ |
| 47 | systemd='${SYSTEMD_OESCONS}' \ |
| 48 | ${EXTRA_OECONF} \ |
| 49 | " |
| 50 | DISABLE_STATIC = "" |
| 51 | # this cannot be used, because then chrpath is not found and only static lib is built |
| 52 | # target=${HOST_SYS} |
| 53 | |
| 54 | do_compile_prepend() { |
| 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}" |
| 58 | |
| 59 | export BUILD_SYS="${BUILD_SYS}" |
| 60 | export HOST_SYS="${HOST_SYS}" |
| 61 | } |
| 62 | |
| 63 | do_install() { |
| 64 | export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" |
| 65 | export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" |
| 66 | export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" |
| 67 | |
| 68 | export BUILD_SYS="${BUILD_SYS}" |
| 69 | export HOST_SYS="${HOST_SYS}" |
| 70 | |
| 71 | export DESTDIR="${D}" |
| 72 | # prefix is used for RPATH and DESTDIR/prefix for instalation |
| 73 | ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} install ${EXTRA_OESCONS}|| \ |
| 74 | bbfatal "scons install execution failed." |
| 75 | } |
| 76 | |
| 77 | do_install_append() { |
| 78 | install -d ${D}/${sysconfdir}/init.d |
| 79 | install -m 0755 ${WORKDIR}/gpsd ${D}/${sysconfdir}/init.d/ |
| 80 | install -d ${D}/${sysconfdir}/default |
| 81 | install -m 0644 ${WORKDIR}/gpsd-default ${D}/${sysconfdir}/default/gpsd.default |
| 82 | |
| 83 | #support for udev |
| 84 | install -d ${D}/${sysconfdir}/udev/rules.d |
| 85 | install -m 0644 ${WORKDIR}/60-gpsd.rules ${D}/${sysconfdir}/udev/rules.d |
| 86 | install -d ${D}${base_libdir}/udev/ |
| 87 | install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/ |
| 88 | |
| 89 | #support for python |
| 90 | install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps |
| 91 | install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps |
| 92 | |
| 93 | #support for systemd |
| 94 | install -d ${D}${systemd_unitdir}/system/ |
| 95 | install -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service |
| 96 | install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket |
| 97 | } |
| 98 | |
| 99 | pkg_postinst_${PN}-conf() { |
| 100 | update-alternatives --install ${sysconfdir}/default/gpsd gpsd-defaults ${sysconfdir}/default/gpsd.default 10 |
| 101 | } |
| 102 | |
| 103 | pkg_postrm_${PN}-conf() { |
| 104 | update-alternatives --remove gpsd-defaults ${sysconfdir}/default/gpsd.default |
| 105 | } |
| 106 | |
| 107 | PACKAGES =+ "libgps libgpsd python-pygps-dbg python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils" |
| 108 | |
| 109 | FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \ |
| 110 | ${libdir}/libQgpsmm.prl" |
| 111 | |
| 112 | FILES_python-pygps-dbg += " ${libdir}/python*/site-packages/gps/.debug" |
| 113 | |
| 114 | RDEPENDS_${PN} = "gpsd-gpsctl" |
| 115 | RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf" |
| 116 | |
| 117 | SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging" |
| 118 | FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*" |
| 119 | RDEPENDS_gpsd-udev += "udev gpsd-conf" |
| 120 | |
| 121 | SUMMARY_libgpsd = "C service library used for communicating with gpsd" |
| 122 | FILES_libgpsd = "${libdir}/libgpsd.so.*" |
| 123 | |
| 124 | SUMMARY_libgps = "C service library used for communicating with gpsd" |
| 125 | FILES_libgps = "${libdir}/libgps.so.*" |
| 126 | |
| 127 | SUMMARY_gpsd-conf = "gpsd configuration files and init scripts" |
| 128 | FILES_gpsd-conf = "${sysconfdir}" |
| 129 | CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default" |
| 130 | |
| 131 | SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes" |
| 132 | FILES_gpsd-gpsctl = "${bindir}/gpsctl" |
| 133 | |
| 134 | SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS" |
| 135 | FILES_gps-utils = "${bindir}/*" |
| 136 | RDEPENDS_gps-utils = "python-pygps" |
| 137 | |
| 138 | SUMMARY_python-pygps = "Python bindings to gpsd" |
| 139 | FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/*" |
| 140 | RDEPENDS_python-pygps = "python-core python-curses gpsd python-json" |
| 141 | |
| 142 | RPROVIDES_${PN} += "${PN}-systemd" |
| 143 | RREPLACES_${PN} += "${PN}-systemd" |
| 144 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 145 | SYSTEMD_SERVICE_${PN} = "${PN}.socket" |