blob: 131e84961b0d602a7be74a0178fd83554beab562 [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
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 \
12 file://0004-SConstruct-disable-html-and-man-docs-building-becaus.patch \
13 file://0001-include-sys-ttydefaults.h.patch \
14"
15SRC_URI[md5sum] = "e0cfadcf4a65dfbdd2afb11c58f4e4a1"
16SRC_URI[sha256sum] = "68e0dbecfb5831997f8b3d6ba48aed812eb465d8c0089420ab68f9ce4d85e77a"
17
18inherit scons update-rc.d python-dir pythonnative systemd bluetooth update-alternatives
19
20INITSCRIPT_PACKAGES = "gpsd-conf"
21INITSCRIPT_NAME = "gpsd"
22INITSCRIPT_PARAMS = "defaults 35"
23
24SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
25
26export STAGING_INCDIR
27export STAGING_LIBDIR
28
29PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}"
30PACKAGECONFIG[bluez] = "bluez='true',bluez='false',${BLUEZ}"
Brad Bishop15ae2502019-06-18 21:44:24 -040031PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
Brad Bishop316dfdd2018-06-25 12:45:53 -040032EXTRA_OESCONS = " \
33 sysroot=${STAGING_DIR_TARGET} \
34 libQgpsmm='false' \
35 debug='true' \
36 strip='false' \
37 chrpath='yes' \
38 systemd='${SYSTEMD_OESCONS}' \
39 libdir='${libdir}' \
40 ${PACKAGECONFIG_CONFARGS} \
41"
42# this cannot be used, because then chrpath is not found and only static lib is built
43# target=${HOST_SYS}
44
45do_compile_prepend() {
46 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
47 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
48 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
49 export LINKFLAGS="${LDFLAGS}"
50}
51
52do_install() {
53 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
54 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
55 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
56 export LINKFLAGS="${LDFLAGS}"
57
58 export DESTDIR="${D}"
59 # prefix is used for RPATH and DESTDIR/prefix for instalation
60 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} install ${EXTRA_OESCONS}|| \
61 bbfatal "scons install execution failed."
62}
63
64do_install_append() {
65 install -d ${D}/${sysconfdir}/init.d
66 install -m 0755 ${S}/packaging/deb/etc_init.d_gpsd ${D}/${sysconfdir}/init.d/gpsd
67 install -d ${D}/${sysconfdir}/default
68 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}/${sysconfdir}/default/gpsd.default
69
70 #support for udev
71 install -d ${D}/${sysconfdir}/udev/rules.d
72 install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/
73 install -d ${D}${base_libdir}/udev/
74 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
75
76 #support for python
77 install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
78 install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
79
80 #support for systemd
81 install -d ${D}${systemd_unitdir}/system/
82 install -m 0644 ${S}/systemd/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
83 install -m 0644 ${S}/systemd/${BPN}ctl@.service ${D}${systemd_unitdir}/system/${BPN}ctl@.service
84 install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
85}
86
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080087PACKAGES =+ "libgps libgpsd python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
88
89RPROVIDES_${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040090
91FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
92 ${libdir}/libQgpsmm.prl"
93
Brad Bishop316dfdd2018-06-25 12:45:53 -040094RDEPENDS_${PN} = "gpsd-gpsctl"
95RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
96
97SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
98FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
99RDEPENDS_gpsd-udev += "udev gpsd-conf"
100
101SUMMARY_libgpsd = "C service library used for communicating with gpsd"
102FILES_libgpsd = "${libdir}/libgpsd.so.*"
103
104SUMMARY_libgps = "C service library used for communicating with gpsd"
105FILES_libgps = "${libdir}/libgps.so.*"
106
107SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
108FILES_gpsd-conf = "${sysconfdir}"
109CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
110
111SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
112FILES_gpsd-gpsctl = "${bindir}/gpsctl"
113
114SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
115FILES_gps-utils = "${bindir}/*"
116RDEPENDS_gps-utils = "python-pygps"
117
118SUMMARY_python-pygps = "Python bindings to gpsd"
119FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/*"
120RDEPENDS_python-pygps = " \
121 python-core \
122 python-io \
123 python-threading \
124 python-terminal \
125 python-curses \
126 gpsd \
127 python-json"
128
129RPROVIDES_${PN} += "${PN}-systemd"
130RREPLACES_${PN} += "${PN}-systemd"
131RCONFLICTS_${PN} += "${PN}-systemd"
132SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
133
134
135ALTERNATIVE_${PN} = "gpsd-defaults"
136ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
137ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"