Squashed 'import-layers/meta-openembedded/' content from commit 247b126
Change-Id: I40827e9ce5fba63f1cca2a0be44976ae8383b4c0
git-subtree-dir: import-layers/meta-openembedded
git-subtree-split: 247b1267bbe95719cd4877d2d3cfbaf2a2f4865a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna.inc b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna.inc
new file mode 100644
index 0000000..ebca755
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna.inc
@@ -0,0 +1,39 @@
+DESCRIPTION = "MiniDLNA (aka ReadyDLNA) is server software with the aim of \
+being fully compliant with DLNA/UPnP-AV clients."
+LICENSE = "GPL-2.0|BSD"
+DEPENDS = "ffmpeg flac libav jpeg sqlite3 libexif libogg libid3tag libvorbis"
+
+# because it depends on libav which has commercial flag
+LICENSE_FLAGS = "commercial"
+
+inherit gettext autotools-brokensep update-rc.d systemd
+
+SRC_URI = "git://git.code.sf.net/p/minidlna/git;branch=master;module=git \
+ file://minidlna-daemon.init.d \
+ file://minidlna.service "
+
+S = "${WORKDIR}/git"
+
+# This remove "--exclude=autopoint" option from autoreconf argument to avoid
+# configure.ac:30: error: required file './ABOUT-NLS' not found
+EXTRA_AUTORECONF = ""
+
+do_install_append(){
+ install -d ${D}${sysconfdir}
+ install -m 0755 minidlna.conf ${D}${sysconfdir}
+
+# Systemd script
+ install -d ${D}${nonarch_base_libdir}/systemd/system
+ install -m 0755 ${WORKDIR}/minidlna.service ${D}${nonarch_base_libdir}/systemd/system
+
+# Sysvinit script
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/minidlna-daemon.init.d ${D}${sysconfdir}/init.d/minidlna
+
+}
+
+SYSTEMD_SERVICE_${PN} = "minidlna.service"
+
+INITSCRIPT_NAME = "minidlna"
+INITSCRIPT_PARAMS = "defaults 90"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna/minidlna-daemon.init.d b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna/minidlna-daemon.init.d
new file mode 100644
index 0000000..9e64a20
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna/minidlna-daemon.init.d
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+NAME="minidlna"
+DAEMON=/usr/sbin/minidlnad
+SCRIPTNAME=/etc/init.d/$NAME
+PIDFILE=/var/run/$NAME.pid
+CONF=/etc/$NAME.conf
+ARGS="-f $CONF"
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+start_function() {
+
+ export PATH=$PWD:$PATH
+
+ if [ -f ${PIDFILE} ]; then
+ echo "$SCRIPTNAME already running with PID #`cat $PIDFILE` ( according to ${PIDFILE} )";
+ exit 0
+ fi
+
+ $DAEMON $ARGS
+
+ pid=$!
+
+ if [ "$pid" != "" ]; then
+ echo -n "$pid" > ${PIDFILE}
+ fi
+}
+
+stop_function() {
+
+ export PATH=$PWD:$PATH
+
+ if [ ! -e "${PIDFILE}" ]; then
+ echo "${SCRIPTNAME} not running ( according to ${PIDFILE} )";
+ exit 1;
+ fi
+ PID=`cat ${PIDFILE}`
+ kill -INT ${PID}
+ rm -f ${PIDFILE}
+}
+
+case $1 in
+ "start")
+ start_function
+ ;;
+ "stop")
+ stop_function
+ ;;
+ *)
+ echo "Usage: $0 {start | stop}"
+
+esac
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna/minidlna.service b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna/minidlna.service
new file mode 100644
index 0000000..656100b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna/minidlna.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Minidlna Daemon
+After=network.target
+
+[Service]
+Type=notify
+ExecStart=/usr/sbin/minidlnad -f /etc/minidlna.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna_1.1.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna_1.1.5.bb
new file mode 100644
index 0000000..7c6db62
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna_1.1.5.bb
@@ -0,0 +1,4 @@
+require ${BPN}.inc
+
+SRCREV = "v1_1_5"
+LIC_FILES_CHKSUM = "file://LICENCE.miniupnpd;md5=b0dabf9d8e0f871554e309d62ead8d2b"