Improvements in gypsy recipes
cover Improvements in gypsy recipes
From: "Felipe F. Tonello" <[email protected]>
Felipe F. Tonello (2):
gypsy: Improvements in recipes
gypsy: Added init script
.../gypsy/files/gypsy-initscript | 61 ++++++++++++++++++++++ meta-oe/recipes-navigation/gypsy/gypsy.inc | 29 ++++++++-- meta-oe/recipes-navigation/gypsy/gypsy_0.9.bb | 21 ++------ meta-oe/recipes-navigation/gypsy/gypsy_git.bb | 12 +++-- 4 files changed, 99 insertions(+), 24 deletions(-) create mode 100755 meta-oe/recipes-navigation/gypsy/files/gypsy-initscript
Signature · 1 line
1.8.3.1
PATCH 1/2 gypsy: Improvements in recipes
From: "Felipe F. Tonello" <[email protected]>
Some improvements were made:
* Fix recipes to use .inc file
* Fix git recipe that was not passing do_configure step
* Separeted gypsy daemon from libgypsy in different packages
--- meta-oe/recipes-navigation/gypsy/gypsy.inc | 16 +++++++++++++--- meta-oe/recipes-navigation/gypsy/gypsy_0.9.bb | 21 +++++---------------- meta-oe/recipes-navigation/gypsy/gypsy_git.bb | 12 ++++++++---- 3 files changed, 26 insertions(+), 23 deletions(-)
meta-oe/recipes-navigation/gypsy/gypsy.inc +13 -3
@@ -5,11 +5,21 @@ concurrently. Gypsy also hides the details of parsing NMEA from the \ client applications, passing the data as simple values for the clients \ to use." LICENSE = "GPLv2.0 & LGPLv2.1" -SECTION = "x11" -DEPENDS = "glib-2.0 dbus bluez4 dbus-glib libxslt-native" +SECTION = "console/network" +DEPENDS = "glib-2.0 dbus bluez4 dbus-glib libxslt-native libxslt" inherit autotools pkgconfig gtk-doc +PACKAGES += "libgypsy" EXTRA_OECONF += "--with-distro=debian" -FILES_${PN} += "/usr/share/dbus-1/services/" +FILES_${PN} = " \ + ${sysconfdir}/gypsy.conf \ + ${sysconfdir}/dbus-1 \ + ${libexecdir}/gypsy-daemon \ + ${datadir}/dbus-1 \ +" + +FILES_libgypsy = " \ + ${libdir}/libgypsy${SOLIBS} \ +"
meta-oe/recipes-navigation/gypsy/gypsy_0.9.bb +5 -16
@@ -1,26 +1,15 @@ -SUMMARY = "GPS Multiplexing Daemon" -DESCRIPTION = "Gypsy is a GPS multiplexing daemon which allows \ -multiple clients to access GPS data from multiple GPS sources \ -concurrently. Gypsy also hides the details of parsing NMEA from the \ -client applications, passing the data as simple values for the clients \ -to use." -LICENSE = "GPLv2+ & LGPLv2+" +require gypsy.inc + +PR = "r2" + LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ file://COPYING.lib;md5=7fbc338309ac38fefcd64b04bb903e34 \ file://src/main.c;beginline=1;endline=25;md5=3fe64e27e61b289b77383a54a982cbdd \ file://gypsy/gypsy-time.h;beginline=1;endline=24;md5=06432ea19a7b6607428d04d9dadc37fd" -SECTION = "x11" -DEPENDS = "glib-2.0 dbus bluez4 dbus-glib libxslt" - -SRC_URI = "http://gypsy.freedesktop.org/releases/gypsy-${PV}.tar.gz \ +SRC_URI += "http://gypsy.freedesktop.org/releases/gypsy-${PV}.tar.gz \ file://0001-g_type_init-is-deprecated-for-glib-2.35.0.patch \ " -PR = "r1" - -inherit autotools pkgconfig - -FILES_${PN} += "/usr/share/dbus-1/system-services/" SRC_URI[md5sum] = "e2d186df9c2cc3b70a027043e22acf1a" SRC_URI[sha256sum] = "14e1cbe17351f408538e033ca370b4bf51ccf9c88744e236ddfb271904f154d6"
meta-oe/recipes-navigation/gypsy/gypsy_git.bb +8 -4
@@ -4,15 +4,19 @@ DEFAULT_PREFERENCE = "-1" SRCREV = "be8c9c382d2d1d37b51d29b0843045121ec90213" PV = "0.9+git${SRCPV}" -PR = "r1" +PR = "r2" S = "${WORKDIR}/git" -LICENSE = "GPLv2+ & LGPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ file://COPYING.lib;md5=7fbc338309ac38fefcd64b04bb903e34 \ file://src/main.c;beginline=1;endline=25;md5=3fe64e27e61b289b77383a54a982cbdd \ file://gypsy/gypsy-time.h;beginline=1;endline=24;md5=06432ea19a7b6607428d04d9dadc37fd" -SRC_URI = "git://anongit.freedesktop.org/gypsy \ - file://fixups.patch" +SRC_URI += "git://anongit.freedesktop.org/gypsy \ + file://fixups.patch" + +do_configure_prepend() { + # from patch 563716fc596d53f1085949a9dd11a62f39b2d624 + test -d ${S}/m4 || mkdir -p ${S}/m4 +}
Signature · 1 line
1.8.3.1
PATCH 2/2 gypsy: Added init script
In reply to Felipe F. TonelloFrom: "Felipe F. Tonello" <[email protected]>
Added a modified version of the example init script, gypsy-example-initscript, from the gypsy repository to be compatible with OE based distros.
--- .../gypsy/files/gypsy-initscript | 61 ++++++++++++++++++++++ meta-oe/recipes-navigation/gypsy/gypsy.inc | 13 ++++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100755 meta-oe/recipes-navigation/gypsy/files/gypsy-initscript
meta-oe/recipes-navigation/gypsy/files/gypsy-initscript new file +61 -0
@@ -0,0 +1,61 @@ +#! /bin/sh +# +# based on gypsy-example-initscript in gypsy repository +# there are some little modifications to work with OE based distros +# []' Felipe Tonello [email protected] +# + +set -e + +DESC="Gypsy daemon" +NAME="gypsy-daemon" +DAEMON=/usr/lib/gypsy/$NAME +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME +USER=root + +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 + +# +# Function that starts the daemon/service. +# +d_start() { + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --user $USER --exec $DAEMON -- $DAEMON_OPTS +} + +# +# Function that stops the daemon/service. +# +d_stop() { + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --oknodo --user $USER --exec $DAEMON +} + + +case "$1" in + start) + echo -n "Starting $DESC: $NAME" + d_start + echo "." + ;; + stop) + echo -n "Stopping $DESC: $NAME" + d_stop + echo "." + ;; + restart|force-reload) + echo -n "Restarting $DESC: $NAME" + d_stop + sleep 1 + d_start + echo "." + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0
meta-oe/recipes-navigation/gypsy/gypsy.inc +12 -1
@@ -8,13 +8,20 @@ LICENSE = "GPLv2.0 & LGPLv2.1" SECTION = "console/network" DEPENDS = "glib-2.0 dbus bluez4 dbus-glib libxslt-native libxslt" -inherit autotools pkgconfig gtk-doc PACKAGES += "libgypsy" +SRC_URI = "file://gypsy-initscript" + +inherit autotools pkgconfig gtk-doc update-rc.d + +INITSCRIPT_NAME = "gypsy-daemon" +# make sure it starts after X +INITSCRIPT_PARAMS = "start 10 5 3 2 . stop 20 0 1 6 ." EXTRA_OECONF += "--with-distro=debian" FILES_${PN} = " \ ${sysconfdir}/gypsy.conf \ + ${sysconfdir}/init.d/gypsy-daemon \ ${sysconfdir}/dbus-1 \ ${libexecdir}/gypsy-daemon \ ${datadir}/dbus-1 \
@@ -23,3 +30,7 @@ FILES_${PN} = " \ FILES_libgypsy = " \ ${libdir}/libgypsy${SOLIBS} \ " + +do_install_append() { + install -D ${WORKDIR}/gypsy-initscript ${D}/${sysconfdir}/init.d/gypsy-daemon +}
Signature · 1 line
1.8.3.1
Re: [PATCH 2/2] gypsy: Added init script
Quoted 5 lines · Felipe F. Tonello
From: "Felipe F. Tonello" <[email protected]>
Added a modified version of the example init script, gypsy-example-initscript, from the gypsy repository to be compatible with OE based distros.
Actually I just realized that the daemon is called by dbus when clients connect to it. So I believe this patch is not necessary, unless we separate in a different package.
Felipe Tonello