blob: aef9b138ab7d7d14ea32021b4039734ae4a6025f [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "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-respect-sysroot-also-in-SPLINTOPTS.patch \
12 file://0002-SConstruct-remove-rpath.patch \
13 file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \
14 file://0004-SConstruct-disable-html-and-man-docs-building-becaus.patch \
15 file://0001-Check-for-__STDC_NO_ATOMICS__-before-using-stdatomic.patch \
16 file://0002-Add-a-test-for-C11-and-check-we-have-C11-before-usin.patch \
17 file://0003-Whoops-check-for-C11-not-for-not-C11-in-stdatomic.h-.patch \
18 file://0001-Include-stdatomic.h-only-in-C-mode.patch \
19 file://0001-libgpsd-core-Fix-issue-with-ACTIVATE-hook-not-being-.patch \
20 file://gpsd-default \
21 file://gpsd \
22 file://60-gpsd.rules \
23 file://gpsd.service \
24"
25SRC_URI[md5sum] = "bc7467009b99e07ba461377b5da6c039"
26SRC_URI[sha256sum] = "504fc812f3c1525a1a48e04bf4d77f9a8066c201448d98089df89d58ef53a8cb"
27
28inherit scons update-rc.d python-dir pythonnative systemd bluetooth
29
30INITSCRIPT_NAME = "gpsd"
31INITSCRIPT_PARAMS = "defaults 35"
32
33SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
34
35export STAGING_INCDIR
36export STAGING_LIBDIR
37
38PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}"
39PACKAGECONFIG[bluez] = "bluez='true',bluez='false',${BLUEZ}"
40PACKAGECONFIG[qt] = "qt='yes',qt='no',qt4-x11-free"
41EXTRA_OESCONS = " \
42 sysroot=${STAGING_DIR_TARGET} \
43 libQgpsmm='false' \
44 debug='true' \
45 strip='false' \
46 chrpath='yes' \
47 systemd='${SYSTEMD_OESCONS}' \
48 ${EXTRA_OECONF} \
49"
50DISABLE_STATIC = ""
51# this cannot be used, because then chrpath is not found and only static lib is built
52# target=${HOST_SYS}
53
54do_compile_prepend() {
55 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
56 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
57 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
58
59 export BUILD_SYS="${BUILD_SYS}"
60 export HOST_SYS="${HOST_SYS}"
61}
62
63do_install() {
64 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
65 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
66 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
67
68 export BUILD_SYS="${BUILD_SYS}"
69 export HOST_SYS="${HOST_SYS}"
70
71 export DESTDIR="${D}"
72 # prefix is used for RPATH and DESTDIR/prefix for instalation
73 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} install ${EXTRA_OESCONS}|| \
74 bbfatal "scons install execution failed."
75}
76
77do_install_append() {
78 install -d ${D}/${sysconfdir}/init.d
79 install -m 0755 ${WORKDIR}/gpsd ${D}/${sysconfdir}/init.d/
80 install -d ${D}/${sysconfdir}/default
81 install -m 0644 ${WORKDIR}/gpsd-default ${D}/${sysconfdir}/default/gpsd.default
82
83 #support for udev
84 install -d ${D}/${sysconfdir}/udev/rules.d
85 install -m 0644 ${WORKDIR}/60-gpsd.rules ${D}/${sysconfdir}/udev/rules.d
86 install -d ${D}${base_libdir}/udev/
87 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
88
89 #support for python
90 install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
91 install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
92
93 #support for systemd
94 install -d ${D}${systemd_unitdir}/system/
95 install -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
96 install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
97}
98
99pkg_postinst_${PN}-conf() {
100 update-alternatives --install ${sysconfdir}/default/gpsd gpsd-defaults ${sysconfdir}/default/gpsd.default 10
101}
102
103pkg_postrm_${PN}-conf() {
104 update-alternatives --remove gpsd-defaults ${sysconfdir}/default/gpsd.default
105}
106
107PACKAGES =+ "libgps libgpsd python-pygps-dbg python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
108
109FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
110 ${libdir}/libQgpsmm.prl"
111
112FILES_python-pygps-dbg += " ${libdir}/python*/site-packages/gps/.debug"
113
114RDEPENDS_${PN} = "gpsd-gpsctl"
115RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
116
117SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging"
118FILES_gpsd-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
119RDEPENDS_gpsd-udev += "udev gpsd-conf"
120
121SUMMARY_libgpsd = "C service library used for communicating with gpsd"
122FILES_libgpsd = "${libdir}/libgpsd.so.*"
123
124SUMMARY_libgps = "C service library used for communicating with gpsd"
125FILES_libgps = "${libdir}/libgps.so.*"
126
127SUMMARY_gpsd-conf = "gpsd configuration files and init scripts"
128FILES_gpsd-conf = "${sysconfdir}"
129CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
130
131SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes"
132FILES_gpsd-gpsctl = "${bindir}/gpsctl"
133
134SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
135FILES_gps-utils = "${bindir}/*"
136RDEPENDS_gps-utils = "python-pygps"
137
138SUMMARY_python-pygps = "Python bindings to gpsd"
139FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/*"
140RDEPENDS_python-pygps = "python-core python-curses gpsd python-json"
141
142RPROVIDES_${PN} += "${PN}-systemd"
143RREPLACES_${PN} += "${PN}-systemd"
144RCONFLICTS_${PN} += "${PN}-systemd"
145SYSTEMD_SERVICE_${PN} = "${PN}.socket"