gpsd_3.19.bb 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. SUMMARY = "A TCP/IP Daemon simplifying the communication with GPS devices"
  2. SECTION = "console/network"
  3. LICENSE = "BSD-2-Clause"
  4. LIC_FILES_CHKSUM = "file://COPYING;md5=01764c35ae34d9521944bb6ab312af53"
  5. DEPENDS = "dbus ncurses python python3 pps-tools"
  6. PROVIDES = "virtual/gpsd"
  7. SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
  8. file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \
  9. file://0001-gps_shm_close-Free-privdata.patch \
  10. "
  11. SRC_URI[md5sum] = "b3bf88706794eb8e5f2c2543bf7ba87b"
  12. SRC_URI[sha256sum] = "27dd24d45b2ac69baab7933da2bf6ae5fb0be90130f67e753c110a3477155f39"
  13. inherit scons update-rc.d python3-dir python3native systemd update-alternatives
  14. INITSCRIPT_PACKAGES = "gpsd-conf"
  15. INITSCRIPT_NAME = "gpsd"
  16. INITSCRIPT_PARAMS = "defaults 35"
  17. SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
  18. export STAGING_INCDIR
  19. export STAGING_LIBDIR
  20. PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb"
  21. PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5"
  22. PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
  23. PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1"
  24. EXTRA_OESCONS = " \
  25. sysroot=${STAGING_DIR_TARGET} \
  26. libQgpsmm='false' \
  27. debug='false' \
  28. nostrip='true' \
  29. systemd='${SYSTEMD_OESCONS}' \
  30. libdir='${libdir}' \
  31. manbuild='false' \
  32. ${PACKAGECONFIG_CONFARGS} \
  33. "
  34. # this cannot be used, because then chrpath is not found and only static lib is built
  35. # target=${HOST_SYS}
  36. do_compile_prepend() {
  37. export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
  38. export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
  39. export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
  40. export LINKFLAGS="${LDFLAGS}"
  41. }
  42. do_install() {
  43. export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
  44. export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
  45. export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
  46. export LINKFLAGS="${LDFLAGS}"
  47. export DESTDIR="${D}"
  48. # prefix is used for RPATH and DESTDIR/prefix for instalation
  49. ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \
  50. bbfatal "scons install execution failed."
  51. }
  52. do_install_append() {
  53. install -d ${D}/${sysconfdir}/init.d
  54. install -m 0755 ${S}/packaging/deb/etc_init.d_gpsd ${D}/${sysconfdir}/init.d/gpsd
  55. install -d ${D}/${sysconfdir}/default
  56. install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default
  57. #support for udev
  58. install -d ${D}/${sysconfdir}/udev/rules.d
  59. install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/
  60. install -d ${D}${base_libdir}/udev/
  61. install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
  62. #support for python
  63. install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
  64. install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
  65. #support for systemd
  66. install -d ${D}${systemd_unitdir}/system/
  67. install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
  68. sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}.service
  69. install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service
  70. sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}ctl@.service
  71. install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
  72. }
  73. PACKAGES =+ "libgps libgpsd python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
  74. RPROVIDES_${PN}-dbg += "python-pygps-dbg"
  75. FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
  76. ${libdir}/libQgpsmm.prl"
  77. RDEPENDS_${PN} = "gpsd-gpsctl"
  78. RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
  79. SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
  80. FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
  81. RDEPENDS_gpsd-udev += "udev gpsd-conf"
  82. SUMMARY_libgpsd = "C service library used for communicating with gpsd"
  83. FILES_libgpsd = "${libdir}/libgpsd.so.*"
  84. SUMMARY_libgps = "C service library used for communicating with gpsd"
  85. FILES_libgps = "${libdir}/libgps.so.*"
  86. SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
  87. FILES_gpsd-conf = "${sysconfdir}"
  88. CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
  89. SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
  90. FILES_gpsd-gpsctl = "${bindir}/gpsctl"
  91. SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
  92. # Python files are required for gps/fake, required for gpsfake.
  93. FILES_gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so"
  94. RDEPENDS_gps-utils = "python-pygps"
  95. SUMMARY_python-pygps = "Python bindings to gpsd"
  96. FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
  97. RDEPENDS_python-pygps = " \
  98. python-core \
  99. python-io \
  100. python-threading \
  101. python-terminal \
  102. gpsd \
  103. python-json"
  104. RPROVIDES_${PN} += "${PN}-systemd"
  105. RREPLACES_${PN} += "${PN}-systemd"
  106. RCONFLICTS_${PN} += "${PN}-systemd"
  107. SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
  108. ALTERNATIVE_${PN} = "gpsd-defaults"
  109. ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
  110. ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"