blob: 7b7f335203eb9a40b743b4bed05f8d9f3f7bc74d [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"
5DEPENDS = "dbus ncurses python python3 libusb1 chrpath-replacement-native pps-tools"
Brad Bishop316dfdd2018-06-25 12:45:53 -04006PROVIDES = "virtual/gpsd"
7
8EXTRANATIVEPATH += "chrpath-native"
9
10SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
11 file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040012"
Brad Bishop26bdd442019-08-16 17:08:17 -040013SRC_URI[md5sum] = "b3bf88706794eb8e5f2c2543bf7ba87b"
14SRC_URI[sha256sum] = "27dd24d45b2ac69baab7933da2bf6ae5fb0be90130f67e753c110a3477155f39"
Brad Bishop316dfdd2018-06-25 12:45:53 -040015
Brad Bishop26bdd442019-08-16 17:08:17 -040016inherit scons update-rc.d python-dir pythonnative 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
27PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}"
Brad Bishop26bdd442019-08-16 17:08:17 -040028PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5"
Brad Bishop15ae2502019-06-18 21:44:24 -040029PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
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 chrpath='yes' \
36 systemd='${SYSTEMD_OESCONS}' \
37 libdir='${libdir}' \
Brad Bishop26bdd442019-08-16 17:08:17 -040038 manbuild='false' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040039 ${PACKAGECONFIG_CONFARGS} \
40"
41# this cannot be used, because then chrpath is not found and only static lib is built
42# target=${HOST_SYS}
43
44do_compile_prepend() {
45 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
46 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
47 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
48 export LINKFLAGS="${LDFLAGS}"
49}
50
51do_install() {
52 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
53 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
54 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
55 export LINKFLAGS="${LDFLAGS}"
56
57 export DESTDIR="${D}"
58 # prefix is used for RPATH and DESTDIR/prefix for instalation
Brad Bishop26bdd442019-08-16 17:08:17 -040059 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \
Brad Bishop316dfdd2018-06-25 12:45:53 -040060 bbfatal "scons install execution failed."
61}
62
63do_install_append() {
64 install -d ${D}/${sysconfdir}/init.d
65 install -m 0755 ${S}/packaging/deb/etc_init.d_gpsd ${D}/${sysconfdir}/init.d/gpsd
66 install -d ${D}/${sysconfdir}/default
67 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default
68
69 #support for udev
70 install -d ${D}/${sysconfdir}/udev/rules.d
71 install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/
72 install -d ${D}${base_libdir}/udev/
73 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
74
75 #support for python
76 install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
77 install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
78
79 #support for systemd
80 install -d ${D}${systemd_unitdir}/system/
81 install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop26bdd442019-08-16 17:08:17 -040082 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040083 install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop26bdd442019-08-16 17:08:17 -040084 sed -i -e 's,/usr/local,/usr,g' ${D}${systemd_unitdir}/system/${BPN}ctl@.service
Brad Bishop316dfdd2018-06-25 12:45:53 -040085 install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
86}
87
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080088PACKAGES =+ "libgps libgpsd python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
89
90RPROVIDES_${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040091
92FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
93 ${libdir}/libQgpsmm.prl"
94
Brad Bishop316dfdd2018-06-25 12:45:53 -040095RDEPENDS_${PN} = "gpsd-gpsctl"
96RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
97
98SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
99FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
100RDEPENDS_gpsd-udev += "udev gpsd-conf"
101
102SUMMARY_libgpsd = "C service library used for communicating with gpsd"
103FILES_libgpsd = "${libdir}/libgpsd.so.*"
104
105SUMMARY_libgps = "C service library used for communicating with gpsd"
106FILES_libgps = "${libdir}/libgps.so.*"
107
108SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
109FILES_gpsd-conf = "${sysconfdir}"
110CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
111
112SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
113FILES_gpsd-gpsctl = "${bindir}/gpsctl"
114
115SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
Brad Bishop26bdd442019-08-16 17:08:17 -0400116# Python files are required for gps/fake, required for gpsfake.
117FILES_gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400118RDEPENDS_gps-utils = "python-pygps"
119
120SUMMARY_python-pygps = "Python bindings to gpsd"
Brad Bishop26bdd442019-08-16 17:08:17 -0400121FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400122RDEPENDS_python-pygps = " \
123 python-core \
124 python-io \
125 python-threading \
126 python-terminal \
127 python-curses \
128 gpsd \
129 python-json"
130
131RPROVIDES_${PN} += "${PN}-systemd"
132RREPLACES_${PN} += "${PN}-systemd"
133RCONFLICTS_${PN} += "${PN}-systemd"
134SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
135
136
137ALTERNATIVE_${PN} = "gpsd-defaults"
138ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
139ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"