blob: 6834bd45a7d32c7c08ed493f338ccef3e9e2e459 [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"
Brad Bishop93c3acf2019-10-29 09:48:15 -04005DEPENDS = "dbus ncurses python python3 libusb1 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 \
Brad Bishop93c3acf2019-10-29 09:48:15 -040010 file://0001-gps_shm_close-Free-privdata.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040011"
Brad Bishop26bdd442019-08-16 17:08:17 -040012SRC_URI[md5sum] = "b3bf88706794eb8e5f2c2543bf7ba87b"
13SRC_URI[sha256sum] = "27dd24d45b2ac69baab7933da2bf6ae5fb0be90130f67e753c110a3477155f39"
Brad Bishop316dfdd2018-06-25 12:45:53 -040014
Brad Bishop26bdd442019-08-16 17:08:17 -040015inherit scons update-rc.d python-dir pythonnative 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
26PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}"
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 Bishop316dfdd2018-06-25 12:45:53 -040029EXTRA_OESCONS = " \
30 sysroot=${STAGING_DIR_TARGET} \
31 libQgpsmm='false' \
Brad Bishop26bdd442019-08-16 17:08:17 -040032 debug='false' \
33 nostrip='true' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040034 systemd='${SYSTEMD_OESCONS}' \
35 libdir='${libdir}' \
Brad Bishop26bdd442019-08-16 17:08:17 -040036 manbuild='false' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040037 ${PACKAGECONFIG_CONFARGS} \
38"
39# this cannot be used, because then chrpath is not found and only static lib is built
40# target=${HOST_SYS}
41
42do_compile_prepend() {
43 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
44 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
45 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
46 export LINKFLAGS="${LDFLAGS}"
47}
48
49do_install() {
50 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
51 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
52 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
53 export LINKFLAGS="${LDFLAGS}"
54
55 export DESTDIR="${D}"
56 # prefix is used for RPATH and DESTDIR/prefix for instalation
Brad Bishop26bdd442019-08-16 17:08:17 -040057 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \
Brad Bishop316dfdd2018-06-25 12:45:53 -040058 bbfatal "scons install execution failed."
59}
60
61do_install_append() {
62 install -d ${D}/${sysconfdir}/init.d
63 install -m 0755 ${S}/packaging/deb/etc_init.d_gpsd ${D}/${sysconfdir}/init.d/gpsd
64 install -d ${D}/${sysconfdir}/default
65 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default
66
67 #support for udev
68 install -d ${D}/${sysconfdir}/udev/rules.d
69 install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/
70 install -d ${D}${base_libdir}/udev/
71 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
72
73 #support for python
74 install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
75 install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
76
77 #support for systemd
78 install -d ${D}${systemd_unitdir}/system/
79 install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop26bdd442019-08-16 17:08:17 -040080 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040081 install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop26bdd442019-08-16 17:08:17 -040082 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040083 install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
84}
85
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080086PACKAGES =+ "libgps libgpsd python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
87
88RPROVIDES_${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040089
90FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
91 ${libdir}/libQgpsmm.prl"
92
Brad Bishop316dfdd2018-06-25 12:45:53 -040093RDEPENDS_${PN} = "gpsd-gpsctl"
94RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
95
96SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
97FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
98RDEPENDS_gpsd-udev += "udev gpsd-conf"
99
100SUMMARY_libgpsd = "C service library used for communicating with gpsd"
101FILES_libgpsd = "${libdir}/libgpsd.so.*"
102
103SUMMARY_libgps = "C service library used for communicating with gpsd"
104FILES_libgps = "${libdir}/libgps.so.*"
105
106SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
107FILES_gpsd-conf = "${sysconfdir}"
108CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
109
110SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
111FILES_gpsd-gpsctl = "${bindir}/gpsctl"
112
113SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
Brad Bishop26bdd442019-08-16 17:08:17 -0400114# Python files are required for gps/fake, required for gpsfake.
115FILES_gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400116RDEPENDS_gps-utils = "python-pygps"
117
118SUMMARY_python-pygps = "Python bindings to gpsd"
Brad Bishop26bdd442019-08-16 17:08:17 -0400119FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400120RDEPENDS_python-pygps = " \
121 python-core \
122 python-io \
123 python-threading \
124 python-terminal \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400125 gpsd \
126 python-json"
127
128RPROVIDES_${PN} += "${PN}-systemd"
129RREPLACES_${PN} += "${PN}-systemd"
130RCONFLICTS_${PN} += "${PN}-systemd"
131SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
132
133
134ALTERNATIVE_${PN} = "gpsd-defaults"
135ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
136ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"