blob: 3888ad8fa33ba97dd1dfde17bb296b9f7d7595d4 [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 Geissler89770b02020-06-13 10:40:47 -050011 file://gpsd.init \
Brad Bishop316dfdd2018-06-25 12:45:53 -040012"
Andrew Geissler7f40b712020-05-15 14:09:53 -050013SRC_URI[md5sum] = "cf7fdec7ce7221d20bee1a7246362b05"
14SRC_URI[sha256sum] = "172a7805068eacb815a3c5225436fcb0be46e7e49a5001a94034eac43df85e50"
Brad Bishop316dfdd2018-06-25 12:45:53 -040015
Andrew Geissler82c905d2020-04-13 13:39:40 -050016inherit scons update-rc.d python3-dir python3native systemd update-alternatives
Brad Bishop316dfdd2018-06-25 12:45:53 -040017
18INITSCRIPT_PACKAGES = "gpsd-conf"
19INITSCRIPT_NAME = "gpsd"
20INITSCRIPT_PARAMS = "defaults 35"
21
22SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
23
24export STAGING_INCDIR
25export STAGING_LIBDIR
26
Andrew Geissler2ee498a2020-05-29 15:52:06 -050027CLEANBROKEN = "1"
28
Brad Bishope42b3e32020-01-15 22:08:42 -050029PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb"
Brad Bishop26bdd442019-08-16 17:08:17 -040030PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5"
Brad Bishop15ae2502019-06-18 21:44:24 -040031PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
Brad Bishope42b3e32020-01-15 22:08:42 -050032PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1"
Brad Bishop316dfdd2018-06-25 12:45:53 -040033EXTRA_OESCONS = " \
34 sysroot=${STAGING_DIR_TARGET} \
35 libQgpsmm='false' \
Brad Bishop26bdd442019-08-16 17:08:17 -040036 debug='false' \
37 nostrip='true' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040038 systemd='${SYSTEMD_OESCONS}' \
39 libdir='${libdir}' \
Brad Bishop26bdd442019-08-16 17:08:17 -040040 manbuild='false' \
Andrew Geissler2ee498a2020-05-29 15:52:06 -050041 LINK='${CC}' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040042 ${PACKAGECONFIG_CONFARGS} \
43"
44# this cannot be used, because then chrpath is not found and only static lib is built
45# target=${HOST_SYS}
46
47do_compile_prepend() {
48 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
49 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
50 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050051 export LD="${CC}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040052 export LINKFLAGS="${LDFLAGS}"
53}
54
55do_install() {
56 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
57 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
58 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050059 export LD="${CC}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040060 export LINKFLAGS="${LDFLAGS}"
61
62 export DESTDIR="${D}"
63 # prefix is used for RPATH and DESTDIR/prefix for instalation
Brad Bishop26bdd442019-08-16 17:08:17 -040064 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \
Brad Bishop316dfdd2018-06-25 12:45:53 -040065 bbfatal "scons install execution failed."
66}
67
68do_install_append() {
69 install -d ${D}/${sysconfdir}/init.d
Andrew Geissler89770b02020-06-13 10:40:47 -050070 install -m 0755 ${WORKDIR}/gpsd.init ${D}/${sysconfdir}/init.d/gpsd
Brad Bishop316dfdd2018-06-25 12:45:53 -040071 install -d ${D}/${sysconfdir}/default
72 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default
73
74 #support for udev
75 install -d ${D}/${sysconfdir}/udev/rules.d
76 install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/
77 install -d ${D}${base_libdir}/udev/
78 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
79
80 #support for python
81 install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
82 install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
83
84 #support for systemd
85 install -d ${D}${systemd_unitdir}/system/
86 install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop26bdd442019-08-16 17:08:17 -040087 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040088 install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop26bdd442019-08-16 17:08:17 -040089 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040090 install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
91}
92
Andrew Geissler82c905d2020-04-13 13:39:40 -050093PACKAGES =+ "libgps libgpsd python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080094
95RPROVIDES_${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040096
97FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
98 ${libdir}/libQgpsmm.prl"
99
Brad Bishop316dfdd2018-06-25 12:45:53 -0400100RDEPENDS_${PN} = "gpsd-gpsctl"
101RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
102
103SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
104FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
105RDEPENDS_gpsd-udev += "udev gpsd-conf"
106
107SUMMARY_libgpsd = "C service library used for communicating with gpsd"
108FILES_libgpsd = "${libdir}/libgpsd.so.*"
109
110SUMMARY_libgps = "C service library used for communicating with gpsd"
111FILES_libgps = "${libdir}/libgps.so.*"
112
113SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
114FILES_gpsd-conf = "${sysconfdir}"
115CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
116
117SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
118FILES_gpsd-gpsctl = "${bindir}/gpsctl"
119
120SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
Brad Bishop26bdd442019-08-16 17:08:17 -0400121# Python files are required for gps/fake, required for gpsfake.
122FILES_gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500123RDEPENDS_gps-utils = "python3-pygps"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400124
Andrew Geissler82c905d2020-04-13 13:39:40 -0500125SUMMARY_python3-pygps = "Python bindings to gpsd"
126FILES_python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
127RDEPENDS_python3-pygps = " \
128 python3-core \
129 python3-io \
130 python3-threading \
131 python3-terminal \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400132 gpsd \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500133 python3-json"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400134
135RPROVIDES_${PN} += "${PN}-systemd"
136RREPLACES_${PN} += "${PN}-systemd"
137RCONFLICTS_${PN} += "${PN}-systemd"
138SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
139
140
141ALTERNATIVE_${PN} = "gpsd-defaults"
142ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
143ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"