blob: c11d4c76d64ed66a0a7f015eeeb6c822d7242339 [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"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05004LIC_FILES_CHKSUM = "file://COPYING;md5=7a5d174db44ec45f9638b2c747806821"
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 \
Patrick Williams93c203f2021-10-06 16:15:23 -05009 file://gpsd.init \
10 "
11SRC_URI[sha256sum] = "0b991ce9a46538c4ea450f7a8ee428ff44fb4f8d665fddf2ffe40fe0ae9a6c09"
Brad Bishop316dfdd2018-06-25 12:45:53 -040012
Patrick Williams93c203f2021-10-06 16:15:23 -050013inherit scons update-rc.d python3-dir python3native systemd update-alternatives pkgconfig
Brad Bishop316dfdd2018-06-25 12:45:53 -040014
15INITSCRIPT_PACKAGES = "gpsd-conf"
16INITSCRIPT_NAME = "gpsd"
17INITSCRIPT_PARAMS = "defaults 35"
18
19SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
20
21export STAGING_INCDIR
22export STAGING_LIBDIR
23
Andrew Geissler2ee498a2020-05-29 15:52:06 -050024CLEANBROKEN = "1"
25
Brad Bishope42b3e32020-01-15 22:08:42 -050026PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb"
Brad Bishop26bdd442019-08-16 17:08:17 -040027PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5"
Brad Bishop15ae2502019-06-18 21:44:24 -040028PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
Brad Bishope42b3e32020-01-15 22:08:42 -050029PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1"
Brad Bishop316dfdd2018-06-25 12:45:53 -040030EXTRA_OESCONS = " \
31 sysroot=${STAGING_DIR_TARGET} \
32 libQgpsmm='false' \
Brad Bishop26bdd442019-08-16 17:08:17 -040033 debug='false' \
34 nostrip='true' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040035 systemd='${SYSTEMD_OESCONS}' \
36 libdir='${libdir}' \
Andrew Geissler595f6302022-01-24 19:11:47 +000037 sbindir='${sbindir}' \
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050038 udevdir='${nonarch_base_libdir}/udev' \
39 unitdir='${systemd_system_unitdir}' \
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"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050044# This cannot be used, because then chrpath is not found and only static lib is built
Brad Bishop316dfdd2018-06-25 12:45:53 -040045# target=${HOST_SYS}
46
Patrick Williams213cb262021-08-07 19:21:33 -050047do_compile:prepend() {
Brad Bishop316dfdd2018-06-25 12:45:53 -040048 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 Geissler595f6302022-01-24 19:11:47 +000051 export CC="${CC}"
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}"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050064 # prefix is used for RPATH and DESTDIR/prefix for installation
65 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} udev-install ${EXTRA_OESCONS} || \
Brad Bishop316dfdd2018-06-25 12:45:53 -040066 bbfatal "scons install execution failed."
67}
68
Patrick Williams213cb262021-08-07 19:21:33 -050069do_install:append() {
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050070 install -d ${D}${sysconfdir}/init.d
71 install -m 0755 ${WORKDIR}/gpsd.init ${D}${sysconfdir}/init.d/gpsd
72 install -d ${D}${sysconfdir}/default
73 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}${sysconfdir}/default/gpsd.default
Brad Bishop316dfdd2018-06-25 12:45:53 -040074
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050075 # Support for python
76 install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps
Andrew Geisslereff27472021-10-29 15:35:00 -050077 install -m 755 ${D}${libdir}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps
Brad Bishop316dfdd2018-06-25 12:45:53 -040078}
79
Andrew Geissler595f6302022-01-24 19:11:47 +000080PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080081
Patrick Williams213cb262021-08-07 19:21:33 -050082RPROVIDES:${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040083
Andrew Geissler595f6302022-01-24 19:11:47 +000084FILES:${PN}-dev += "${libdir}/libQgpsmm.prl"
Brad Bishop316dfdd2018-06-25 12:45:53 -040085
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050086FILES:${PN}-doc += "${datadir}/${BPN}/doc"
87
Patrick Williams213cb262021-08-07 19:21:33 -050088RDEPENDS:${PN} = "gpsd-gpsctl"
89RRECOMMENDS:${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
Brad Bishop316dfdd2018-06-25 12:45:53 -040090
Patrick Williams213cb262021-08-07 19:21:33 -050091SUMMARY:gpsd-udev = "udev relevant files to use gpsd hotplugging"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050092FILES:gpsd-udev = "${nonarch_base_libdir}/udev"
Patrick Williams213cb262021-08-07 19:21:33 -050093RDEPENDS:gpsd-udev += "udev gpsd-conf"
Brad Bishop316dfdd2018-06-25 12:45:53 -040094
Patrick Williams213cb262021-08-07 19:21:33 -050095SUMMARY:libgps = "C service library used for communicating with gpsd"
96FILES:libgps = "${libdir}/libgps.so.*"
Brad Bishop316dfdd2018-06-25 12:45:53 -040097
Patrick Williams213cb262021-08-07 19:21:33 -050098SUMMARY:gpsd-conf = "gpsd configuration files and init scripts"
99FILES:gpsd-conf = "${sysconfdir}"
100CONFFILES:gpsd-conf = "${sysconfdir}/default/gpsd.default"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400101
Patrick Williams213cb262021-08-07 19:21:33 -0500102SUMMARY:gpsd-gpsctl = "Tool for tweaking GPS modes"
103FILES:gpsd-gpsctl = "${bindir}/gpsctl"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400104
Patrick Williams213cb262021-08-07 19:21:33 -0500105SUMMARY:gps-utils = "Utils used for simulating, monitoring,... a GPS"
Brad Bishop26bdd442019-08-16 17:08:17 -0400106# Python files are required for gps/fake, required for gpsfake.
Andrew Geissler595f6302022-01-24 19:11:47 +0000107FILES:gps-utils = "\
108 ${bindir}/cgps \
109 ${bindir}/gegps \
110 ${bindir}/gps2udp \
111 ${bindir}/gpscat \
112 ${bindir}/gpscsv \
113 ${bindir}/gpsctl \
114 ${bindir}/gpsdebuginfo \
115 ${bindir}/gpsdecode \
116 ${bindir}/gpsfake \
117 ${bindir}/gpsmon \
118 ${bindir}/gpspipe \
119 ${bindir}/gpsplot \
120 ${bindir}/gpsprof \
121 ${bindir}/gpsrinex \
122 ${bindir}/gpssnmp \
123 ${bindir}/gpssubframe \
124 ${bindir}/gpxlogger \
125 ${bindir}/lcdgps \
126 ${bindir}/ntpshmmon \
127 ${bindir}/ppscheck \
128 ${bindir}/ubxtool \
129 ${bindir}/xgps \
130 ${bindir}/xgpsspeed \
131 ${bindir}/zerk \
132"
Patrick Williams213cb262021-08-07 19:21:33 -0500133RDEPENDS:gps-utils = "python3-pygps"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400134
Patrick Williams213cb262021-08-07 19:21:33 -0500135SUMMARY:python3-pygps = "Python bindings to gpsd"
136FILES:python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
137RDEPENDS:python3-pygps = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500138 python3-core \
139 python3-io \
140 python3-threading \
141 python3-terminal \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400142 gpsd \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500143 python3-json"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400144
Patrick Williams213cb262021-08-07 19:21:33 -0500145RPROVIDES:${PN} += "${PN}-systemd"
146RREPLACES:${PN} += "${PN}-systemd"
147RCONFLICTS:${PN} += "${PN}-systemd"
148SYSTEMD_SERVICE:${PN} = "${BPN}.socket ${BPN}ctl@.service"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400149
Patrick Williams213cb262021-08-07 19:21:33 -0500150ALTERNATIVE:${PN} = "gpsd-defaults"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400151ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
152ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"