blob: 0989cc13987e43c1dac0fe3d9d52e316d0a36dbf [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001SUMMARY = "A TCP/IP Daemon simplifying the communication with GPS devices"
2SECTION = "console/network"
Brad Bishop26bdd442019-08-16 17:08:17 -04003LICENSE = "BSD-2-Clause"
4LIC_FILES_CHKSUM = "file://COPYING;md5=01764c35ae34d9521944bb6ab312af53"
Andrew Geissler82c905d2020-04-13 13:39:40 -05005DEPENDS = "dbus ncurses python3 pps-tools"
Brad Bishop316dfdd2018-06-25 12:45:53 -04006PROVIDES = "virtual/gpsd"
7
Brad Bishop316dfdd2018-06-25 12:45:53 -04008SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
9 file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \
Andrew Geissler7f40b712020-05-15 14:09:53 -050010 file://0001-Revert-SConstruct-Add-test-for-sizeof-time_t-result-.patch \
Andrew Geisslere34f8962021-04-15 15:53:51 -050011 file://0001-gpsd-dbusexport.c-Fix-broken-d-bus-message-time.patch \
Andrew Geissler89770b02020-06-13 10:40:47 -050012 file://gpsd.init \
Brad Bishop316dfdd2018-06-25 12:45:53 -040013"
Andrew Geissler7f40b712020-05-15 14:09:53 -050014SRC_URI[md5sum] = "cf7fdec7ce7221d20bee1a7246362b05"
15SRC_URI[sha256sum] = "172a7805068eacb815a3c5225436fcb0be46e7e49a5001a94034eac43df85e50"
Brad Bishop316dfdd2018-06-25 12:45:53 -040016
Andrew Geissler82c905d2020-04-13 13:39:40 -050017inherit scons update-rc.d python3-dir python3native systemd update-alternatives
Brad Bishop316dfdd2018-06-25 12:45:53 -040018
19INITSCRIPT_PACKAGES = "gpsd-conf"
20INITSCRIPT_NAME = "gpsd"
21INITSCRIPT_PARAMS = "defaults 35"
22
23SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
24
25export STAGING_INCDIR
26export STAGING_LIBDIR
27
Andrew Geissler2ee498a2020-05-29 15:52:06 -050028CLEANBROKEN = "1"
29
Brad Bishope42b3e32020-01-15 22:08:42 -050030PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb"
Brad Bishop26bdd442019-08-16 17:08:17 -040031PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5"
Brad Bishop15ae2502019-06-18 21:44:24 -040032PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
Brad Bishope42b3e32020-01-15 22:08:42 -050033PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1"
Brad Bishop316dfdd2018-06-25 12:45:53 -040034EXTRA_OESCONS = " \
35 sysroot=${STAGING_DIR_TARGET} \
36 libQgpsmm='false' \
Brad Bishop26bdd442019-08-16 17:08:17 -040037 debug='false' \
38 nostrip='true' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040039 systemd='${SYSTEMD_OESCONS}' \
40 libdir='${libdir}' \
Brad Bishop26bdd442019-08-16 17:08:17 -040041 manbuild='false' \
Andrew Geissler2ee498a2020-05-29 15:52:06 -050042 LINK='${CC}' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040043 ${PACKAGECONFIG_CONFARGS} \
44"
45# this cannot be used, because then chrpath is not found and only static lib is built
46# target=${HOST_SYS}
47
48do_compile_prepend() {
49 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
50 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
51 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050052 export LD="${CC}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040053 export LINKFLAGS="${LDFLAGS}"
54}
55
56do_install() {
57 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
58 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
59 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050060 export LD="${CC}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040061 export LINKFLAGS="${LDFLAGS}"
62
63 export DESTDIR="${D}"
64 # prefix is used for RPATH and DESTDIR/prefix for instalation
Brad Bishop26bdd442019-08-16 17:08:17 -040065 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \
Brad Bishop316dfdd2018-06-25 12:45:53 -040066 bbfatal "scons install execution failed."
67}
68
69do_install_append() {
70 install -d ${D}/${sysconfdir}/init.d
Andrew Geissler89770b02020-06-13 10:40:47 -050071 install -m 0755 ${WORKDIR}/gpsd.init ${D}/${sysconfdir}/init.d/gpsd
Brad Bishop316dfdd2018-06-25 12:45:53 -040072 install -d ${D}/${sysconfdir}/default
73 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default
74
75 #support for udev
76 install -d ${D}/${sysconfdir}/udev/rules.d
77 install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/
78 install -d ${D}${base_libdir}/udev/
79 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
80
81 #support for python
82 install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
83 install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
84
85 #support for systemd
86 install -d ${D}${systemd_unitdir}/system/
87 install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop26bdd442019-08-16 17:08:17 -040088 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040089 install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop26bdd442019-08-16 17:08:17 -040090 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040091 install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
92}
93
Andrew Geissler82c905d2020-04-13 13:39:40 -050094PACKAGES =+ "libgps libgpsd python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080095
96RPROVIDES_${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040097
98FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
99 ${libdir}/libQgpsmm.prl"
100
Brad Bishop316dfdd2018-06-25 12:45:53 -0400101RDEPENDS_${PN} = "gpsd-gpsctl"
102RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
103
104SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
105FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
106RDEPENDS_gpsd-udev += "udev gpsd-conf"
107
108SUMMARY_libgpsd = "C service library used for communicating with gpsd"
109FILES_libgpsd = "${libdir}/libgpsd.so.*"
110
111SUMMARY_libgps = "C service library used for communicating with gpsd"
112FILES_libgps = "${libdir}/libgps.so.*"
113
114SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
115FILES_gpsd-conf = "${sysconfdir}"
116CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
117
118SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
119FILES_gpsd-gpsctl = "${bindir}/gpsctl"
120
121SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
Brad Bishop26bdd442019-08-16 17:08:17 -0400122# Python files are required for gps/fake, required for gpsfake.
123FILES_gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500124RDEPENDS_gps-utils = "python3-pygps"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400125
Andrew Geissler82c905d2020-04-13 13:39:40 -0500126SUMMARY_python3-pygps = "Python bindings to gpsd"
127FILES_python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
128RDEPENDS_python3-pygps = " \
129 python3-core \
130 python3-io \
131 python3-threading \
132 python3-terminal \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400133 gpsd \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500134 python3-json"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400135
136RPROVIDES_${PN} += "${PN}-systemd"
137RREPLACES_${PN} += "${PN}-systemd"
138RCONFLICTS_${PN} += "${PN}-systemd"
139SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
140
141
142ALTERNATIVE_${PN} = "gpsd-defaults"
143ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
144ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"