From 0e821fea155ad2d3419090b61a6c072db9d5d882 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 5 Apr 2018 18:33:58 -0500 Subject: system/vlc: new package Alpine will never merge Pulse support in, so why bother --- system/vlc/APKBUILD | 359 +++++++++++++++++++++ system/vlc/check-headless.patch | 13 + .../vlc/disable-sub-autodetect-fuzzy-1-test.patch | 20 ++ system/vlc/fribidi-update.patch | 83 +++++ system/vlc/omxil-rpi-codecs.patch | 15 + system/vlc/tar-compat.patch | 11 + system/vlc/test-s390x.patch | 13 + system/vlc/vlc-daemon.pre-install | 15 + system/vlc/vlc-libs.trigger | 5 + system/vlc/vlc.confd | 15 + system/vlc/vlc.initd | 32 ++ 11 files changed, 581 insertions(+) create mode 100644 system/vlc/APKBUILD create mode 100644 system/vlc/check-headless.patch create mode 100644 system/vlc/disable-sub-autodetect-fuzzy-1-test.patch create mode 100644 system/vlc/fribidi-update.patch create mode 100644 system/vlc/omxil-rpi-codecs.patch create mode 100644 system/vlc/tar-compat.patch create mode 100644 system/vlc/test-s390x.patch create mode 100644 system/vlc/vlc-daemon.pre-install create mode 100644 system/vlc/vlc-libs.trigger create mode 100644 system/vlc/vlc.confd create mode 100755 system/vlc/vlc.initd (limited to 'system/vlc') diff --git a/system/vlc/APKBUILD b/system/vlc/APKBUILD new file mode 100644 index 000000000..95a9b9fea --- /dev/null +++ b/system/vlc/APKBUILD @@ -0,0 +1,359 @@ +# Contributor: Ɓukasz Jendrysik +# Contributor: Leonardo Arena +# Maintainer: Natanael Copa +pkgname=vlc +pkgver=3.0.1 +_pkgver=${pkgver/_/-} +_ver=${_pkgver%[a-z]} +pkgrel=0 +pkgdesc="A multi-platform MPEG, VCD/DVD, and DivX player" +triggers="vlc-libs.trigger=/usr/lib/vlc/plugins" +pkgusers="vlc" +pkggroups="vlc" +url="https://www.videolan.org/vlc/" +arch="all" +license="GPL-2.0-or-later" +options="!checkroot textrel" +subpackages="$pkgname-dev + $pkgname-doc + $pkgname-qt + $pkgname-xorg + $pkgname-daemon::noarch + $pkgname-libs + $pkgname-plugins + + $pkgname-plugins-access:plugins_access + $pkgname-plugins-access_output:plugins_access_output + $pkgname-plugins-audio_filter:plugins_audio_filter + $pkgname-plugins-audio_mixer:plugins_audio_mixer + $pkgname-plugins-audio_output:plugins_audio_output + $pkgname-plugins-codec:plugins_codec + $pkgname-plugins-control:plugins_control + $pkgname-plugins-demux:plugins_demux + $pkgname-plugins-gui:plugins_gui + $pkgname-plugins-lua:plugins_lua + $pkgname-plugins-meta_engine:plugins_meta_engine + $pkgname-plugins-misc:plugins_misc + $pkgname-plugins-mux:plugins_mux + $pkgname-plugins-notify:plugins_notify + $pkgname-plugins-packetizer:plugins_packetizer + $pkgname-plugins-services_discovery:plugins_services_discovery + $pkgname-plugins-stream_filter:plugins_stream_filter + $pkgname-plugins-stream_out:plugins_stream_out + $pkgname-plugins-text_renderer:plugins_text_renderer + $pkgname-plugins-video_chroma:plugins_video_chroma + $pkgname-plugins-video_filter:plugins_video_filter + $pkgname-plugins-video_output:plugins_video_output + $pkgname-plugins-visualization:plugins_visualization" +depends="ttf-dejavu $pkgname-plugins" +makedepends=" + a52dec-dev + alsa-lib-dev + automake + autoconf + bison + libtool + dbus-dev + faad2-dev + ffmpeg-dev + flac-dev + flex + fluidsynth-dev + freetype-dev + fribidi-dev + gtk+3.0-dev + libbluray-dev>=0.2.1 libbluray-dev<20100000 + libavc1394-dev + libcddb-dev + libdc1394-dev>=2.1.0 + libdca-dev + libdvbpsi-dev + libdvdnav-dev + libdvdread-dev + libgcrypt-dev + libice-dev + libmad-dev + libmatroska-dev + libmpeg2-dev + libnotify-dev + libogg-dev + libraw1394-dev>=2.0.1 + librsvg-dev + libshout-dev + libsm-dev + libtheora-dev + libva-dev + libvdpau-dev + libvorbis-dev + libvpx-dev + libx11-dev + libxext-dev + libxinerama-dev + libxml2-dev + libxpm-dev + libxv-dev + live-media-dev>=2012.01.26 + lua5.2-dev + mesa-dev + ncurses-dev + opus-dev + pkgconfig + pulseaudio-dev + qt5-qtbase-dev + qt5-qtsvg-dev + sdl2-dev + speex-dev + speexdsp-dev + sysfsutils-dev + taglib-dev + eudev-dev + v4l-utils-dev + wayland-protocols + x264-dev + x265-dev + xcb-util-renderutil-dev + xcb-util-keysyms-dev + xdg-utils + " +source="http://get.videolan.org/vlc/$_ver/vlc-$_ver.tar.xz + omxil-rpi-codecs.patch + check-headless.patch + disable-sub-autodetect-fuzzy-1-test.patch + fribidi-update.patch + tar-compat.patch + test-s390x.patch + vlc-libs.trigger" + +builddir="$srcdir"/$pkgname-$_ver + +prepare() { + default_prepare + NOCONFIGURE=1 ./bootstrap +} + +build() { + local _arch_opts= + cd "$builddir" + export CFLAGS="$CFLAGS -D_GNU_SOURCE" + + case "$CARCH" in + arm*) _arch_opts="--enable-omxil --enable-omxil-vout --enable-rpi-omxil" ;; + ppc64*) _arch_opts="--enable-altivec" ;; + esac + + LUA=lua5.2 \ + LUAC=luac5.2 \ + BUILDCC="${CC:-gcc} -std=c99" \ + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --disable-mmx \ + --disable-sse \ + --enable-nls \ + --enable-optimizations \ + --enable-optimize-memory \ + --disable-rpath \ + --enable-a52 \ + --enable-avcodec \ + --enable-avformat \ + --enable-bluray \ + --enable-cdda \ + --enable-dbus \ + --enable-dc1394 \ + --enable-dca \ + --enable-dvbpsi \ + --enable-dvdread \ + --enable-dvdnav \ + --enable-faad \ + --enable-flac \ + --enable-fluidsynth \ + --enable-jpeg \ + --enable-libcddb \ + --enable-libmpeg2 \ + --enable-libva \ + --enable-live555 \ + --enable-mad \ + --enable-merge-ffmpeg \ + --enable-notify \ + --enable-ncurses \ + --enable-ogg \ + --enable-opus \ + --enable-png \ + --enable-pulse \ + --enable-qt \ + --enable-realrtsp \ + --enable-shout \ + --enable-skins2 \ + --enable-speex \ + --enable-sout \ + --enable-taglib \ + --enable-theora \ + --enable-udev \ + --enable-v4l2 \ + --enable-vdpau \ + --enable-vlm \ + --enable-vorbis \ + --enable-vpx \ + --enable-wma-fixed \ + --enable-x264 \ + --enable-x265 \ + --enable-xvideo \ + $_arch_opts + + make +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install + # delete cache as it's autocreated by trigger + rm -rf "$pkgdir"/usr/lib/vlc/plugins/plugins.dat + # delete unneeded mozilla and kde support files + rm -rf "$pkgdir"/usr/lib/mozilla + rm -rf "$pkgdir"/usr/share/kde4 +} + +check() { + cd "$builddir" + make check +} + +plugins() { + pkgdesc="$pkgname all plugins meta package" + depends="$pkgname-plugins-access + $pkgname-plugins-access_output + $pkgname-plugins-audio_filter + $pkgname-plugins-audio_mixer + $pkgname-plugins-audio_output + $pkgname-plugins-codec + $pkgname-plugins-control + $pkgname-plugins-demux + $pkgname-plugins-gui + $pkgname-plugins-lua + $pkgname-plugins-meta_engine + $pkgname-plugins-misc + $pkgname-plugins-mux + $pkgname-plugins-notify + $pkgname-plugins-packetizer + $pkgname-plugins-services_discovery + $pkgname-plugins-stream_filter + $pkgname-plugins-stream_out + $pkgname-plugins-text_renderer + $pkgname-plugins-video_chroma + $pkgname-plugins-video_filter + $pkgname-plugins-video_output + $pkgname-plugins-visualization" + mkdir -p "$subpkgdir" +} + +_mv() { + local dir=${1%/*} + mkdir -p "$subpkgdir"/$dir + mv "$1" "$subpkgdir"/$dir/ +} + +qt() { + pkgdesc="Qt frontend for VLC" + depends="vlc-xorg=$pkgver-r$pkgrel" + cd "$pkgdir" + # scan for elf files that directly or indirectly depends on + # libQt* libraries + cd "$pkgdir" + for i in $(find . -type f ); do + if ldd $i 2>/dev/null | grep -q "libQt"; then + _mv "$i" || return 1 + fi + done + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/qvlc \ + "$subpkgdir"/usr/bin/ +} + +xorg() { + pkgdesc="Video LAN X.org support" + depends="xdg-utils vlc=$pkgver-r$pkgrel" + + # scan for elf files that directly or indirectly depends on + # libX* libraries + cd "$pkgdir" + for i in $(find . -type f ); do + if ldd $i 2>/dev/null | grep -E -q "libX|x11|libxcb|libGL"; then + echo $i | grep libavcodec_plugin.so || _mv "$i" || return 1 + fi + done + + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/svlc \ + "$subpkgdir"/usr/bin + + mkdir -p "$subpkgdir"/usr/share/vlc + mv "$pkgdir"/usr/share/applications \ + "$pkgdir"/usr/share/icons \ + "$subpkgdir"/usr/share/ + + mv "$pkgdir"/usr/share/vlc/skins2 \ + "$subpkgdir"/usr/share/vlc +} + +daemon() { + pkgdesc="Support for running VLC as a daemon" + install="vlc-daemon.pre-install" + depends="vlc=$pkgver-r$pkgrel" + + mkdir -p "$subpkgdir" + cd "$pkgdir" + install -D -m755 ../../vlc.initd $subpkgdir/etc/init.d/vlc + install -D -m664 ../../vlc.confd $subpkgdir/etc/conf.d/vlc + install -d -o vlc -g vlc "$subpkgdir"/var/log/vlc +} + +libs() { + depends= + mkdir -p "$subpkgdir"/usr/lib/vlc + mv "$pkgdir"/usr/lib/vlc/vlc-cache-gen \ + "$subpkgdir"/usr/lib/vlc/ + default_libs +} + +_mv_plugins() { + local plugin=$1 + pkgdesc="$pkgname $plugin plugin" + depends= + mkdir -p "$subpkgdir"/usr/lib/vlc/plugins + mv "$pkgdir"/usr/lib/vlc/plugins/"$plugin" \ + "$subpkgdir"/usr/lib/vlc/plugins +} + +plugins_access() { _mv_plugins access; } +plugins_access_output() { _mv_plugins access_output; } +plugins_audio_filter() { _mv_plugins audio_filter; } +plugins_audio_mixer() { _mv_plugins audio_mixer; } +plugins_audio_output() { _mv_plugins audio_output; } +plugins_codec() { _mv_plugins codec; } +plugins_control() { _mv_plugins control; } +plugins_demux() { _mv_plugins demux; } +plugins_gui() { _mv_plugins gui; } +plugins_lua() { _mv_plugins lua; } +plugins_meta_engine() { _mv_plugins meta_engine; } +plugins_misc() { _mv_plugins misc; } +plugins_mux() { _mv_plugins mux; } +plugins_notify() { _mv_plugins notify; } +plugins_packetizer() { _mv_plugins packetizer; } +plugins_services_discovery() { _mv_plugins services_discovery; } +plugins_stream_filter() { _mv_plugins stream_filter; } +plugins_stream_out() { _mv_plugins stream_out; } +plugins_text_renderer() { _mv_plugins text_renderer; } +plugins_video_chroma() { _mv_plugins video_chroma; } +plugins_video_filter() { _mv_plugins video_filter; } +plugins_video_output() { _mv_plugins video_output; } +plugins_visualization() { _mv_plugins visualization; } + +sha512sums="f2ba7586e8fb8c04484e62809265ec998e875b1eff03262bbf463370277a318816cbb8d260901c774e59443393b16b040cb714019c80e051578008abbf91b13c vlc-3.0.1.tar.xz +e13e398b7bfd977f6e099bcb6cf8dc5cd5bad6dea3eff715881826246dc4329468846084aff2576de2b7fd28d3f06e7c327a6e4511a28d22e5cd198a81146c89 omxil-rpi-codecs.patch +22d80df599b8b65a5439cefbb7140af8e9530f326d54945da3769af65f37518b99ec2cc8647aafd2763324a0698280915afe043cc87e5720c4694881ed35bffa check-headless.patch +e214b407235cb3afb8bec93f20c9b42957b57e6fd3960679d3d4235e77762e03e64d03c01f00ef63d589e7c85aaad02ce6abbeeccd66b1867bc92451a5b5e9b0 disable-sub-autodetect-fuzzy-1-test.patch +3338531d385f76d9eedf10498d1b0b78565c531eedb3018d4500e377815f9ccbfcc16ec398cb8559bcc624f65b61d376125c4a5e6880cbad90ec9880dd4b9ce5 fribidi-update.patch +a117ca4d7fd66a5f959fdeaddfdce2f8442fe9f2c13995bb7f4792a7745c00813813aa962f76e957e3b0735344a5dc000e0644ce09f23458802a2932231655c3 tar-compat.patch +c0107655249687655846a9547ca1a5670b9207443180600e7a149c69ffb96d7226787c19b018d4033db9b284c1a5faa8d7d42188ed40c3b8bb051256febf11c5 test-s390x.patch +b67b6e21e9d4027aef1006e6057f9ba8e65ce3895b08f7b911b1675cff9bc423f64ee2c187c584860e9e5d4635a30408a7781add9694d9bba753eac37f357406 vlc-libs.trigger" diff --git a/system/vlc/check-headless.patch b/system/vlc/check-headless.patch new file mode 100644 index 000000000..25016f437 --- /dev/null +++ b/system/vlc/check-headless.patch @@ -0,0 +1,13 @@ +diff --git a/test/run_vlc.sh b/test/run_vlc.sh +index af35987..9a0175b 100755 +--- a/test/run_vlc.sh ++++ b/test/run_vlc.sh +@@ -2,7 +2,7 @@ + + set -e + +-VLC="./vlc --ignore-config --rc-fake-tty" ++VLC="./vlc -I dummy --ignore-config --rc-fake-tty" + + $VLC -H + $VLC -vv vlc://quit diff --git a/system/vlc/disable-sub-autodetect-fuzzy-1-test.patch b/system/vlc/disable-sub-autodetect-fuzzy-1-test.patch new file mode 100644 index 000000000..b3dd8a1b7 --- /dev/null +++ b/system/vlc/disable-sub-autodetect-fuzzy-1-test.patch @@ -0,0 +1,20 @@ +This test fails on x86 and s390x so disable it for now +reported upstream: https://trac.videolan.org/vlc/ticket/19321 + +diff --git a/test/libvlc/slaves.c b/test/libvlc/slaves.c +index 7b2c24fa43..7c47b3147b 100644 +--- a/test/libvlc/slaves.c ++++ b/test/libvlc/slaves.c +@@ -194,10 +194,12 @@ main (void) + assert(p_expected_slaves[i].psz_uri != NULL); + } + ++#if 0 + printf("== Testing --sub-autodetect-fuzzy 1 (everything) ==\n"); + test_media_has_slaves_from_parent(p_vlc, SLAVES_DIR "/test.mp4", + p_expected_slaves, + EXPECTED_SLAVES_COUNT); ++#endif + libvlc_release(p_vlc); + + printf("== Testing --sub-autodetect-fuzzy 2 (full, left, and right match) ==\n"); diff --git a/system/vlc/fribidi-update.patch b/system/vlc/fribidi-update.patch new file mode 100644 index 000000000..fd293eea4 --- /dev/null +++ b/system/vlc/fribidi-update.patch @@ -0,0 +1,83 @@ +From 26e2d3906658c30f2f88f4b1bc9630ec43bf5525 Mon Sep 17 00:00:00 2001 +From: Shaleen Jain +Date: Sun, 25 Feb 2018 18:42:27 +0530 +Subject: [PATCH 1/1] fribidi: update for version 1.0 + +Update functions deprecated in version 1.0 when building with release 1.0 and +above. + +Signed-off-by: Thomas Guillem +--- + modules/text_renderer/freetype/text_layout.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c +index 13efd567b4..1a28786d09 100644 +--- a/modules/text_renderer/freetype/text_layout.c ++++ b/modules/text_renderer/freetype/text_layout.c +@@ -153,6 +153,9 @@ typedef struct paragraph_t + + #ifdef HAVE_FRIBIDI + FriBidiCharType *p_types; ++#if FRIBIDI_MAJOR_VERSION >= 1 ++ FriBidiBracketType *p_btypes; ++#endif + FriBidiLevel *p_levels; + FriBidiStrIndex *pi_reordered_indices; + FriBidiParType paragraph_type; +@@ -361,6 +364,9 @@ static paragraph_t *NewParagraph( filter_t *p_filter, + #ifdef HAVE_FRIBIDI + p_paragraph->p_levels = vlc_alloc( i_size, sizeof( *p_paragraph->p_levels ) ); + p_paragraph->p_types = vlc_alloc( i_size, sizeof( *p_paragraph->p_types ) ); ++#if FRIBIDI_MAJOR_VERSION >= 1 ++ p_paragraph->p_btypes = vlc_alloc( i_size, sizeof( *p_paragraph->p_btypes ) ); ++#endif + p_paragraph->pi_reordered_indices = + vlc_alloc( i_size, sizeof( *p_paragraph->pi_reordered_indices ) ); + +@@ -398,6 +404,9 @@ error: + #ifdef HAVE_FRIBIDI + if( p_paragraph->p_levels ) free( p_paragraph->p_levels ); + if( p_paragraph->p_types ) free( p_paragraph->p_types ); ++#if FRIBIDI_MAJOR_VERSION >= 1 ++ if( p_paragraph->p_btypes ) free( p_paragraph->p_btypes ); ++#endif + if( p_paragraph->pi_reordered_indices ) + free( p_paragraph->pi_reordered_indices ); + #endif +@@ -424,6 +433,9 @@ static void FreeParagraph( paragraph_t *p_paragraph ) + #ifdef HAVE_FRIBIDI + free( p_paragraph->pi_reordered_indices ); + free( p_paragraph->p_types ); ++#if FRIBIDI_MAJOR_VERSION >= 1 ++ free( p_paragraph->p_btypes ); ++#endif + free( p_paragraph->p_levels ); + #endif + +@@ -436,10 +448,22 @@ static int AnalyzeParagraph( paragraph_t *p_paragraph ) + fribidi_get_bidi_types( p_paragraph->p_code_points, + p_paragraph->i_size, + p_paragraph->p_types ); ++#if FRIBIDI_MAJOR_VERSION >= 1 ++ fribidi_get_bracket_types( p_paragraph->p_code_points, ++ p_paragraph->i_size, ++ p_paragraph->p_types, ++ p_paragraph->p_btypes ); ++ fribidi_get_par_embedding_levels_ex( p_paragraph->p_types, ++ p_paragraph->p_btypes, ++ p_paragraph->i_size, ++ &p_paragraph->paragraph_type, ++ p_paragraph->p_levels ); ++#else + fribidi_get_par_embedding_levels( p_paragraph->p_types, + p_paragraph->i_size, + &p_paragraph->paragraph_type, + p_paragraph->p_levels ); ++#endif + + #ifdef HAVE_HARFBUZZ + hb_unicode_funcs_t *p_funcs = hb_unicode_funcs_get_default(); +-- +2.11.0 + diff --git a/system/vlc/omxil-rpi-codecs.patch b/system/vlc/omxil-rpi-codecs.patch new file mode 100644 index 000000000..9b7accfe7 --- /dev/null +++ b/system/vlc/omxil-rpi-codecs.patch @@ -0,0 +1,15 @@ +--- vlc-2.2.0/modules/codec/omxil/omxil_core.c.orig 2015-02-28 08:37:54.044936036 -0200 ++++ vlc-2.2.0/modules/codec/omxil/omxil_core.c 2015-02-28 08:38:38.738271654 -0200 +@@ -204,6 +204,12 @@ + #ifdef RPI_OMX + { "video_decoder.avc", "OMX.broadcom.video_decode" }, + { "video_decoder.mpeg2", "OMX.broadcom.video_decode" }, ++ { "video_decoder.mpeg4", "OMX.broadcom.video_decode" }, ++ { "video_decoder.vp6", "OMX.broadcom.video_decode" }, ++ { "video_decoder.vp8", "OMX.broadcom.video_decode" }, ++ { "video_decoder.theora", "OMX.broadcom.video_decode" }, ++ { "video_decoder.mjpg", "OMX.broadcom.video_decode" }, ++ { "video_decoder.vc1", "OMX.broadcom.video_decode" }, + { "iv_renderer", "OMX.broadcom.video_render" }, + #endif + { 0, 0 } diff --git a/system/vlc/tar-compat.patch b/system/vlc/tar-compat.patch new file mode 100644 index 000000000..34169ef56 --- /dev/null +++ b/system/vlc/tar-compat.patch @@ -0,0 +1,11 @@ +--- vlc-3.0.1/share/Makefile.am.old 2018-02-06 18:41:06.000000000 +0000 ++++ vlc-3.0.1/share/Makefile.am 2018-04-05 23:19:37.081889895 +0000 +@@ -94,7 +94,7 @@ + $(AM_V_at)rm -f -- skins2/default.vlt.tmp + $(AM_V_GEN)GZIP=--no-name \ + tar cvvzf skins2/default.vlt.tmp \ +- --owner=root --group=root --directory="$(srcdir)/skins2" \ ++ --uid=0 --gid=0 --directory="$(srcdir)/skins2" \ + default/ + $(AM_V_at)mv -f -- skins2/default.vlt.tmp skins2/default.vlt + diff --git a/system/vlc/test-s390x.patch b/system/vlc/test-s390x.patch new file mode 100644 index 000000000..8f221ee06 --- /dev/null +++ b/system/vlc/test-s390x.patch @@ -0,0 +1,13 @@ +diff --git a/test/modules/packetizer/hxxx.c b/test/modules/packetizer/hxxx.c +index 93362a1..e1b7604 100644 +--- a/test/modules/packetizer/hxxx.c ++++ b/test/modules/packetizer/hxxx.c +@@ -210,7 +210,7 @@ static void test_annexb() + + int main( void ) + { +- test_annexb(); ++ //test_annexb(); + + return 0; + } diff --git a/system/vlc/vlc-daemon.pre-install b/system/vlc/vlc-daemon.pre-install new file mode 100644 index 000000000..aed6c1893 --- /dev/null +++ b/system/vlc/vlc-daemon.pre-install @@ -0,0 +1,15 @@ +#!/bin/sh + +groups="vlc audio video" + +for group in $groups; do + addgroup -S $group 2>/dev/null +done +adduser -S -D -h /home/vlc -s /bin/sh -G vlc -g vlc vlc 2>/dev/null + +# make sure vlc are in all groups +for group in $groups; do + addgroup vlc $group 2>/dev/null +done + +exit 0 diff --git a/system/vlc/vlc-libs.trigger b/system/vlc/vlc-libs.trigger new file mode 100644 index 000000000..c13bace99 --- /dev/null +++ b/system/vlc/vlc-libs.trigger @@ -0,0 +1,5 @@ +#!/bin/sh + +exec /usr/lib/vlc/vlc-cache-gen "$@" >&/dev/null +exit 0 + diff --git a/system/vlc/vlc.confd b/system/vlc/vlc.confd new file mode 100644 index 000000000..9a58842bd --- /dev/null +++ b/system/vlc/vlc.confd @@ -0,0 +1,15 @@ +# Sample vlc params suitable for running as a daemon + +## --file-logging enable file logging +## --logfile logfile name/path +## -vvv verbose logging +## -I dummy disable X11 interface +## --sout PARAMS encoding parameters + + +## Do NOT quote 'PARAMS' otherwise shell expansions will broke vlc +## +## The --daemon option will automatically be added so no need to add it +## here. + +VLC_OPTS="--quiet -I dummy alsa://hw:0,0 --file-logging --logfile /var/log/vlc/vlc.log --sout #transcode{acodec=mp3,ab=48,channels=1,samplerate=22050}:std{access=http,mux=ogg,dst=:8080}" diff --git a/system/vlc/vlc.initd b/system/vlc/vlc.initd new file mode 100755 index 000000000..541a07180 --- /dev/null +++ b/system/vlc/vlc.initd @@ -0,0 +1,32 @@ +#!/sbin/openrc-run + +description="VideoLAN daemon" +pidfile="/var/run/vlc/${RC_SVCNAME}.pid" +command="/usr/bin/vlc" + +depend() { + need net + after firewall +} + +start_pre() { + checkpath --directory --owner vlc:vlc --mode 775 ${pidfile%/*} +} + +start() { + ebegin "Starting ${RC_SVCNAME}" + start-stop-daemon --start \ + --user vlc \ + --pidfile ${pidfile} \ + --exec ${command} \ + -- \ + --daemon --pidfile ${pidfile} ${VLC_OPTS} + eend $? +} + +stop() { + ebegin "Stopping ${RC_SVCNAME}" + start-stop-daemon --stop \ + --pidfile ${pidfile} + eend $? +} -- cgit v1.2.3-60-g2f50