blob: 390e6a8c3bffc9a13a81b566fefd5681bf463dcd [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 \
Brad Bishop316dfdd2018-06-25 12:45:53 -040011"
Andrew Geissler7f40b712020-05-15 14:09:53 -050012SRC_URI[md5sum] = "cf7fdec7ce7221d20bee1a7246362b05"
13SRC_URI[sha256sum] = "172a7805068eacb815a3c5225436fcb0be46e7e49a5001a94034eac43df85e50"
Brad Bishop316dfdd2018-06-25 12:45:53 -040014
Andrew Geissler82c905d2020-04-13 13:39:40 -050015inherit scons update-rc.d python3-dir python3native systemd update-alternatives
Brad Bishop316dfdd2018-06-25 12:45:53 -040016
17INITSCRIPT_PACKAGES = "gpsd-conf"
18INITSCRIPT_NAME = "gpsd"
19INITSCRIPT_PARAMS = "defaults 35"
20
21SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
22
23export STAGING_INCDIR
24export STAGING_LIBDIR
25
Andrew Geissler2ee498a2020-05-29 15:52:06 -050026CLEANBROKEN = "1"
27
Brad Bishope42b3e32020-01-15 22:08:42 -050028PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb"
Brad Bishop26bdd442019-08-16 17:08:17 -040029PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5"
Brad Bishop15ae2502019-06-18 21:44:24 -040030PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
Brad Bishope42b3e32020-01-15 22:08:42 -050031PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1"
Brad Bishop316dfdd2018-06-25 12:45:53 -040032EXTRA_OESCONS = " \
33 sysroot=${STAGING_DIR_TARGET} \
34 libQgpsmm='false' \
Brad Bishop26bdd442019-08-16 17:08:17 -040035 debug='false' \
36 nostrip='true' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040037 systemd='${SYSTEMD_OESCONS}' \
38 libdir='${libdir}' \
Brad Bishop26bdd442019-08-16 17:08:17 -040039 manbuild='false' \
Andrew Geissler2ee498a2020-05-29 15:52:06 -050040 LINK='${CC}' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040041 ${PACKAGECONFIG_CONFARGS} \
42"
43# this cannot be used, because then chrpath is not found and only static lib is built
44# target=${HOST_SYS}
45
46do_compile_prepend() {
47 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
48 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
49 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050050 export LD="${CC}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040051 export LINKFLAGS="${LDFLAGS}"
52}
53
54do_install() {
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}"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050058 export LD="${CC}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040059 export LINKFLAGS="${LDFLAGS}"
60
61 export DESTDIR="${D}"
62 # prefix is used for RPATH and DESTDIR/prefix for instalation
Brad Bishop26bdd442019-08-16 17:08:17 -040063 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \
Brad Bishop316dfdd2018-06-25 12:45:53 -040064 bbfatal "scons install execution failed."
65}
66
67do_install_append() {
68 install -d ${D}/${sysconfdir}/init.d
69 install -m 0755 ${S}/packaging/deb/etc_init.d_gpsd ${D}/${sysconfdir}/init.d/gpsd
70 install -d ${D}/${sysconfdir}/default
71 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default
72
73 #support for udev
74 install -d ${D}/${sysconfdir}/udev/rules.d
75 install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/
76 install -d ${D}${base_libdir}/udev/
77 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
78
79 #support for python
80 install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
81 install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
82
83 #support for systemd
84 install -d ${D}${systemd_unitdir}/system/
85 install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop26bdd442019-08-16 17:08:17 -040086 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040087 install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop26bdd442019-08-16 17:08:17 -040088 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040089 install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
90}
91
Andrew Geissler82c905d2020-04-13 13:39:40 -050092PACKAGES =+ "libgps libgpsd python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080093
94RPROVIDES_${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040095
96FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
97 ${libdir}/libQgpsmm.prl"
98
Brad Bishop316dfdd2018-06-25 12:45:53 -040099RDEPENDS_${PN} = "gpsd-gpsctl"
100RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
101
102SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
103FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
104RDEPENDS_gpsd-udev += "udev gpsd-conf"
105
106SUMMARY_libgpsd = "C service library used for communicating with gpsd"
107FILES_libgpsd = "${libdir}/libgpsd.so.*"
108
109SUMMARY_libgps = "C service library used for communicating with gpsd"
110FILES_libgps = "${libdir}/libgps.so.*"
111
112SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
113FILES_gpsd-conf = "${sysconfdir}"
114CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
115
116SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
117FILES_gpsd-gpsctl = "${bindir}/gpsctl"
118
119SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
Brad Bishop26bdd442019-08-16 17:08:17 -0400120# Python files are required for gps/fake, required for gpsfake.
121FILES_gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500122RDEPENDS_gps-utils = "python3-pygps"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400123
Andrew Geissler82c905d2020-04-13 13:39:40 -0500124SUMMARY_python3-pygps = "Python bindings to gpsd"
125FILES_python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
126RDEPENDS_python3-pygps = " \
127 python3-core \
128 python3-io \
129 python3-threading \
130 python3-terminal \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400131 gpsd \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500132 python3-json"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400133
134RPROVIDES_${PN} += "${PN}-systemd"
135RREPLACES_${PN} += "${PN}-systemd"
136RCONFLICTS_${PN} += "${PN}-systemd"
137SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
138
139
140ALTERNATIVE_${PN} = "gpsd-defaults"
141ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
142ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"