From: Hugo Villeneuve Date: Tue, 31 Mar 2026 20:30:40 +0000 (-0400) Subject: Add yocto recipe template X-Git-Url: http://gitweb.hugovil.com/sitemap.xml?a=commitdiff_plain;h=6a08a3bd8d82d4ae1ca1ecce63e8e5b34be29de0;p=mpdstream Add yocto recipe template Signed-off-by: Hugo Villeneuve --- diff --git a/.gitignore b/.gitignore index 1f0e924..38025f4 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ m4/lt~obsolete.m4 build-aux/ltmain.sh libtool data/mpdstream.service +data/yocto_mpdstream_git.bb diff --git a/configure.ac b/configure.ac index c20e733..8539caa 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,12 @@ if test "x${with_systemd}" = xyes ; then AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) fi +dnl For substitution in yocto recipe: +GIT_BRANCH=`git branch --show-current 2>/dev/null || echo "master"` +GIT_REVISION=`git rev-parse HEAD 2>/dev/null || echo "\${AUTOREV}"` +AC_SUBST([GIT_BRANCH]) +AC_SUBST([GIT_REVISION]) + AC_SUBST(WARNINGCFLAGS) AC_SUBST(ac_aux_dir) @@ -69,6 +75,7 @@ dnl Creating output file(s) AC_CONFIG_FILES([Makefile data/Makefile data/mpdstream.service + data/yocto_mpdstream_git.bb doc/Makefile src/Makefile ]) diff --git a/data/Makefile.am b/data/Makefile.am index 42ea057..d9d0ac8 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,7 +5,8 @@ systemdsystemunit_DATA = mpdstream.service systemdsystemunitdir = @systemdsystemunitdir@ EXTRA_DIST = \ - mpdstream.service + mpdstream.service \ + yocto_mpdstream_git.bb CLEANFILES = *~ diff --git a/data/yocto_mpdstream_git.bb.in b/data/yocto_mpdstream_git.bb.in new file mode 100644 index 0000000..a611702 --- /dev/null +++ b/data/yocto_mpdstream_git.bb.in @@ -0,0 +1,26 @@ +DESCRIPTION = "Tool to automatically restart broken MPD internet streams" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-or-later;md5=fed54355545ffd980b814dab4a3b312c" + +DEPENDS = " libmpdclient systemd" + +PV = "@PACKAGE_VERSION@" +SRCBRANCH = "@GIT_BRANCH@" +SRCREV = "@GIT_REVISION@" +SRC_URI = "git://git.hugovil.com/git/mpdstream;protocol=http;branch=${SRCBRANCH}" + +inherit autotools pkgconfig systemd + +do_configure:prepend() { + saved_dir=$(pwd) + cd ${S}; ./autogen.sh + cd ${saved_dir} +} + +EXTRA_OECONF = " \ + --with-systemd \ +" + +SYSTEMD_SERVICE:${PN} = " \ + ${PN}.service \ +"