diff --git a/DEVELOPERS b/DEVELOPERS index 8e713f2d63..65b6a09121 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -741,6 +741,7 @@ F: package/cairo/ F: package/duktape/ F: package/expat/ F: package/flatbuffers/ +F: package/gerbera/ F: package/gtksourceview/ F: package/gssdp/ F: package/gupnp/ diff --git a/package/Config.in b/package/Config.in index 222857ad18..ebba7b4df2 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1861,6 +1861,7 @@ menu "Networking applications" source "package/fping/Config.in" source "package/freeswitch/Config.in" source "package/freeswitch-mod-bcg729/Config.in" + source "package/gerbera/Config.in" source "package/gesftpserver/Config.in" source "package/glorytun/Config.in" source "package/gupnp-tools/Config.in" diff --git a/package/gerbera/0001-Fix-atrailers-build.patch b/package/gerbera/0001-Fix-atrailers-build.patch new file mode 100644 index 0000000000..ba99ef4714 --- /dev/null +++ b/package/gerbera/0001-Fix-atrailers-build.patch @@ -0,0 +1,48 @@ +From 5d4c24bcca7f8d7f550720461373fb84eefef27e Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 12 May 2018 14:16:30 +0200 +Subject: [PATCH] Fix atrailers build + +i2i function is used in atrailers_service.cc but this function is +defined only if defined(HAVE_JS) || defined(HAVE_TAGLIB) || +defined(YOUTUBE) || defined(HAVE_LIBMP4V2) as a result compilation +fails if HAVE_CURL is set but HAVE_JS and HAVE_TAGLIG are not. +As youtube and libmp4v2 support have been dropped, replace those by +ATRAILERS in this list. + +[Upstream Status: merged (https://github.com/gerbera/gerbera/pull/300)] +Signed-off-by: Fabrice Fontaine +--- + src/string_converter.cc | 2 +- + src/string_converter.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/string_converter.cc b/src/string_converter.cc +index b0b1f20f..79f46008 100644 +--- a/src/string_converter.cc ++++ b/src/string_converter.cc +@@ -226,7 +226,7 @@ Ref StringConverter::p2i() + } + #endif + +-#if defined (HAVE_JS) || defined(HAVE_TAGLIB) || defined(YOUTUBE) || defined(HAVE_LIBMP4V2) ++#if defined (HAVE_JS) || defined(HAVE_TAGLIB) || defined(ATRAILERS) + + Ref StringConverter::i2i() + { +diff --git a/src/string_converter.h b/src/string_converter.h +index c0b64f29..ca8ae16f 100644 +--- a/src/string_converter.h ++++ b/src/string_converter.h +@@ -66,7 +66,7 @@ public: + static zmm::Ref p2i(); + + #endif +-#if defined(HAVE_JS) || defined(HAVE_TAGLIB) || defined(YOUTUBE) || defined(HAVE_LIBMP4V2) ++#if defined(HAVE_JS) || defined(HAVE_TAGLIB) || defined(ATRAILERS) + /// \brief safeguard - internal to internal - needed to catch some + /// scenarious where the user may have forgotten to add proper conversion + /// in the script. +-- +2.14.1 + diff --git a/package/gerbera/Config.in b/package/gerbera/Config.in new file mode 100644 index 0000000000..b0155d1b37 --- /dev/null +++ b/package/gerbera/Config.in @@ -0,0 +1,27 @@ +config BR2_PACKAGE_GERBERA + bool "gerbera" + depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_HAS_ATOMIC + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14 + depends on BR2_INSTALL_LIBSTDCPP + depends on !BR2_PACKAGE_LIBUPNP # libupnp18 + select BR2_PACKAGE_EXPAT + select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE + select BR2_PACKAGE_LIBUPNP18 + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_UTIL_LINUX + select BR2_PACKAGE_UTIL_LINUX_LIBUUID + select BR2_PACKAGE_ZLIB + help + A free media server. + Stream your media to devices on your home network. + + https://gerbera.io + +comment "gerbera needs a toolchain w/ C++, threads, gcc >= 4.9" + depends on BR2_USE_MMU + depends on BR2_TOOLCHAIN_HAS_ATOMIC + depends on !BR2_PACKAGE_LIBUPNP + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 diff --git a/package/gerbera/S99gerbera b/package/gerbera/S99gerbera new file mode 100644 index 0000000000..8bbd221ce2 --- /dev/null +++ b/package/gerbera/S99gerbera @@ -0,0 +1,52 @@ +#!/bin/sh + +DAEMON="gerbera" +PIDFILE="/var/run/$NAME.pid" + +GERBERA_ARGS="-c /etc/gerbera/config.xml -l /var/log/gerbera.log" + +# shellcheck source=/dev/null +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +start() { + printf 'Starting %s: ' "$DAEMON" + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -S -q -m -b -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ + -- $GERBERA_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + rm -f "$PIDFILE" + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + start +} + +case "$1" in + start|stop|restart) + "$1";; + reload) + # Restart, since there is no true "reload" feature. + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac diff --git a/package/gerbera/config.xml b/package/gerbera/config.xml new file mode 100644 index 0000000000..fa990d1502 --- /dev/null +++ b/package/gerbera/config.xml @@ -0,0 +1,139 @@ + + + + + + + + + Gerbera + uuid:ac20d9b6-5c82-48e6-80de-436965fbe1d7 + /var/lib/gerbera + /usr/share/gerbera/web + + 1800 + + + gerbera.db + + + + + + + + + + * + + video + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + audio/L16 + no + yes + no + + + + + video/mpeg + yes + yes + yes + + + + + + diff --git a/package/gerbera/gerbera.hash b/package/gerbera/gerbera.hash new file mode 100644 index 0000000000..a9281cc253 --- /dev/null +++ b/package/gerbera/gerbera.hash @@ -0,0 +1,3 @@ +# Locally computed: +sha256 a64fe5820aced590bcdc22600596dc8a41c0baf68d7c0ec5baf7a561ade820df gerbera-v1.2.0.tar.gz +sha256 cae4138373be41fd2be75faf41ce7efbcf49fb17d0e05ad1c51cc01ac335b9b6 LICENSE.md diff --git a/package/gerbera/gerbera.mk b/package/gerbera/gerbera.mk new file mode 100644 index 0000000000..b900a83c8c --- /dev/null +++ b/package/gerbera/gerbera.mk @@ -0,0 +1,114 @@ +################################################################################ +# +# gerbera +# +################################################################################ + +GERBERA_VERSION = v1.2.0 +GERBERA_SITE = $(call github,gerbera,gerbera,$(GERBERA_VERSION)) +GERBERA_LICENSE = GPL-2.0 +GERBERA_LICENSE_FILES = LICENSE.md +GERBERA_DEPENDENCIES = \ + expat \ + host-pkgconf \ + libupnp18 \ + sqlite \ + util-linux \ + zlib +GERBERA_CONF_OPTS = \ + -DWITH_DEBUG=OFF \ + -DWITH_JS=OFF + +# Uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +GERBERA_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic" +endif + +ifeq ($(BR2_PACKAGE_EXIV2),y) +GERBERA_DEPENDENCIES += exiv2 +GERBERA_CONF_OPTS += -DWITH_EXIV2=ON +else +GERBERA_CONF_OPTS += -DWITH_EXIV2=OFF +endif + +ifeq ($(BR2_PACKAGE_FFMPEG),y) +GERBERA_DEPENDENCIES += ffmpeg +GERBERA_CONF_OPTS += -DWITH_AVCODEC=ON +else +GERBERA_CONF_OPTS += -DWITH_AVCODEC=OFF +endif + +ifeq ($(BR2_PACKAGE_FILE),y) +GERBERA_DEPENDENCIES += file +GERBERA_CONF_OPTS += -DWITH_MAGIC=ON +else +GERBERA_CONF_OPTS += -DWITH_MAGIC=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBCURL),y) +GERBERA_DEPENDENCIES += libcurl +GERBERA_CONF_OPTS += -DWITH_CURL=ON +else +GERBERA_CONF_OPTS += -DWITH_CURL=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBEXIF),y) +GERBERA_DEPENDENCIES += libexif +GERBERA_CONF_OPTS += -DWITH_EXIF=ON +else +GERBERA_CONF_OPTS += -DWITH_EXIF=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBICONV),y) +GERBERA_DEPENDENCIES += libiconv +endif + +ifeq ($(BR2_PACKAGE_MYSQL),y) +GERBERA_DEPENDENCIES += mysql +GERBERA_CONF_OPTS += -DWITH_MYSQL=ON +else +GERBERA_CONF_OPTS += -DWITH_MYSQL=OFF +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +GERBERA_DEPENDENCIES += systemd +GERBERA_CONF_OPTS += -DWITH_SYSTEMD=ON +else +GERBERA_CONF_OPTS += -DWITH_SYSTEMD=OFF +endif + +ifeq ($(BR2_PACKAGE_TAGLIB),y) +GERBERA_DEPENDENCIES += taglib +GERBERA_CONF_OPTS += -DWITH_TAGLIB=ON +else +GERBERA_CONF_OPTS += -DWITH_TAGLIB=OFF +endif + +# gerbera does not provide a default configuration file, it can be +# created during run time through --create-config: +# http://docs.gerbera.io/en/latest/config-overview.html#generating-configuration +# However, to have a correct home directory and UDN, install it ourself +define GERBERA_INSTALL_CONFIGURATION + $(INSTALL) -D -m 0644 package/gerbera/config.xml \ + $(TARGET_DIR)/etc/gerbera/config.xml +endef + +GERBERA_POST_INSTALL_TARGET_HOOKS += GERBERA_INSTALL_CONFIGURATION + +define GERBERA_USERS + gerbera -1 gerbera -1 * /var/lib/gerbera - - Gerbera user +endef + +define GERBERA_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/gerbera/S99gerbera \ + $(TARGET_DIR)/etc/init.d/S99gerbera +endef + +# gerbera.service is installed by cmake in $(TARGET_DIR)/usr/lib/systemd/system +define GERBERA_INSTALL_INIT_SYSTEMD + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -sf ../../../../usr/lib/systemd/system/gerbera.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/gerbera.service +endef + +$(eval $(cmake-package))