mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 15:37:49 +00:00
minidlna: initial addon
This commit is contained in:
parent
cccd2bbd43
commit
539f908adb
2
packages/addons/service/minidlna/changelog.txt
Normal file
2
packages/addons/service/minidlna/changelog.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
100
|
||||||
|
- initial LibreELEC version
|
BIN
packages/addons/service/minidlna/icon/icon.png
Executable file
BIN
packages/addons/service/minidlna/icon/icon.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
56
packages/addons/service/minidlna/package.mk
Normal file
56
packages/addons/service/minidlna/package.mk
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
################################################################################
|
||||||
|
# This file is part of LibreELEC - https://libreelec.tv
|
||||||
|
# Copyright (C) 2018-present Team LibreELEC
|
||||||
|
#
|
||||||
|
# LibreELEC is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# LibreELEC is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
PKG_NAME="minidlna"
|
||||||
|
PKG_VERSION="138d03d"
|
||||||
|
PKG_SHA256="efd780aa7c7e076dee273694b73d2f03598b0201ca79335b2975779c24469f97"
|
||||||
|
PKG_REV="100"
|
||||||
|
PKG_ARCH="any"
|
||||||
|
PKG_LICENSE="BSD-3c/GPLv2"
|
||||||
|
PKG_SITE="https://sourceforge.net/projects/minidlna/"
|
||||||
|
PKG_URL="http://repo.or.cz/minidlna.git/snapshot/$PKG_VERSION.tar.gz"
|
||||||
|
PKG_DEPENDS_TARGET="toolchain libiconv libid3tag libexif libjpeg-turbo libogg libvorbis ffmpeg flac sqlite"
|
||||||
|
PKG_SECTION="service"
|
||||||
|
PKG_SHORTDESC="MiniDLNA (ReadyMedia): a fully compliant DLNA/UPnP-AV server"
|
||||||
|
PKG_LONGDESC="MiniDLNA ($PKG_VERSION) (ReadyMedia) is a media server, with the aim of being fully compliant with DLNA/UPnP-AV clients."
|
||||||
|
PKG_TOOLCHAIN="autotools"
|
||||||
|
|
||||||
|
PKG_IS_ADDON="yes"
|
||||||
|
PKG_ADDON_NAME="MiniDLNA (ReadyMedia)"
|
||||||
|
PKG_ADDON_TYPE="xbmc.service"
|
||||||
|
|
||||||
|
PKG_CONFIGURE_OPTS_TARGET="--disable-static \
|
||||||
|
--disable-nls \
|
||||||
|
--without-libiconv-prefix \
|
||||||
|
--without-libintl-prefix \
|
||||||
|
--with-os-name="$DISTRONAME" \
|
||||||
|
--with-db-path="/storage/.kodi/userdata/addon_data/service.minidlna/db" \
|
||||||
|
--with-os-url="https://libreelec.tv""
|
||||||
|
|
||||||
|
pre_configure_target() {
|
||||||
|
export LDFLAGS="$LDFLAGS -L$(get_build_dir ffmpeg)/.install_pkg/usr/lib"
|
||||||
|
export LIBS="$LIBS -lid3tag -lFLAC -logg -lz -lpthread -ldl -lm"
|
||||||
|
}
|
||||||
|
|
||||||
|
addon() {
|
||||||
|
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
|
||||||
|
cp -P $PKG_BUILD/.install_pkg/usr/sbin/minidlnad $ADDON_BUILD/$PKG_ADDON_ID/bin
|
||||||
|
|
||||||
|
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib
|
||||||
|
cp -p $(get_build_dir libexif)/.install_pkg/usr/lib/libexif.so.12 $ADDON_BUILD/$PKG_ADDON_ID/lib
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
disabling editing of the configfiles at buildtime
|
||||||
|
--- a/Makefile.am
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -73,19 +73,6 @@ testupnpdescgen_LDADD = \
|
||||||
|
@LIBEXIF_LIBS@ \
|
||||||
|
-lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs)
|
||||||
|
|
||||||
|
-SUFFIXES = .tmpl .
|
||||||
|
-
|
||||||
|
-.tmpl:
|
||||||
|
- sed -e s@:SBINDIR:@${sbindir}@ <$< >$@
|
||||||
|
-
|
||||||
|
-GENERATED_FILES = \
|
||||||
|
- linux/minidlna.init.d.script
|
||||||
|
-
|
||||||
|
-TEMPLATES = \
|
||||||
|
- linux/minidlna.init.d.script.tmpl
|
||||||
|
-
|
||||||
|
-CLEANFILES = $(GENERATED_FILES)
|
||||||
|
-
|
||||||
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
|
EXTRA_DIST = m4/ChangeLog $(TEMPLATES)
|
36
packages/addons/service/minidlna/source/bin/minidlna.start
Executable file
36
packages/addons/service/minidlna/source/bin/minidlna.start
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# This file is part of LibreELEC - https://libreelec.tv
|
||||||
|
# Copyright (C) 2018-present Team LibreELEC
|
||||||
|
#
|
||||||
|
# LibreELEC is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# LibreELEC is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
. /etc/profile
|
||||||
|
|
||||||
|
oe_setup_addon service.minidlna
|
||||||
|
|
||||||
|
if [ ! -f "$ADDON_HOME/config/minidlna.conf" ]; then
|
||||||
|
mkdir -p $ADDON_HOME/config
|
||||||
|
cp $ADDON_DIR/config/minidlna.conf $ADDON_HOME/config
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$ADDON_HOME/db" ]; then
|
||||||
|
mkdir -p $ADDON_HOME/db
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod a+x $ADDON_DIR/bin/*
|
||||||
|
|
||||||
|
exec $ADDON_DIR/bin/minidlnad -S -f $ADDON_HOME/config/minidlna.conf -p $minidlna_port &>$ADDON_HOME/service.log
|
79
packages/addons/service/minidlna/source/config/minidlna.conf
Normal file
79
packages/addons/service/minidlna/source/config/minidlna.conf
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# set this to the directory you want scanned
|
||||||
|
# + "A" for audio (eg. media_dir=A,/storage/music)
|
||||||
|
# + "V" for video (eg. media_dir=V,/storage/videos)
|
||||||
|
# + "P" for images (eg. media_dir=P,/storage/pictures)
|
||||||
|
# + "PV" for pictures and video (eg. media_dir=PV,/storage/digital_camera)
|
||||||
|
media_dir=V,/storage/videos
|
||||||
|
media_dir=V,/storage/tvshows
|
||||||
|
media_dir=P,/storage/pictures
|
||||||
|
media_dir=A,/storage/music
|
||||||
|
|
||||||
|
# set this if you want to customize the name that shows up on your clients
|
||||||
|
friendly_name=DLNA Server
|
||||||
|
|
||||||
|
# network interfaces to serve, comma delimited (8 interfaces max)
|
||||||
|
#network_interface=eth0
|
||||||
|
|
||||||
|
# set this to merge all media_dir base contents into the root container
|
||||||
|
# note: the default is no
|
||||||
|
#merge_media_dirs=no
|
||||||
|
|
||||||
|
# set this to change the verbosity of the information that is logged
|
||||||
|
# each section can use a different level: off, fatal, error, warn, info, or debug
|
||||||
|
#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn
|
||||||
|
|
||||||
|
# this should be a list of file names to check for when searching for album art
|
||||||
|
# note: names should be delimited with a forward slash ("/")
|
||||||
|
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
|
||||||
|
|
||||||
|
# set this to no to disable inotify monitoring to automatically discover new files
|
||||||
|
# note: the default is yes
|
||||||
|
inotify=yes
|
||||||
|
|
||||||
|
# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
|
||||||
|
enable_tivo=no
|
||||||
|
|
||||||
|
# set this to beacon to use legacy broadcast discovery method
|
||||||
|
# defauts to bonjour if avahi is available
|
||||||
|
tivo_discovery=bonjour
|
||||||
|
|
||||||
|
# set this to strictly adhere to DLNA standards.
|
||||||
|
# * This will allow server-side downscaling of very large JPEG images,
|
||||||
|
# which may hurt JPEG serving performance on (at least) Sony DLNA products.
|
||||||
|
strict_dlna=no
|
||||||
|
|
||||||
|
# default presentation url is http address on port 80
|
||||||
|
#presentation_url=http://www.mylan/index.php
|
||||||
|
|
||||||
|
# notify interval in seconds. default is 895 seconds.
|
||||||
|
notify_interval=1800
|
||||||
|
|
||||||
|
# serial and model number the daemon will report to clients
|
||||||
|
# in its XML description
|
||||||
|
serial=12345678
|
||||||
|
model_number=1
|
||||||
|
|
||||||
|
# use different container as root of the tree
|
||||||
|
# possible values:
|
||||||
|
# + "." - use standard container (this is the default)
|
||||||
|
# + "B" - "Browse Directory"
|
||||||
|
# + "M" - "Music"
|
||||||
|
# + "V" - "Video"
|
||||||
|
# + "P" - "Pictures"
|
||||||
|
# + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
|
||||||
|
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
|
||||||
|
#root_container=.
|
||||||
|
|
||||||
|
# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
|
||||||
|
# note: you can prepend the sort criteria with "!" to alter the titles of the objects so that they
|
||||||
|
# will be alphanumerically sorted in the order you specify here, to work around clients that do their
|
||||||
|
# own alphanumeric sorting.
|
||||||
|
#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
|
||||||
|
|
||||||
|
# maximum number of simultaneous connections
|
||||||
|
# note: many clients open several simultaneous connections while streaming
|
||||||
|
#max_connections=50
|
||||||
|
|
||||||
|
# enable subtitle support by default on unknown clients.
|
||||||
|
# note: the default is yes
|
||||||
|
#enable_subtitles=yes
|
35
packages/addons/service/minidlna/source/default.py
Normal file
35
packages/addons/service/minidlna/source/default.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
################################################################################
|
||||||
|
# This file is part of LibreELEC - https://libreelec.tv
|
||||||
|
# Copyright (C) 2018-present Team LibreELEC
|
||||||
|
#
|
||||||
|
# LibreELEC is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# LibreELEC is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
import xbmc
|
||||||
|
import xbmcaddon
|
||||||
|
|
||||||
|
|
||||||
|
class Monitor(xbmc.Monitor):
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
xbmc.Monitor.__init__(self)
|
||||||
|
self.id = xbmcaddon.Addon().getAddonInfo('id')
|
||||||
|
|
||||||
|
def onSettingsChanged(self):
|
||||||
|
subprocess.call(['systemctl', 'restart', self.id])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
Monitor().waitForAbort()
|
@ -0,0 +1,14 @@
|
|||||||
|
# Kodi Media Center language file
|
||||||
|
# Addon Name: minidlna
|
||||||
|
# Addon id: service.minidlna
|
||||||
|
# Addon Provider: Team LibreELEC
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30000"
|
||||||
|
msgid "Configuration"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30001"
|
||||||
|
msgid "Port"
|
||||||
|
msgstr ""
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||||
|
<settings>
|
||||||
|
<category label="30000">
|
||||||
|
<setting label="30001" id="minidlna_port" type="number" default="8200" />
|
||||||
|
</category>
|
||||||
|
</settings>
|
@ -0,0 +1,3 @@
|
|||||||
|
<settings>
|
||||||
|
<setting id="minidlna_port" value="8200" />
|
||||||
|
</settings>
|
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# This file is part of LibreELEC - https://libreelec.tv
|
||||||
|
# Copyright (C) 2018-present Team LibreELEC
|
||||||
|
#
|
||||||
|
# LibreELEC is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# LibreELEC is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
. /etc/profile
|
||||||
|
|
||||||
|
oe_setup_addon service.minidlna
|
||||||
|
|
||||||
|
SERVICE="service.minidlna"
|
||||||
|
|
||||||
|
if [ "$RESTART_ON_RESUME" == "true" ] ; then
|
||||||
|
case "$1" in
|
||||||
|
pre)
|
||||||
|
if systemctl is-active "$SERVICE" &>/dev/null ; then
|
||||||
|
systemctl stop "$SERVICE"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
post)
|
||||||
|
if systemctl is-enabled "$SERVICE" &>/dev/null ; then
|
||||||
|
systemctl start "$SERVICE"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=minidlna
|
||||||
|
After=graphical.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/bin/sh -c "exec sh /storage/.kodi/addons/service.minidlna/bin/minidlna.start"
|
||||||
|
TimeoutStopSec=1
|
||||||
|
Restart=always
|
||||||
|
RestartSec=2
|
||||||
|
StartLimitInterval=0
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=kodi.target
|
Loading…
x
Reference in New Issue
Block a user