blob: 245f8728cbe12015db0e8ef5f8c34c7c8e0154cf [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 "
Andrew Geisslerd5838332022-05-27 11:33:10 -050011SRC_URI[sha256sum] = "00ee13f615655284874a661be13553abe66128e6deb5cd648af9bc0cb345fe5c"
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
Patrick Williams03907ee2022-05-01 06:28:52 -050076 if [ -d ${D}${libdir}/gps ]; then
77 install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps
78 install -m 755 ${D}${libdir}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps
79 fi
Brad Bishop316dfdd2018-06-25 12:45:53 -040080}
81
Patrick Williams03907ee2022-05-01 06:28:52 -050082PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils gps-utils-python"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080083
Patrick Williams213cb262021-08-07 19:21:33 -050084RPROVIDES:${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040085
Andrew Geissler595f6302022-01-24 19:11:47 +000086FILES:${PN}-dev += "${libdir}/libQgpsmm.prl"
Brad Bishop316dfdd2018-06-25 12:45:53 -040087
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050088FILES:${PN}-doc += "${datadir}/${BPN}/doc"
89
Patrick Williams213cb262021-08-07 19:21:33 -050090RDEPENDS:${PN} = "gpsd-gpsctl"
91RRECOMMENDS:${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
Brad Bishop316dfdd2018-06-25 12:45:53 -040092
Patrick Williams213cb262021-08-07 19:21:33 -050093SUMMARY:gpsd-udev = "udev relevant files to use gpsd hotplugging"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050094FILES:gpsd-udev = "${nonarch_base_libdir}/udev"
Patrick Williams213cb262021-08-07 19:21:33 -050095RDEPENDS:gpsd-udev += "udev gpsd-conf"
Brad Bishop316dfdd2018-06-25 12:45:53 -040096
Patrick Williams213cb262021-08-07 19:21:33 -050097SUMMARY:libgps = "C service library used for communicating with gpsd"
98FILES:libgps = "${libdir}/libgps.so.*"
Brad Bishop316dfdd2018-06-25 12:45:53 -040099
Patrick Williams213cb262021-08-07 19:21:33 -0500100SUMMARY:gpsd-conf = "gpsd configuration files and init scripts"
101FILES:gpsd-conf = "${sysconfdir}"
102CONFFILES:gpsd-conf = "${sysconfdir}/default/gpsd.default"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400103
Patrick Williams213cb262021-08-07 19:21:33 -0500104SUMMARY:gpsd-gpsctl = "Tool for tweaking GPS modes"
105FILES:gpsd-gpsctl = "${bindir}/gpsctl"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400106
Patrick Williams213cb262021-08-07 19:21:33 -0500107SUMMARY:gps-utils = "Utils used for simulating, monitoring,... a GPS"
Andrew Geissler595f6302022-01-24 19:11:47 +0000108FILES:gps-utils = "\
109 ${bindir}/cgps \
Andrew Geissler595f6302022-01-24 19:11:47 +0000110 ${bindir}/gps2udp \
Andrew Geissler595f6302022-01-24 19:11:47 +0000111 ${bindir}/gpsctl \
112 ${bindir}/gpsdebuginfo \
113 ${bindir}/gpsdecode \
Andrew Geissler595f6302022-01-24 19:11:47 +0000114 ${bindir}/gpsmon \
115 ${bindir}/gpspipe \
Andrew Geissler595f6302022-01-24 19:11:47 +0000116 ${bindir}/gpsrinex \
117 ${bindir}/gpssnmp \
Andrew Geissler595f6302022-01-24 19:11:47 +0000118 ${bindir}/gpxlogger \
119 ${bindir}/lcdgps \
120 ${bindir}/ntpshmmon \
121 ${bindir}/ppscheck \
Patrick Williams03907ee2022-05-01 06:28:52 -0500122"
123RRECOMMENDS:gps-utils = "gps-utils-python"
124
125SUMMARY:gps-utils-python = "Python utils used for simulating, monitoring,... a GPS"
126FILES:gps-utils-python = "\
127 ${bindir}/gegps \
128 ${bindir}/gpscat \
129 ${bindir}/gpscsv \
130 ${bindir}/gpsfake \
131 ${bindir}/gpsplot \
132 ${bindir}/gpsprof \
133 ${bindir}/gpssubframe \
Andrew Geissler595f6302022-01-24 19:11:47 +0000134 ${bindir}/ubxtool \
135 ${bindir}/xgps \
136 ${bindir}/xgpsspeed \
137 ${bindir}/zerk \
138"
Patrick Williams03907ee2022-05-01 06:28:52 -0500139RDEPENDS:gps-utils-python = "python3-pygps"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400140
Patrick Williams213cb262021-08-07 19:21:33 -0500141SUMMARY:python3-pygps = "Python bindings to gpsd"
142FILES:python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
143RDEPENDS:python3-pygps = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500144 python3-core \
145 python3-io \
146 python3-threading \
147 python3-terminal \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400148 gpsd \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500149 python3-json"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400150
Patrick Williams213cb262021-08-07 19:21:33 -0500151RPROVIDES:${PN} += "${PN}-systemd"
152RREPLACES:${PN} += "${PN}-systemd"
153RCONFLICTS:${PN} += "${PN}-systemd"
154SYSTEMD_SERVICE:${PN} = "${BPN}.socket ${BPN}ctl@.service"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400155
Patrick Williams213cb262021-08-07 19:21:33 -0500156ALTERNATIVE:${PN} = "gpsd-defaults"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400157ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
158ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"