blob: 7752e76b54a4ea7be3a756925ab7eecaab028e91 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001SUMMARY = "A TCP/IP Daemon simplifying the communication with GPS devices"
2SECTION = "console/network"
3LICENSE = "BSD"
4LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800"
5DEPENDS = "dbus dbus-glib ncurses python libusb1 chrpath-replacement-native pps-tools"
6PROVIDES = "virtual/gpsd"
7
Brad Bishopc8f47122019-06-24 09:36:18 -04008# SConstruct in gpsd does not yet support Python 3
9DEPENDS += "python-scons-native"
10DEPENDS_remove = "python3-scons-native"
11
Brad Bishop316dfdd2018-06-25 12:45:53 -040012EXTRANATIVEPATH += "chrpath-native"
13
14SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
15 file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \
16 file://0004-SConstruct-disable-html-and-man-docs-building-becaus.patch \
17 file://0001-include-sys-ttydefaults.h.patch \
18"
19SRC_URI[md5sum] = "e0cfadcf4a65dfbdd2afb11c58f4e4a1"
20SRC_URI[sha256sum] = "68e0dbecfb5831997f8b3d6ba48aed812eb465d8c0089420ab68f9ce4d85e77a"
21
22inherit scons update-rc.d python-dir pythonnative systemd bluetooth update-alternatives
23
24INITSCRIPT_PACKAGES = "gpsd-conf"
25INITSCRIPT_NAME = "gpsd"
26INITSCRIPT_PARAMS = "defaults 35"
27
28SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
29
30export STAGING_INCDIR
31export STAGING_LIBDIR
32
33PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}"
34PACKAGECONFIG[bluez] = "bluez='true',bluez='false',${BLUEZ}"
Brad Bishop15ae2502019-06-18 21:44:24 -040035PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
Brad Bishop316dfdd2018-06-25 12:45:53 -040036EXTRA_OESCONS = " \
37 sysroot=${STAGING_DIR_TARGET} \
38 libQgpsmm='false' \
39 debug='true' \
40 strip='false' \
41 chrpath='yes' \
42 systemd='${SYSTEMD_OESCONS}' \
43 libdir='${libdir}' \
44 ${PACKAGECONFIG_CONFARGS} \
45"
46# this cannot be used, because then chrpath is not found and only static lib is built
47# target=${HOST_SYS}
48
49do_compile_prepend() {
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
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}"
60 export LINKFLAGS="${LDFLAGS}"
61
62 export DESTDIR="${D}"
63 # prefix is used for RPATH and DESTDIR/prefix for instalation
64 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} install ${EXTRA_OESCONS}|| \
65 bbfatal "scons install execution failed."
66}
67
68do_install_append() {
69 install -d ${D}/${sysconfdir}/init.d
70 install -m 0755 ${S}/packaging/deb/etc_init.d_gpsd ${D}/${sysconfdir}/init.d/gpsd
71 install -d ${D}/${sysconfdir}/default
72 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default
73
74 #support for udev
75 install -d ${D}/${sysconfdir}/udev/rules.d
76 install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/
77 install -d ${D}${base_libdir}/udev/
78 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
79
80 #support for python
81 install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
82 install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
83
84 #support for systemd
85 install -d ${D}${systemd_unitdir}/system/
86 install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
87 install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service
88 install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
89}
90
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080091PACKAGES =+ "libgps libgpsd python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
92
93RPROVIDES_${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040094
95FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
96 ${libdir}/libQgpsmm.prl"
97
Brad Bishop316dfdd2018-06-25 12:45:53 -040098RDEPENDS_${PN} = "gpsd-gpsctl"
99RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
100
101SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
102FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
103RDEPENDS_gpsd-udev += "udev gpsd-conf"
104
105SUMMARY_libgpsd = "C service library used for communicating with gpsd"
106FILES_libgpsd = "${libdir}/libgpsd.so.*"
107
108SUMMARY_libgps = "C service library used for communicating with gpsd"
109FILES_libgps = "${libdir}/libgps.so.*"
110
111SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
112FILES_gpsd-conf = "${sysconfdir}"
113CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
114
115SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
116FILES_gpsd-gpsctl = "${bindir}/gpsctl"
117
118SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
119FILES_gps-utils = "${bindir}/*"
120RDEPENDS_gps-utils = "python-pygps"
121
122SUMMARY_python-pygps = "Python bindings to gpsd"
123FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/*"
124RDEPENDS_python-pygps = " \
125 python-core \
126 python-io \
127 python-threading \
128 python-terminal \
129 python-curses \
130 gpsd \
131 python-json"
132
133RPROVIDES_${PN} += "${PN}-systemd"
134RREPLACES_${PN} += "${PN}-systemd"
135RCONFLICTS_${PN} += "${PN}-systemd"
136SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
137
138
139ALTERNATIVE_${PN} = "gpsd-defaults"
140ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
141ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"