summaryrefslogtreecommitdiff
path: root/media-video/vdr
diff options
context:
space:
mode:
Diffstat (limited to 'media-video/vdr')
-rw-r--r--media-video/vdr/Manifest17
-rw-r--r--media-video/vdr/files/channel_alternative.conf11
-rw-r--r--media-video/vdr/files/vdr-2.0.6-r2_gentoo.patch73
-rw-r--r--media-video/vdr/files/vdr-2.0.6_gentoo.patch68
-rw-r--r--media-video/vdr/files/vdr-2.0.7_systemd_argsdir.patch438
-rw-r--r--media-video/vdr/files/vdr-2.0.7_systemd_argsdir_vanilla.patch438
-rw-r--r--media-video/vdr/files/vdr-2.2.0_gentoo.patch70
-rw-r--r--media-video/vdr/metadata.xml32
-rw-r--r--media-video/vdr/vdr-2.0.6-r1.ebuild277
-rw-r--r--media-video/vdr/vdr-2.0.7.ebuild288
-rw-r--r--media-video/vdr/vdr-2.2.0-r1.ebuild299
11 files changed, 2011 insertions, 0 deletions
diff --git a/media-video/vdr/Manifest b/media-video/vdr/Manifest
new file mode 100644
index 000000000000..7f74653a9e2e
--- /dev/null
+++ b/media-video/vdr/Manifest
@@ -0,0 +1,17 @@
+AUX channel_alternative.conf 332 SHA256 30fb0a5147c01429c2813505cc69658cf1bfa1b70537bce07365017f653be5ce SHA512 738de5d5d99b54a516f41683834509b477590732db4e00b13b2f26e22c7349cb8517965a21251c08d29b0f368b2bb3fa64a1de71da09ffbedc5a401314a0eb5d WHIRLPOOL 96ead1c37c9e88e6593536a2182b813d3ae86c8e55e79a4cc5ff2d29ec0694405d26c82cb2295bb3f1e7e61c0ec93a646acc518e35ed6eff4d66c9219cc35677
+AUX vdr-2.0.6-r2_gentoo.patch 2518 SHA256 02f20c8bcf0c0d686fbaad19a76025db6e5bed00ee0f191c2096533d42554d38 SHA512 01416b5825595d5a8c813297dd1791978f0d4ffe1b06d2254772c3dc2d76d0c09720ada64dc332df156196d73b8500ae1dcdb08d95502a8c940baf4590ece545 WHIRLPOOL 1fdeb47b5919d96f729a79185c020b8d0a49866a6b28c0296859eb671da30f49085c62c803853209f98b405466c0cc684e9d673c5f7713cadfd2c1d96e32802b
+AUX vdr-2.0.6_gentoo.patch 2255 SHA256 486b513f8ab723685e72b041b546d1cda799f743ef8020f5742aefee7a1b1660 SHA512 7bb087d2f362e28700a6f22b2649bd61742a7967344f0132abaaa2ae30d4aef3e9a7afd06d80d2a4a97248abfa273cb5d7e20e419c8409a5a83744fd043fb7e9 WHIRLPOOL 20f1b870305e55d4c2cfc2fad0968b6232b22585218a60378aa95bb420228e0704a2b42699daff84a36f92d4b2937a1ada9db5514a0789f5c47b66001a9ed1ed
+AUX vdr-2.0.7_systemd_argsdir.patch 14827 SHA256 bf4b955eca4f2d02419cab5c0ad4f527938bbd6b6c07a096a92be40dcab28da5 SHA512 f0510d27d4b5ff2bbc3f400e5e8e4aae165f665bc7455742e12ebe6f9c6e46985b2ac9fd4089fd3c33c71d975afe73a6e9e089fc6fd9f226c5d53e3fe0553317 WHIRLPOOL 6f7ae8d7609115fc4213e252e641a17fe6a24c7983c49cfce1ac8d372d57f02ea1c0ecbfbc5d8e07ffdd547486e2f8712177c9eff050db6fe7bf39147a4627e0
+AUX vdr-2.0.7_systemd_argsdir_vanilla.patch 14825 SHA256 febec104f10ba46bd3839d0d3f3571740b500f531d2bb0f50930e5faeed3f651 SHA512 1270abaca1bed4a1dfc7756aaa9d1e3b17c5f35b69f3ff333988192ceddb10bbe03aa1973f878537d750b92a0a277213de193f98d6f113a2f447e342867639f3 WHIRLPOOL 68d06303f5899f6bfb86ff67403c5ddd8aed260c06edc6a72b411f19d0e9f59c88ec6f93051822bfe0d00ee39741480ddec5a5118592bf72f4f3dd27c34a0b19
+AUX vdr-2.2.0_gentoo.patch 2322 SHA256 8088a4f314e0b8d908f82cfe2a7392a18db679a7324bfa92dce49431c50313ec SHA512 c6953a7fb77717fdaa8ca05550496e25f4bc60d91c13ed0fb23d27e1a1ec433ec2d5cfb019717cf09eb7b67c9ebb91664b1b731dc28bc4f25e815871f6de0bc7 WHIRLPOOL 88d4e8407b085604525d9bae1f34a957ae5f168ac657a99c45dcba5f08185351ccb03736cfc464960d3f2157ac6357ffbf8b602dd1da49ee94efb403f71731d8
+DIST extpng-vdr-2.0.6-gentoo-edition-v6.patch.bz2 69472 SHA256 f2ea1371b88898acfde5fa390f5b13a5c23065a877bbba5658a194e64d6553e5 SHA512 f4ecb786ec5a026fa75fcf539518e80273bf43fc325c13a380c70eb85351910efa991b3ee71ca477e597bc2b4598a18620b6cf00fc02714acfcc4e6112d84b6c WHIRLPOOL 13bb3697afa4b2665d9de3de8892a0baf877991642a94d3305e15d98cbcba73aa743f80bdd76f9a3297653c92e99ec6ae629ed7919c26c730cef2fa2fd608ef1
+DIST extpng-vdr-2.2.0-gentoo-edition-v1.patch.bz2 34664 SHA256 eebc812b160f5f44d665efa7bacd5abc57b27815deb28eb3d83ea3129d43b2b5 SHA512 16d6fbb8201f003dfe653b6a49424b794d7e697e27ad6f2383dbe17b76712ea5a3da88a676900b84d75ff7425bf3eb9084d60a89a4598758f482dc1f013f7b3e WHIRLPOOL 702ec541dcdb075ba9e9df450312c7a5ca3b34e9520edaf85a89426734d184b3cc8138a2ed8ad0c34fb7599d99d48c7538842c7f8126751f3b3ebeb6702cac4d
+DIST vdr-2.0.6.tar.bz2 839575 SHA256 c33c6431726378d5af575d8cfcacd34a50d17334e091dc4a095b6b75bc99b972 SHA512 070ebbfb85478887088567872a71744305dbf9c75de8b095a8fe46d883b0b4fe140539caeb2243715f42793a45790a127542655f549f7ea3cb71c4f9912fa07d WHIRLPOOL c9d1cf47473299617d1eeca7b5445450448c558b17a20193260bf3a01030eb81e29f210dc349e9b3a51137acd6d866201d07860a79954ae2da2b87159db3e511
+DIST vdr-2.0.7.tar.bz2 841511 SHA256 5c81418dc97d70ae965af5bdf641057cb64a7e76ecf9c94f72e417cc6c73fb13 SHA512 cba35f62162cd681179872915023890f492e95cc94d65aadd3cb4d03d7e3c7e2f197e7f35149cdf872169af35c2b841e1042e054f28164860b7cea8367793ce0 WHIRLPOOL 262e8e96d399c34ae492d92491720346c29c3d84bfb1c8b4a1e992f3586514f698d9f33f5a3b8e8204a054ee41767547ad4510a6a7637c1b27e917655481ab5a
+DIST vdr-2.2.0.tar.bz2 922708 SHA256 7c259e1ed1f39d93d23df1d5d0f85dd2a1fa9ec1dadff79e5833e2ff3ebf6c4e SHA512 183f58133915c6c0fe8ec2b88becbcb2a36418210e6dcf7931053d3771d727c3581593f9eb5c9693abf39e22e728f7b41c42079cd704610c3636ec05134ea93d WHIRLPOOL 2ce98f242e7ae3e7969005fde7214a2707749ab06622e78d56764c50c9a3f1e6e06a693091f19d45dc537b1702d365d3f9cfa4af24fb61aa8a0c64c5385fa19e
+EBUILD vdr-2.0.6-r1.ebuild 6921 SHA256 2bb88039b1b1b305c788f906146d6b16cb41d767a507a32793a90da096e95f9d SHA512 10997c095cb8af5f0ffa00e07247a790cb038f42a9705a4e6b2e5ca715431dd51749dc5faf9beadf899a4170d9e01de92ff61cf1cdf6e21fe87e6dd60afab07b WHIRLPOOL 1eda72d44543ec82db3754a4b1f3114c04babbfe7cfdd3afb476f148f1cc3823afc88b0633b693ac6935f22c9a3800c17611c51e48d0f6e6ea8a17df844dd20d
+EBUILD vdr-2.0.7.ebuild 7275 SHA256 9448be106b4456acf8be73b95018ebb4cf8b7d0d23677d9eae7f57477e2a3111 SHA512 c43dd5e9d776ff640eb04b3064f77ead2931194642eb2b541a0add7e3df1c4d6291bfcf4996a450af5a4e979566ae6b374f4cbe20dca71e797fea29bdf5d8520 WHIRLPOOL 62c97035886a210f1dcaa34a8cd2bc190a0bc5d332927db07700665f3f1c43c45ce6ec8f729968b0a3fc3c7a43cd6c19cf9760e48ea46cf3f93cb8d61eda58c4
+EBUILD vdr-2.2.0-r1.ebuild 7538 SHA256 03babb92b13736a1cb3450df28b20eb9a3f0baa7f4b8b367cc17438608dd0e8a SHA512 641e41abcabaae613a2d6f0a6ba55194b04ee412ed48461869dc0e4c705a02bb7cfe7ae9c64cc7efadfd3a4ed9dd7a06661874bbbbf3a5e213269899a6b6d572 WHIRLPOOL f4176bad93506c64b30f0e13fa1397fd117e58909799562aaca50681e7ec5f60ad92cee837c557c0d7ceb47560b8a8666dbb817a884d69c170f13e8f1ffaa5fa
+MISC ChangeLog 3932 SHA256 be26e30976c39fbddf22c1e37c93a551683bb0d28cdab6bbdfb7139fd1d19e6e SHA512 86a0268cfddadaffaad44663b1c6ef253c460e01fc752eb9014cad94a4dd09646e36497583692ea51844f161c11b095361f405387ecda9a57eaa836fb5947179 WHIRLPOOL 6131e6e327a27cec47d7b6790346d3f8db32cd44dbad736e557ce980c7bfe311ad75c054109f9586cdf5ad133969b63a8c9ac8934f2e019277593235bfceb54b
+MISC ChangeLog-2015 35518 SHA256 6057b52a036032db0d24f349dee65608aaf047fbf90cde2db624da21923f5e3e SHA512 155549b59efbbdc1720d7802263e6959bc2db6b18d148b39b998ac5812d7a9063d1c6001af9800a4ee02fffaab0768252b351db2a53208b007b77ae09027d851 WHIRLPOOL 755b5c5617a59e3cfc758813f569f2c237867986dcc99e94def1b66f7cef05db546d0e269e7d8dd4cf9fad8e7aa4077f7269403562bbc2c0484499e6b856610f
+MISC metadata.xml 2188 SHA256 17020dd73920f9b0941ed582b86bb0c201e9f7e770f9caa4a812111b25bbe378 SHA512 c7e36a284d3b2fddf93b4abfd84fe65a4420b88330d0c395de0fb74564c3606a9e9e0402f5853898432f6d9d68c70e59c55249b8b79dacbe17a84eea24f1f2cc WHIRLPOOL eb0ede89293fa1ecccab51b81bd60eb39c025034826ba57d1a319cffc5c61338126b250645fcac66c9916f2efe8b74f71c0a20cf2cb3a6adf6d3f41c633610ea
diff --git a/media-video/vdr/files/channel_alternative.conf b/media-video/vdr/files/channel_alternative.conf
new file mode 100644
index 000000000000..fb9088f0c439
--- /dev/null
+++ b/media-video/vdr/files/channel_alternative.conf
@@ -0,0 +1,11 @@
+# Alternative channel configuration file
+#
+# Syntax: original channel id;alternative channel id
+# Example: C-62499-10007-12003;C-0-196-14
+# this means, if channel C-62499-10007-12003 is
+# not available for a recording, vdr will try to
+# use channel C-0-196-14
+#
+# lines beginning with '#' are ignored
+#
+
diff --git a/media-video/vdr/files/vdr-2.0.6-r2_gentoo.patch b/media-video/vdr/files/vdr-2.0.6-r2_gentoo.patch
new file mode 100644
index 000000000000..516bb7b7254f
--- /dev/null
+++ b/media-video/vdr/files/vdr-2.0.6-r2_gentoo.patch
@@ -0,0 +1,73 @@
+disabled plugin install from vdr source, we dont support this way
+patch to support LINGUAS variable
+fixed install on multicore cpu, creating CONFDIR on later time
+install libsi includes in own dir
+Signed-of-by: Joerg Bornkessel <hd_brummy@gentoo.org> 20/Jan/2015
+diff -Naur vdr-2.0.6.orig/Makefile vdr-2.0.6/Makefile
+--- vdr-2.0.6.orig/Makefile 2014-09-22 22:17:23.000000000 +0200
++++ vdr-2.0.6/Makefile 2014-09-24 15:22:43.000000000 +0200
+@@ -109,7 +109,7 @@
+ VDRVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
+ APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
+
+-all: vdr i18n plugins
++all: vdr i18n
+
+ # Implicit rules:
+
+@@ -162,7 +162,7 @@
+
+ PODIR = po
+ LOCALEDIR = locale
+-I18Npo = $(wildcard $(PODIR)/*.po)
++I18Npo = $(foreach dir,$(LINGUAS),$(wildcard $(PODIR)/$(dir)*.po))
+ I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
+ I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr.mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
+ I18Npot = $(PODIR)/vdr.pot
+@@ -185,7 +185,7 @@
+
+ install-i18n: i18n
+ @mkdir -p $(DESTDIR)$(LOCDIR)
+- cp -r $(LOCALEDIR)/* $(DESTDIR)$(LOCDIR)
++ @(cd $(LOCALEDIR); for linguas in $(LINGUAS); do [ "$$linguas" = "en" ] && continue; cp -r --parents $$linguas* $(DESTDIR)$(LOCDIR); done)
+
+ # The 'include' directory (for plugins):
+
+@@ -247,7 +247,7 @@
+
+ # Install the files (note that 'install-pc' must be first!):
+
+-install: install-pc install-bin install-dirs install-conf install-doc install-plugins install-i18n install-includes
++install: install-pc install-bin install-dirs install-conf install-doc install-i18n install-includes
+
+ # VDR binary:
+
+@@ -259,11 +259,12 @@
+
+ install-dirs:
+ @mkdir -p $(DESTDIR)$(VIDEODIR)
+- @mkdir -p $(DESTDIR)$(CONFDIR)
+- @mkdir -p $(DESTDIR)$(CACHEDIR)
++# @mkdir -p $(DESTDIR)$(CONFDIR)
++# @mkdir -p $(DESTDIR)$(CACHEDIR)
+ @mkdir -p $(DESTDIR)$(RESDIR)
+
+ install-conf:
++ @mkdir -p $(DESTDIR)$(CONFDIR)
+ @cp -pn *.conf $(DESTDIR)$(CONFDIR)
+
+ # Documentation:
+@@ -290,8 +291,11 @@
+ # Includes:
+
+ install-includes: include-dir
+- @mkdir -p $(DESTDIR)$(INCDIR)
+- @cp -pLR include/vdr include/libsi $(DESTDIR)$(INCDIR)
++# @mkdir -p $(DESTDIR)$(INCDIR)
++# @cp -pLR include/vdr include/libsi $(DESTDIR)$(INCDIR)
++ @mkdir -p $(DESTDIR)$(INCDIR)/vdr $(DESTDIR)$(INCDIR)/vdr/libsi
++ @cp -pLR include/vdr $(DESTDIR)$(INCDIR)
++ @cp -pLR include/libsi Make.config $(DESTDIR)$(INCDIR)/vdr
+
+ # pkg-config file:
+
diff --git a/media-video/vdr/files/vdr-2.0.6_gentoo.patch b/media-video/vdr/files/vdr-2.0.6_gentoo.patch
new file mode 100644
index 000000000000..1641fc8e2ee6
--- /dev/null
+++ b/media-video/vdr/files/vdr-2.0.6_gentoo.patch
@@ -0,0 +1,68 @@
+diff -Naur vdr-2.0.6.orig/Makefile vdr-2.0.6/Makefile
+--- vdr-2.0.6.orig/Makefile 2014-09-22 22:17:23.000000000 +0200
++++ vdr-2.0.6/Makefile 2014-09-24 15:22:43.000000000 +0200
+@@ -109,7 +109,7 @@
+ VDRVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
+ APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
+
+-all: vdr i18n plugins
++all: vdr i18n
+
+ # Implicit rules:
+
+@@ -162,7 +162,7 @@
+
+ PODIR = po
+ LOCALEDIR = locale
+-I18Npo = $(wildcard $(PODIR)/*.po)
++I18Npo = $(foreach dir,$(LINGUAS),$(wildcard $(PODIR)/$(dir)*.po))
+ I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
+ I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr.mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
+ I18Npot = $(PODIR)/vdr.pot
+@@ -185,7 +185,7 @@
+
+ install-i18n: i18n
+ @mkdir -p $(DESTDIR)$(LOCDIR)
+- cp -r $(LOCALEDIR)/* $(DESTDIR)$(LOCDIR)
++ @(cd $(LOCALEDIR); for linguas in $(LINGUAS); do [ "$$linguas" = "en" ] && continue; cp -r --parents $$linguas* $(DESTDIR)$(LOCDIR); done)
+
+ # The 'include' directory (for plugins):
+
+@@ -247,7 +247,7 @@
+
+ # Install the files (note that 'install-pc' must be first!):
+
+-install: install-pc install-bin install-dirs install-conf install-doc install-plugins install-i18n install-includes
++install: install-pc install-bin install-dirs install-conf install-doc install-i18n install-includes
+
+ # VDR binary:
+
+@@ -259,11 +259,12 @@
+
+ install-dirs:
+ @mkdir -p $(DESTDIR)$(VIDEODIR)
+- @mkdir -p $(DESTDIR)$(CONFDIR)
+- @mkdir -p $(DESTDIR)$(CACHEDIR)
++# @mkdir -p $(DESTDIR)$(CONFDIR)
++# @mkdir -p $(DESTDIR)$(CACHEDIR)
+ @mkdir -p $(DESTDIR)$(RESDIR)
+
+ install-conf:
++ @mkdir -p $(DESTDIR)$(CONFDIR)
+ @cp -pn *.conf $(DESTDIR)$(CONFDIR)
+
+ # Documentation:
+@@ -290,8 +291,11 @@
+ # Includes:
+
+ install-includes: include-dir
+- @mkdir -p $(DESTDIR)$(INCDIR)
+- @cp -pLR include/vdr include/libsi $(DESTDIR)$(INCDIR)
++# @mkdir -p $(DESTDIR)$(INCDIR)
++# @cp -pLR include/vdr include/libsi $(DESTDIR)$(INCDIR)
++ @mkdir -p $(DESTDIR)$(INCDIR)/vdr $(DESTDIR)$(INCDIR)/vdr/libsi
++ @cp -pLR include/vdr $(DESTDIR)$(INCDIR)
++ @cp -pLR include/libsi Make.config $(DESTDIR)$(INCDIR)/vdr
+
+ # pkg-config file:
+
diff --git a/media-video/vdr/files/vdr-2.0.7_systemd_argsdir.patch b/media-video/vdr/files/vdr-2.0.7_systemd_argsdir.patch
new file mode 100644
index 000000000000..de9f4b90163f
--- /dev/null
+++ b/media-video/vdr/files/vdr-2.0.7_systemd_argsdir.patch
@@ -0,0 +1,438 @@
+diff -Naur vdr-2.0.7.orig/HISTORY vdr-2.0.7/HISTORY
+--- vdr-2.0.7.orig/HISTORY 2015-01-23 09:16:13.735620000 +0100
++++ vdr-2.0.7/HISTORY 2015-01-23 09:17:29.038614491 +0100
+@@ -7916,6 +7916,16 @@
+ - The APIVERSION has been increased to 2.0.6 due to the changes to pat.h, sdt.h and
+ the functional modification to cFont::CreateFont().
+
++2015-01-18: Version 2.0.6 + backport of systemd support from versions 2.1.6 and 2.1.7
++
++- Added support for systemd (thanks to Christopher Reimer). To activate this you
++ need to add "SDNOTIFY=1" to the 'make' call.
++
++2015-01-18: Version 2.0.6 + backport of reading command line arguments from files, from version 2.1$
++
++- VDR now reads command line options from *.conf files in /etc/vdr/conf.d (thanks
++ to Lars Hanisch). See vdr.1 and vdr.5 for details.
++
+ 2015-01-20: Version 2.0.7
+
+ - Fixed a possible division by zero in frame rate detection.
+diff -Naur vdr-2.0.7.orig/Make.config.template vdr-2.0.7/Make.config.template
+--- vdr-2.0.7.orig/Make.config.template 2015-01-23 09:16:13.736620000 +0100
++++ vdr-2.0.7/Make.config.template 2015-01-23 09:16:34.199618503 +0100
+@@ -38,6 +38,7 @@
+
+ #VIDEODIR = /srv/vdr/video
+ #CONFDIR = /var/lib/vdr
++#ARGSDIR = /etc/vdr/conf.d
+ #CACHEDIR = /var/cache/vdr
+
+ # Overrides for preset/legacy configurations:
+diff -Naur vdr-2.0.7.orig/Makefile vdr-2.0.7/Makefile
+--- vdr-2.0.7.orig/Makefile 2015-01-23 09:16:13.724620001 +0100
++++ vdr-2.0.7/Makefile 2015-01-23 09:17:58.588612330 +0100
+@@ -31,6 +31,7 @@
+ DESTDIR ?=
+ VIDEODIR ?= /srv/vdr/video
+ CONFDIR ?= /var/lib/vdr
++ARGSDIR ?= /etc/vdr/conf.d
+ CACHEDIR ?= /var/cache/vdr
+
+ PREFIX ?= /usr/local
+@@ -66,7 +67,7 @@
+
+ SILIB = $(LSIDIR)/libsi.a
+
+-OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o dvbci.o\
++OBJS = args.o audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o dvbci.o\
+ dvbplayer.o dvbspu.o dvbsubtitle.o eit.o eitscan.o epg.o filter.o font.o i18n.o interface.o keys.o\
+ lirc.o menu.o menuitems.o nit.o osdbase.o osd.o pat.o player.o plugin.o\
+ receiver.o recorder.o recording.o remote.o remux.o ringbuffer.o sdt.o sections.o shutdown.o\
+@@ -111,12 +112,18 @@
+ DEFINES += -DBIDI
+ LIBS += $(shell pkg-config --libs fribidi)
+ endif
++ifdef SDNOTIFY
++INCLUDES += $(shell pkg-config --cflags libsystemd-daemon)
++DEFINES += -DSDNOTIFY
++LIBS += $(shell pkg-config --libs libsystemd-daemon)
++endif
+
+ LIRC_DEVICE ?= /var/run/lirc/lircd
+
+ DEFINES += -DLIRC_DEVICE=\"$(LIRC_DEVICE)\"
+ DEFINES += -DVIDEODIR=\"$(VIDEODIR)\"
+ DEFINES += -DCONFDIR=\"$(CONFDIR)\"
++DEFINES += -DARGSDIR=\"$(ARGSDIR)\"
+ DEFINES += -DCACHEDIR=\"$(CACHEDIR)\"
+ DEFINES += -DRESDIR=\"$(RESDIR)\"
+ DEFINES += -DPLUGINDIR=\"$(LIBDIR)\"
+@@ -161,6 +168,7 @@
+ @echo "mandir=$(MANDIR)" >> $@
+ @echo "configdir=$(CONFDIR)" >> $@
+ @echo "videodir=$(VIDEODIR)" >> $@
++ @echo "argsdir=$(ARGSDIR)" >> $@
+ @echo "cachedir=$(CACHEDIR)" >> $@
+ @echo "resdir=$(RESDIR)" >> $@
+ @echo "libdir=$(LIBDIR)" >> $@
+@@ -278,6 +286,7 @@
+ install-dirs:
+ @mkdir -p $(DESTDIR)$(VIDEODIR)
+ # @mkdir -p $(DESTDIR)$(CONFDIR)
++ @mkdir -p $(DESTDIR)$(ARGSDIR)
+ # @mkdir -p $(DESTDIR)$(CACHEDIR)
+ @mkdir -p $(DESTDIR)$(RESDIR)
+
+diff -Naur vdr-2.0.7.orig/args.c vdr-2.0.7/args.c
+--- vdr-2.0.7.orig/args.c 1970-01-01 01:00:00.000000000 +0100
++++ vdr-2.0.7/args.c 2015-01-23 09:16:34.199618503 +0100
+@@ -0,0 +1,129 @@
++/*
++ * args.c: Read arguments from files
++ *
++ * See the main source file 'vdr.c' for copyright information and
++ * how to reach the author.
++ *
++ * Original version written by Lars Hanisch <dvb@flensrocker.de>.
++ *
++ * $Id$
++ */
++
++#include "args.h"
++#include <unistd.h>
++
++cArgs::cArgs(const char *Argv0)
++{
++ argv0 = Argv0;
++ argc = 0;
++ argv = NULL;
++}
++
++cArgs::~cArgs(void)
++{
++ if (argv != NULL)
++ delete [] argv;
++}
++
++bool cArgs::AddArg(const char *s)
++{
++ if (inVdrSection)
++ args.Append(strdup(s));
++ else if (*lastArg == NULL)
++ return false;
++ else
++ lastArg = cString::sprintf("%s %s", *lastArg, s);
++ return true;
++}
++
++bool cArgs::ReadDirectory(const char *Directory)
++{
++ if (argv != NULL)
++ delete [] argv;
++ argc = 0;
++ argv = NULL;
++ args.Clear();
++ lastArg = NULL;
++ inVdrSection = false;
++ cFileNameList files(Directory, false);
++ if (files.Size() == 0)
++ return false;
++ for (int i = 0; i < files.Size(); i++) {
++ const char *fileName = files.At(i);
++ if (startswith(fileName, ".") || !endswith(fileName, ".conf"))
++ continue;
++ cString fullFileName = AddDirectory(Directory, fileName);
++ struct stat fs;
++ if ((access(*fullFileName, F_OK) != 0) || (stat(*fullFileName, &fs) != 0) || S_ISDIR(fs.st_mode))
++ continue;
++ bool ok = true;
++ int line = 0;
++ FILE *f = fopen(*fullFileName, "r");
++ if (f) {
++ char *s;
++ cReadLine ReadLine;
++ while ((s = ReadLine.Read(f)) != NULL) {
++ line++;
++ s = stripspace(skipspace(s));
++ if (!isempty(s) && (s[0] != '#')) {
++ if (startswith(s, "[") && endswith(s, "]")) {
++ s[strlen(s) - 1] = 0;
++ s++;
++ if (*lastArg) {
++ args.Append(strdup(*lastArg));
++ lastArg = NULL;
++ }
++ if (strcmp(s, "vdr") == 0)
++ inVdrSection = true;
++ else {
++ inVdrSection = false;
++ lastArg = cString::sprintf("--plugin=%s", s);
++ }
++ }
++ else {
++ if ((strlen(s) > 2) && (s[0] == '-') && (s[1] != '-')) { // short option, split at first space
++ char *p = strchr(s, ' ');
++ if (p == NULL) {
++ ok = AddArg(s);
++ if (!ok)
++ break;
++ }
++ else {
++ *p = 0;
++ p++;
++ ok = AddArg(s);
++ if (!ok)
++ break;
++ ok = AddArg(p);
++ if (!ok)
++ break;
++ }
++ }
++ else {
++ ok = AddArg(s);
++ if (!ok)
++ break;
++ }
++ }
++ }
++ }
++ fclose(f);
++ }
++ if (!ok) {
++ esyslog("ERROR: args file %s, line %d", *fullFileName, line);
++ return false;
++ }
++ }
++ if (*lastArg) {
++ args.Append(strdup(*lastArg));
++ lastArg = NULL;
++ }
++ argv = new char*[args.Size() + 1];
++ argv[0] = strdup(*argv0);
++ argc = 1;
++ for (int i = 0; i < args.Size(); i++) {
++ argv[argc] = args.At(i);
++ argc++;
++ }
++ return true;
++}
+diff -Naur vdr-2.0.7.orig/args.h vdr-2.0.7/args.h
+--- vdr-2.0.7.orig/args.h 1970-01-01 01:00:00.000000000 +0100
++++ vdr-2.0.7/args.h 2015-01-23 09:16:34.199618503 +0100
+@@ -0,0 +1,34 @@
++/*
++ * args.h: Read arguments from files
++ *
++ * See the main source file 'vdr.c' for copyright information and
++ * how to reach the author.
++ *
++ * Original version written by Lars Hanisch <dvb@flensrocker.de>.
++ *
++ * $Id$
++ */
++
++#ifndef __ARGS_H
++#define __ARGS_H
++
++#include "tools.h"
++
++class cArgs {
++private:
++ cString argv0;
++ cStringList args;
++ cString lastArg;
++ bool inVdrSection;
++ int argc;
++ char **argv;
++ bool AddArg(const char *s);
++public:
++ cArgs(const char *Argv0);
++ ~cArgs(void);
++ bool ReadDirectory(const char *Directory);
++ int GetArgc(void) const { return argc; };
++ char **GetArgv(void) const { return argv; };
++ };
++
++#endif //__ARGS_H
+diff -Naur vdr-2.0.7.orig/interface.c vdr-2.0.7/interface.c
+--- vdr-2.0.7.orig/interface.c 2015-01-23 09:16:13.725620001 +0100
++++ vdr-2.0.7/interface.c 2015-01-23 09:16:34.199618503 +0100
+@@ -10,6 +10,9 @@
+ #include "interface.h"
+ #include <ctype.h>
+ #include <stdlib.h>
++#ifdef SDNOTIFY
++#include <systemd/sd-daemon.h>
++#endif
+ #include <unistd.h>
+ #include "i18n.h"
+ #include "status.h"
+@@ -159,6 +162,9 @@
+ bool known = Keys.KnowsRemote(Remote->Name());
+ dsyslog("remote control %s - %s", Remote->Name(), known ? "keys known" : "learning keys");
+ if (!known) {
++#ifdef SDNOTIFY
++ sd_notify(0, "READY=1\nSTATUS=Learning keys...");
++#endif
+ cSkinDisplayMenu *DisplayMenu = Skins.Current()->DisplayMenu();
+ DisplayMenu->SetMenuCategory(mcUnknown);
+ char Headline[256];
+diff -Naur vdr-2.0.7.orig/vdr.1 vdr-2.0.7/vdr.1
+--- vdr-2.0.7.orig/vdr.1 2015-01-23 09:16:13.730620000 +0100
++++ vdr-2.0.7/vdr.1 2015-01-23 09:16:34.200618503 +0100
+@@ -178,6 +178,10 @@
+ Read resource files from \fIdir\fR
+ (default is to read them from the config directory).
+ .TP
++.BI \-\-showargs[= dir ]
++Read command line arguments from \fIdir\fR (default is \fI/etc/vdr/conf.d\fR),
++display them to the console and exit.
++.TP
+ .BI \-s\ cmd ,\ \-\-shutdown= cmd
+ Call \fIcmd\fR to shutdown the computer. See the file \fIINSTALL\fR for more
+ information.
+@@ -213,6 +217,10 @@
+ .BI \-w\ sec ,\ \-\-watchdog= sec
+ Activate the watchdog timer with a timeout of \fIsec\fR seconds.
+ A value of \fB0\fR (default) disables the watchdog.
++.P
++If started without any options, vdr tries to read command line options
++from files named '*.conf' in the directory /etc/vdr/conf.d. Files are
++read in alphabetical order. See vdr(5) for details.
+ .SH SIGNALS
+ .TP
+ .B SIGINT, SIGTERM
+diff -Naur vdr-2.0.7.orig/vdr.5 vdr-2.0.7/vdr.5
+--- vdr-2.0.7.orig/vdr.5 2015-01-23 09:16:13.732620000 +0100
++++ vdr-2.0.7/vdr.5 2015-01-23 09:16:34.200618503 +0100
+@@ -895,6 +895,33 @@
+ just 16 bit wide. The internal representation in VDR allows for 32 bit to
+ be used, so that external tools can generate EPG data that is guaranteed
+ not to collide with the ids of existing data.
++.SS COMMANDLINE OPTIONS
++If started without any options, vdr tries to read any files in the directory
++/etc/vdr/conf.d with names that do not begin with a '.' and that end with '.conf'.
++These files are read in alphabetical order. The format of these files is
++
++# comment
++.br
++[name]
++.br
++-a
++.br
++-b 123
++.br
++--long
++.br
++--longarg=123
++.br
++
++Any lines that begin with '#' as the first non-whitespace character are considered
++comments and are ignored.
++A command line option file consists of one or more sections, indicated by '[name]',
++where 'name' is either the fixed word 'vdr' (if this section contains options for
++the main VDR program) or the name of the plugin this section applies to.
++Each option must be written on a separate line, including the leading '-' (for
++a short option) or '--' (for a long option). If the option has additional arguments,
++they have to be written on the same line as the option itself, separated from the
++option with a blank (short option) or equal sign (long option).
+ .SH SEE ALSO
+ .BR vdr (1)
+ .SH AUTHOR
+diff -Naur vdr-2.0.7.orig/vdr.c vdr-2.0.7/vdr.c
+--- vdr-2.0.7.orig/vdr.c 2015-01-23 09:16:13.732620000 +0100
++++ vdr-2.0.7/vdr.c 2015-01-23 09:16:34.200618503 +0100
+@@ -34,8 +34,12 @@
+ #include <stdlib.h>
+ #include <sys/capability.h>
+ #include <sys/prctl.h>
++#ifdef SDNOTIFY
++#include <systemd/sd-daemon.h>
++#endif
+ #include <termios.h>
+ #include <unistd.h>
++#include "args.h"
+ #include "audio.h"
+ #include "channels.h"
+ #include "config.h"
+@@ -192,6 +196,7 @@
+ #define DEFAULTWATCHDOG 0 // seconds
+ #define DEFAULTVIDEODIR VIDEODIR
+ #define DEFAULTCONFDIR dd(CONFDIR, VideoDirectory)
++#define DEFAULTARGSDIR dd(ARGSDIR, "/etc/vdr/conf.d")
+ #define DEFAULTCACHEDIR dd(CACHEDIR, VideoDirectory)
+ #define DEFAULTRESDIR dd(RESDIR, ConfigDirectory)
+ #define DEFAULTPLUGINDIR PLUGINDIR
+@@ -229,6 +234,15 @@
+ VdrUser = VDR_USER;
+ #endif
+
++ cArgs *Args = NULL;
++ if (argc == 1) {
++ Args = new cArgs(argv[0]);
++ if (Args->ReadDirectory(DEFAULTARGSDIR)) {
++ argc = Args->GetArgc();
++ argv = Args->GetArgv();
++ }
++ }
++
+ SetVideoDirectory(VideoDirectory);
+ cPluginManager PluginManager(DEFAULTPLUGINDIR);
+
+@@ -256,6 +270,7 @@
+ { "port", required_argument, NULL, 'p' },
+ { "record", required_argument, NULL, 'r' },
+ { "resdir", required_argument, NULL, 'r' | 0x100 },
++ { "showargs", optional_argument, NULL, 's' | 0x200 },
+ { "shutdown", required_argument, NULL, 's' },
+ { "split", no_argument, NULL, 's' | 0x100 },
+ { "terminal", required_argument, NULL, 't' },
+@@ -428,6 +443,19 @@
+ case 's' | 0x100:
+ Setup.SplitEditedFiles = 1;
+ break;
++ case 's' | 0x200: {
++ const char *ArgsDir = optarg ? optarg : DEFAULTARGSDIR;
++ cArgs Args(argv[0]);
++ if (!Args.ReadDirectory(ArgsDir)) {
++ fprintf(stderr, "vdr: can't read arguments from directory: %s\n", ArgsDir);
++ return 2;
++ }
++ int c = Args.GetArgc();
++ char **v = Args.GetArgv();
++ for (int i = 1; i < c; i++)
++ printf("%s\n", v[i]);
++ return 0;
++ }
+ case 't': Terminal = optarg;
+ if (access(Terminal, R_OK | W_OK) < 0) {
+ fprintf(stderr, "vdr: can't access terminal: %s\n", Terminal);
+@@ -541,6 +569,8 @@
+ " -s CMD, --shutdown=CMD call CMD to shutdown the computer\n"
+ " --split split edited files at the editing marks (only\n"
+ " useful in conjunction with --edit)\n"
++ " --showargs[=DIR] print the arguments read from DIR and exit\n"
++ " (default: %s)\n"
+ " -t TTY, --terminal=TTY controlling tty\n"
+ " -u USER, --user=USER run as user USER; only applicable if started as\n"
+ " root\n"
+@@ -563,6 +593,7 @@
+ DEFAULTLOCDIR,
+ DEFAULTSVDRPPORT,
+ DEFAULTRESDIR,
++ DEFAULTARGSDIR,
+ DEFAULTVIDEODIR,
+ DEFAULTWATCHDOG
+ );
+@@ -848,6 +879,10 @@
+ alarm(WatchdogTimeout); // Initial watchdog timer start
+ }
+
++#ifdef SDNOTIFY
++ sd_notify(0, "READY=1\nSTATUS=Ready");
++#endif
++
+ // Main program loop:
+
+ #define DELETE_MENU ((IsInfoMenu &= (Menu == NULL)), delete Menu, Menu = NULL)
diff --git a/media-video/vdr/files/vdr-2.0.7_systemd_argsdir_vanilla.patch b/media-video/vdr/files/vdr-2.0.7_systemd_argsdir_vanilla.patch
new file mode 100644
index 000000000000..f7bae16fdd40
--- /dev/null
+++ b/media-video/vdr/files/vdr-2.0.7_systemd_argsdir_vanilla.patch
@@ -0,0 +1,438 @@
+diff -Naur vdr-2.0.7.orig/HISTORY vdr-2.0.7/HISTORY
+--- vdr-2.0.7.orig/HISTORY 2015-01-23 09:07:52.777656645 +0100
++++ vdr-2.0.7/HISTORY 2015-01-23 09:09:57.798647500 +0100
+@@ -7916,6 +7916,16 @@
+ - The APIVERSION has been increased to 2.0.6 due to the changes to pat.h, sdt.h and
+ the functional modification to cFont::CreateFont().
+
++2015-01-18: Version 2.0.6 + backport of systemd support from versions 2.1.6 and 2.1.7
++
++- Added support for systemd (thanks to Christopher Reimer). To activate this you
++ need to add "SDNOTIFY=1" to the 'make' call.
++
++2015-01-18: Version 2.0.6 + backport of reading command line arguments from files, from version 2.1$
++
++- VDR now reads command line options from *.conf files in /etc/vdr/conf.d (thanks
++ to Lars Hanisch). See vdr.1 and vdr.5 for details.
++
+ 2015-01-20: Version 2.0.7
+
+ - Fixed a possible division by zero in frame rate detection.
+diff -Naur vdr-2.0.7.orig/Make.config.template vdr-2.0.7/Make.config.template
+--- vdr-2.0.7.orig/Make.config.template 2015-01-23 09:07:52.765656646 +0100
++++ vdr-2.0.7/Make.config.template 2015-01-23 09:08:15.775654963 +0100
+@@ -38,6 +38,7 @@
+
+ #VIDEODIR = /srv/vdr/video
+ #CONFDIR = /var/lib/vdr
++#ARGSDIR = /etc/vdr/conf.d
+ #CACHEDIR = /var/cache/vdr
+
+ # Overrides for preset/legacy configurations:
+diff -Naur vdr-2.0.7.orig/Makefile vdr-2.0.7/Makefile
+--- vdr-2.0.7.orig/Makefile 2015-01-23 09:07:52.778656645 +0100
++++ vdr-2.0.7/Makefile 2015-01-23 09:11:11.158642134 +0100
+@@ -31,6 +31,7 @@
+ DESTDIR ?=
+ VIDEODIR ?= /srv/vdr/video
+ CONFDIR ?= /var/lib/vdr
++ARGSDIR ?= /etc/vdr/conf.d
+ CACHEDIR ?= /var/cache/vdr
+
+ PREFIX ?= /usr/local
+@@ -66,7 +67,7 @@
+
+ SILIB = $(LSIDIR)/libsi.a
+
+-OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o dvbci.o\
++OBJS = args.o audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o dvbci.o\
+ dvbplayer.o dvbspu.o dvbsubtitle.o eit.o eitscan.o epg.o filter.o font.o i18n.o interface.o keys.o\
+ lirc.o menu.o menuitems.o nit.o osdbase.o osd.o pat.o player.o plugin.o\
+ receiver.o recorder.o recording.o remote.o remux.o ringbuffer.o sdt.o sections.o shutdown.o\
+@@ -93,12 +94,18 @@
+ DEFINES += -DBIDI
+ LIBS += $(shell pkg-config --libs fribidi)
+ endif
++ifdef SDNOTIFY
++INCLUDES += $(shell pkg-config --cflags libsystemd-daemon)
++DEFINES += -DSDNOTIFY
++LIBS += $(shell pkg-config --libs libsystemd-daemon)
++endif
+
+ LIRC_DEVICE ?= /var/run/lirc/lircd
+
+ DEFINES += -DLIRC_DEVICE=\"$(LIRC_DEVICE)\"
+ DEFINES += -DVIDEODIR=\"$(VIDEODIR)\"
+ DEFINES += -DCONFDIR=\"$(CONFDIR)\"
++DEFINES += -DARGSDIR=\"$(ARGSDIR)\"
+ DEFINES += -DCACHEDIR=\"$(CACHEDIR)\"
+ DEFINES += -DRESDIR=\"$(RESDIR)\"
+ DEFINES += -DPLUGINDIR=\"$(LIBDIR)\"
+@@ -143,6 +150,7 @@
+ @echo "mandir=$(MANDIR)" >> $@
+ @echo "configdir=$(CONFDIR)" >> $@
+ @echo "videodir=$(VIDEODIR)" >> $@
++ @echo "argsdir=$(ARGSDIR)" >> $@
+ @echo "cachedir=$(CACHEDIR)" >> $@
+ @echo "resdir=$(RESDIR)" >> $@
+ @echo "libdir=$(LIBDIR)" >> $@
+@@ -260,6 +268,7 @@
+ install-dirs:
+ @mkdir -p $(DESTDIR)$(VIDEODIR)
+ # @mkdir -p $(DESTDIR)$(CONFDIR)
++ @mkdir -p $(DESTDIR)$(ARGSDIR)
+ # @mkdir -p $(DESTDIR)$(CACHEDIR)
+ @mkdir -p $(DESTDIR)$(RESDIR)
+
+diff -Naur vdr-2.0.7.orig/args.c vdr-2.0.7/args.c
+--- vdr-2.0.7.orig/args.c 1970-01-01 01:00:00.000000000 +0100
++++ vdr-2.0.7/args.c 2015-01-23 09:08:15.775654963 +0100
+@@ -0,0 +1,129 @@
++/*
++ * args.c: Read arguments from files
++ *
++ * See the main source file 'vdr.c' for copyright information and
++ * how to reach the author.
++ *
++ * Original version written by Lars Hanisch <dvb@flensrocker.de>.
++ *
++ * $Id$
++ */
++
++#include "args.h"
++#include <unistd.h>
++
++cArgs::cArgs(const char *Argv0)
++{
++ argv0 = Argv0;
++ argc = 0;
++ argv = NULL;
++}
++
++cArgs::~cArgs(void)
++{
++ if (argv != NULL)
++ delete [] argv;
++}
++
++bool cArgs::AddArg(const char *s)
++{
++ if (inVdrSection)
++ args.Append(strdup(s));
++ else if (*lastArg == NULL)
++ return false;
++ else
++ lastArg = cString::sprintf("%s %s", *lastArg, s);
++ return true;
++}
++
++bool cArgs::ReadDirectory(const char *Directory)
++{
++ if (argv != NULL)
++ delete [] argv;
++ argc = 0;
++ argv = NULL;
++ args.Clear();
++ lastArg = NULL;
++ inVdrSection = false;
++ cFileNameList files(Directory, false);
++ if (files.Size() == 0)
++ return false;
++ for (int i = 0; i < files.Size(); i++) {
++ const char *fileName = files.At(i);
++ if (startswith(fileName, ".") || !endswith(fileName, ".conf"))
++ continue;
++ cString fullFileName = AddDirectory(Directory, fileName);
++ struct stat fs;
++ if ((access(*fullFileName, F_OK) != 0) || (stat(*fullFileName, &fs) != 0) || S_ISDIR(fs.st_mode))
++ continue;
++ bool ok = true;
++ int line = 0;
++ FILE *f = fopen(*fullFileName, "r");
++ if (f) {
++ char *s;
++ cReadLine ReadLine;
++ while ((s = ReadLine.Read(f)) != NULL) {
++ line++;
++ s = stripspace(skipspace(s));
++ if (!isempty(s) && (s[0] != '#')) {
++ if (startswith(s, "[") && endswith(s, "]")) {
++ s[strlen(s) - 1] = 0;
++ s++;
++ if (*lastArg) {
++ args.Append(strdup(*lastArg));
++ lastArg = NULL;
++ }
++ if (strcmp(s, "vdr") == 0)
++ inVdrSection = true;
++ else {
++ inVdrSection = false;
++ lastArg = cString::sprintf("--plugin=%s", s);
++ }
++ }
++ else {
++ if ((strlen(s) > 2) && (s[0] == '-') && (s[1] != '-')) { // short option, split at first space
++ char *p = strchr(s, ' ');
++ if (p == NULL) {
++ ok = AddArg(s);
++ if (!ok)
++ break;
++ }
++ else {
++ *p = 0;
++ p++;
++ ok = AddArg(s);
++ if (!ok)
++ break;
++ ok = AddArg(p);
++ if (!ok)
++ break;
++ }
++ }
++ else {
++ ok = AddArg(s);
++ if (!ok)
++ break;
++ }
++ }
++ }
++ }
++ fclose(f);
++ }
++ if (!ok) {
++ esyslog("ERROR: args file %s, line %d", *fullFileName, line);
++ return false;
++ }
++ }
++ if (*lastArg) {
++ args.Append(strdup(*lastArg));
++ lastArg = NULL;
++ }
++ argv = new char*[args.Size() + 1];
++ argv[0] = strdup(*argv0);
++ argc = 1;
++ for (int i = 0; i < args.Size(); i++) {
++ argv[argc] = args.At(i);
++ argc++;
++ }
++ return true;
++}
+diff -Naur vdr-2.0.7.orig/args.h vdr-2.0.7/args.h
+--- vdr-2.0.7.orig/args.h 1970-01-01 01:00:00.000000000 +0100
++++ vdr-2.0.7/args.h 2015-01-23 09:08:15.775654963 +0100
+@@ -0,0 +1,34 @@
++/*
++ * args.h: Read arguments from files
++ *
++ * See the main source file 'vdr.c' for copyright information and
++ * how to reach the author.
++ *
++ * Original version written by Lars Hanisch <dvb@flensrocker.de>.
++ *
++ * $Id$
++ */
++
++#ifndef __ARGS_H
++#define __ARGS_H
++
++#include "tools.h"
++
++class cArgs {
++private:
++ cString argv0;
++ cStringList args;
++ cString lastArg;
++ bool inVdrSection;
++ int argc;
++ char **argv;
++ bool AddArg(const char *s);
++public:
++ cArgs(const char *Argv0);
++ ~cArgs(void);
++ bool ReadDirectory(const char *Directory);
++ int GetArgc(void) const { return argc; };
++ char **GetArgv(void) const { return argv; };
++ };
++
++#endif //__ARGS_H
+diff -Naur vdr-2.0.7.orig/interface.c vdr-2.0.7/interface.c
+--- vdr-2.0.7.orig/interface.c 2015-01-23 09:07:52.765656646 +0100
++++ vdr-2.0.7/interface.c 2015-01-23 09:08:15.775654963 +0100
+@@ -10,6 +10,9 @@
+ #include "interface.h"
+ #include <ctype.h>
+ #include <stdlib.h>
++#ifdef SDNOTIFY
++#include <systemd/sd-daemon.h>
++#endif
+ #include <unistd.h>
+ #include "i18n.h"
+ #include "status.h"
+@@ -159,6 +162,9 @@
+ bool known = Keys.KnowsRemote(Remote->Name());
+ dsyslog("remote control %s - %s", Remote->Name(), known ? "keys known" : "learning keys");
+ if (!known) {
++#ifdef SDNOTIFY
++ sd_notify(0, "READY=1\nSTATUS=Learning keys...");
++#endif
+ cSkinDisplayMenu *DisplayMenu = Skins.Current()->DisplayMenu();
+ DisplayMenu->SetMenuCategory(mcUnknown);
+ char Headline[256];
+diff -Naur vdr-2.0.7.orig/vdr.1 vdr-2.0.7/vdr.1
+--- vdr-2.0.7.orig/vdr.1 2015-01-23 09:07:52.770656646 +0100
++++ vdr-2.0.7/vdr.1 2015-01-23 09:08:15.776654963 +0100
+@@ -178,6 +178,10 @@
+ Read resource files from \fIdir\fR
+ (default is to read them from the config directory).
+ .TP
++.BI \-\-showargs[= dir ]
++Read command line arguments from \fIdir\fR (default is \fI/etc/vdr/conf.d\fR),
++display them to the console and exit.
++.TP
+ .BI \-s\ cmd ,\ \-\-shutdown= cmd
+ Call \fIcmd\fR to shutdown the computer. See the file \fIINSTALL\fR for more
+ information.
+@@ -213,6 +217,10 @@
+ .BI \-w\ sec ,\ \-\-watchdog= sec
+ Activate the watchdog timer with a timeout of \fIsec\fR seconds.
+ A value of \fB0\fR (default) disables the watchdog.
++.P
++If started without any options, vdr tries to read command line options
++from files named '*.conf' in the directory /etc/vdr/conf.d. Files are
++read in alphabetical order. See vdr(5) for details.
+ .SH SIGNALS
+ .TP
+ .B SIGINT, SIGTERM
+diff -Naur vdr-2.0.7.orig/vdr.5 vdr-2.0.7/vdr.5
+--- vdr-2.0.7.orig/vdr.5 2015-01-23 09:07:52.772656646 +0100
++++ vdr-2.0.7/vdr.5 2015-01-23 09:08:15.776654963 +0100
+@@ -889,6 +889,33 @@
+ just 16 bit wide. The internal representation in VDR allows for 32 bit to
+ be used, so that external tools can generate EPG data that is guaranteed
+ not to collide with the ids of existing data.
++.SS COMMANDLINE OPTIONS
++If started without any options, vdr tries to read any files in the directory
++/etc/vdr/conf.d with names that do not begin with a '.' and that end with '.conf'.
++These files are read in alphabetical order. The format of these files is
++
++# comment
++.br
++[name]
++.br
++-a
++.br
++-b 123
++.br
++--long
++.br
++--longarg=123
++.br
++
++Any lines that begin with '#' as the first non-whitespace character are considered
++comments and are ignored.
++A command line option file consists of one or more sections, indicated by '[name]',
++where 'name' is either the fixed word 'vdr' (if this section contains options for
++the main VDR program) or the name of the plugin this section applies to.
++Each option must be written on a separate line, including the leading '-' (for
++a short option) or '--' (for a long option). If the option has additional arguments,
++they have to be written on the same line as the option itself, separated from the
++option with a blank (short option) or equal sign (long option).
+ .SH SEE ALSO
+ .BR vdr (1)
+ .SH AUTHOR
+diff -Naur vdr-2.0.7.orig/vdr.c vdr-2.0.7/vdr.c
+--- vdr-2.0.7.orig/vdr.c 2015-01-23 09:07:52.772656646 +0100
++++ vdr-2.0.7/vdr.c 2015-01-23 09:08:15.776654963 +0100
+@@ -34,8 +34,12 @@
+ #include <stdlib.h>
+ #include <sys/capability.h>
+ #include <sys/prctl.h>
++#ifdef SDNOTIFY
++#include <systemd/sd-daemon.h>
++#endif
+ #include <termios.h>
+ #include <unistd.h>
++#include "args.h"
+ #include "audio.h"
+ #include "channels.h"
+ #include "config.h"
+@@ -186,6 +190,7 @@
+ #define DEFAULTWATCHDOG 0 // seconds
+ #define DEFAULTVIDEODIR VIDEODIR
+ #define DEFAULTCONFDIR dd(CONFDIR, VideoDirectory)
++#define DEFAULTARGSDIR dd(ARGSDIR, "/etc/vdr/conf.d")
+ #define DEFAULTCACHEDIR dd(CACHEDIR, VideoDirectory)
+ #define DEFAULTRESDIR dd(RESDIR, ConfigDirectory)
+ #define DEFAULTPLUGINDIR PLUGINDIR
+@@ -223,6 +228,15 @@
+ VdrUser = VDR_USER;
+ #endif
+
++ cArgs *Args = NULL;
++ if (argc == 1) {
++ Args = new cArgs(argv[0]);
++ if (Args->ReadDirectory(DEFAULTARGSDIR)) {
++ argc = Args->GetArgc();
++ argv = Args->GetArgv();
++ }
++ }
++
+ SetVideoDirectory(VideoDirectory);
+ cPluginManager PluginManager(DEFAULTPLUGINDIR);
+
+@@ -250,6 +264,7 @@
+ { "port", required_argument, NULL, 'p' },
+ { "record", required_argument, NULL, 'r' },
+ { "resdir", required_argument, NULL, 'r' | 0x100 },
++ { "showargs", optional_argument, NULL, 's' | 0x200 },
+ { "shutdown", required_argument, NULL, 's' },
+ { "split", no_argument, NULL, 's' | 0x100 },
+ { "terminal", required_argument, NULL, 't' },
+@@ -422,6 +437,19 @@
+ case 's' | 0x100:
+ Setup.SplitEditedFiles = 1;
+ break;
++ case 's' | 0x200: {
++ const char *ArgsDir = optarg ? optarg : DEFAULTARGSDIR;
++ cArgs Args(argv[0]);
++ if (!Args.ReadDirectory(ArgsDir)) {
++ fprintf(stderr, "vdr: can't read arguments from directory: %s\n", ArgsDir);
++ return 2;
++ }
++ int c = Args.GetArgc();
++ char **v = Args.GetArgv();
++ for (int i = 1; i < c; i++)
++ printf("%s\n", v[i]);
++ return 0;
++ }
+ case 't': Terminal = optarg;
+ if (access(Terminal, R_OK | W_OK) < 0) {
+ fprintf(stderr, "vdr: can't access terminal: %s\n", Terminal);
+@@ -535,6 +563,8 @@
+ " -s CMD, --shutdown=CMD call CMD to shutdown the computer\n"
+ " --split split edited files at the editing marks (only\n"
+ " useful in conjunction with --edit)\n"
++ " --showargs[=DIR] print the arguments read from DIR and exit\n"
++ " (default: %s)\n"
+ " -t TTY, --terminal=TTY controlling tty\n"
+ " -u USER, --user=USER run as user USER; only applicable if started as\n"
+ " root\n"
+@@ -557,6 +587,7 @@
+ DEFAULTLOCDIR,
+ DEFAULTSVDRPPORT,
+ DEFAULTRESDIR,
++ DEFAULTARGSDIR,
+ DEFAULTVIDEODIR,
+ DEFAULTWATCHDOG
+ );
+@@ -837,6 +868,10 @@
+ alarm(WatchdogTimeout); // Initial watchdog timer start
+ }
+
++#ifdef SDNOTIFY
++ sd_notify(0, "READY=1\nSTATUS=Ready");
++#endif
++
+ // Main program loop:
+
+ #define DELETE_MENU ((IsInfoMenu &= (Menu == NULL)), delete Menu, Menu = NULL)
diff --git a/media-video/vdr/files/vdr-2.2.0_gentoo.patch b/media-video/vdr/files/vdr-2.2.0_gentoo.patch
new file mode 100644
index 000000000000..37ffd3c7b2ca
--- /dev/null
+++ b/media-video/vdr/files/vdr-2.2.0_gentoo.patch
@@ -0,0 +1,70 @@
+diff -Naur vdr-2.1.7.orig/Makefile vdr-2.1.7/Makefile
+--- vdr-2.1.7.orig/Makefile 2015-01-18 12:37:45.506034673 +0100
++++ vdr-2.1.7/Makefile 2015-01-18 12:38:34.086037162 +0100
+@@ -116,7 +116,7 @@
+ VDRVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
+ APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
+
+-all: vdr i18n plugins
++all: vdr i18n
+
+ # Implicit rules:
+
+@@ -170,7 +170,7 @@
+
+ PODIR = po
+ LOCALEDIR = locale
+-I18Npo = $(wildcard $(PODIR)/*.po)
++I18Npo = $(foreach dir,$(LINGUAS),$(wildcard $(PODIR)/$(dir)*.po))
+ I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
+ I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr.mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
+ I18Npot = $(PODIR)/vdr.pot
+@@ -193,7 +193,7 @@
+
+ install-i18n: i18n
+ @mkdir -p $(DESTDIR)$(LOCDIR)
+- cp -r $(LOCALEDIR)/* $(DESTDIR)$(LOCDIR)
++ @(cd $(LOCALEDIR); for linguas in $(LINGUAS); do [ "$$linguas" = "en" ] && continue; cp -r --parents $$linguas* $(DESTDIR)$(LOCDIR); done)
+
+ # The 'include' directory (for plugins):
+
+@@ -255,7 +255,7 @@
+
+ # Install the files (note that 'install-pc' must be first!):
+
+-install: install-pc install-bin install-dirs install-conf install-doc install-plugins install-i18n install-includes
++install: install-pc install-bin install-dirs install-conf install-doc install-i18n install-includes
+
+ # VDR binary:
+
+@@ -267,12 +267,13 @@
+
+ install-dirs:
+ @mkdir -p $(DESTDIR)$(VIDEODIR)
+- @mkdir -p $(DESTDIR)$(CONFDIR)
+- @mkdir -p $(DESTDIR)$(ARGSDIR)
+- @mkdir -p $(DESTDIR)$(CACHEDIR)
++# @mkdir -p $(DESTDIR)$(CONFDIR)
++# @mkdir -p $(DESTDIR)$(ARGSDIR)
++# @mkdir -p $(DESTDIR)$(CACHEDIR)
+ @mkdir -p $(DESTDIR)$(RESDIR)
+
+ install-conf:
++ @mkdir -p $(DESTDIR)$(CONFDIR)
+ @cp -pn *.conf $(DESTDIR)$(CONFDIR)
+
+ # Documentation:
+@@ -299,8 +300,11 @@
+ # Includes:
+
+ install-includes: include-dir
+- @mkdir -p $(DESTDIR)$(INCDIR)
+- @cp -pLR include/vdr include/libsi $(DESTDIR)$(INCDIR)
++# @mkdir -p $(DESTDIR)$(INCDIR)
++# @cp -pLR include/vdr include/libsi $(DESTDIR)$(INCDIR)
++ @mkdir -p $(DESTDIR)$(INCDIR)/vdr $(DESTDIR)$(INCDIR)/vdr/libsi
++ @cp -pLR include/vdr $(DESTDIR)$(INCDIR)
++ @cp -pLR include/libsi Make.config $(DESTDIR)$(INCDIR)/vdr
+
+ # pkg-config file:
+
diff --git a/media-video/vdr/metadata.xml b/media-video/vdr/metadata.xml
new file mode 100644
index 000000000000..21e13471eada
--- /dev/null
+++ b/media-video/vdr/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>vdr@gentoo.org</email>
+ <name>Gentoo VDR Project</name>
+ </maintainer>
+ <use>
+ <flag name="alternatechannel">Use alternate channel on record</flag>
+ <flag name="bidi">fribidi support, for languages, written from right to left</flag>
+ <flag name="ddepgentry">remove duplicate EPG entries</flag>
+ <flag name="dvlvidprefer">controls video-dir choice on recording</flag>
+ <flag name="graphtft">support for <pkg>media-plugins/vdr-graphtft</pkg>plugin up from version 0.1.7</flag>
+ <flag name="html">Install HTML documentation</flag>
+ <flag name="jumpplay">Enables automatic jumping over cut marks while watching a recording</flag>
+ <flag name="jumpingseconds">skip seconds in played records</flag>
+ <flag name="kbd">enable keyboard support as remote device</flag>
+ <flag name="mainmenuhooks">Allows to replace main menu entries by some special plugins (like epgsearch, extrecmenu, ...)</flag>
+ <flag name="menuorg">Enables support for the <pkg>media-plugins/vdr-menuorg</pkg></flag>
+ <flag name="menuselection">adds support for menu hotkeys of double digits</flag>
+ <flag name="naludump">Removes NALU fill data from h.264-Streams of TS files</flag>
+ <flag name="permashift">permanent timeshift by recording live TV on hard disk, need plugin <pkg>media-plugins/vdr-permashift</pkg></flag>
+ <flag name="permashift_v1">permanent timeshift by recording live TV on RAM, need plugin &gt;=mediaplugins/vdr-permashift-1</flag>
+ <flag name="pinplugin">Support for <pkg>media-plugins/vdr-pin</pkg></flag>
+ <flag name="resumereset">rreset resume of EOF</flag>
+ <flag name="rotor">Enable support for plugin <pkg>media-plugins/vdr-rotor</pkg> for dish-positioner.</flag>
+ <flag name="ttxtsubs">support for <pkg>media-plugins/vdr-ttxtsubs</pkg></flag>
+ <flag name="vasarajanauloja">replacement for the liemikuutio patch, adds some nice must haves features</flag>
+ <flag name="wareagleicon">Replace original icon set in menu</flag>
+ <flag name="yaepg">Enables support for the vdr-yaepg plugin</flag>
+ </use>
+</pkgmetadata>
diff --git a/media-video/vdr/vdr-2.0.6-r1.ebuild b/media-video/vdr/vdr-2.0.6-r1.ebuild
new file mode 100644
index 000000000000..63de150c12f6
--- /dev/null
+++ b/media-video/vdr/vdr-2.0.6-r1.ebuild
@@ -0,0 +1,277 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+# Switches supported by extensions-patch
+EXT_PATCH_FLAGS="alternatechannel ddepgentry dvlvidprefer graphtft
+ jumpplay jumpingseconds mainmenuhooks menuorg naludump permashift permashift_v1
+ pinplugin rotor ttxtsubs vasarajanauloja wareagleicon yaepg"
+
+# names of the use-flags
+EXT_PATCH_FLAGS_RENAMED=""
+
+# names ext-patch uses internally, here only used for maintainer checks
+EXT_PATCH_FLAGS_RENAMED_EXT_NAME=""
+
+IUSE="bidi debug html vanilla ${EXT_PATCH_FLAGS} ${EXT_PATCH_FLAGS_RENAMED}"
+
+MY_PV="${PV%_p*}"
+MY_P="${PN}-${MY_PV}"
+S="${WORKDIR}/${MY_P}"
+
+EXT_P="extpng-${P}-gentoo-edition-v6"
+
+DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB"
+HOMEPAGE="http://www.tvdr.de/"
+SRC_URI="ftp://ftp.tvdr.de/vdr/${MY_P}.tar.bz2
+ https://dev.gentoo.org/~hd_brummy/distfiles/${EXT_P}.patch.bz2"
+
+KEYWORDS="amd64 ~arm ~ppc x86"
+SLOT="0"
+LICENSE="GPL-2"
+
+REQUIRED_USE="
+ permashift? ( !permashift_v1 )
+ permashift_v1? ( !permashift )"
+
+COMMON_DEPEND="virtual/jpeg:*
+ sys-libs/libcap
+ >=media-libs/fontconfig-2.4.2
+ >=media-libs/freetype-2"
+
+DEPEND="${COMMON_DEPEND}
+ >=virtual/linuxtv-dvb-headers-5.3
+ sys-devel/gettext"
+
+RDEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ >=media-tv/gentoo-vdr-scripts-2.5_rc1
+ media-fonts/corefonts
+ bidi? ( dev-libs/fribidi )"
+
+CONF_DIR=/etc/vdr
+CAP_FILE=${S}/capabilities.sh
+CAPS="# Capabilities of the vdr-executable for use by startscript etc."
+
+pkg_setup() {
+ use debug && append-flags -g
+
+ PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
+
+ tc-export CC CXX AR
+}
+
+add_cap() {
+ local arg
+ for arg; do
+ CAPS="${CAPS}\n${arg}=1"
+ done
+}
+
+enable_patch() {
+ local arg ARG_UPPER
+ for arg; do
+ ARG_UPPER=$(echo $arg|tr '[:lower:]' '[:upper:]')
+ echo "${ARG_UPPER} = 1" >> Make.config
+
+ # codesnippet to bring the extpng defines into the vdr.pc CXXFLAGS CFLAGS
+ echo "-DUSE_${ARG_UPPER}" >> "${T}"/defines.tmp
+ cat "${T}"/defines.tmp | tr \\\012 ' ' > "${T}"/defines.IUSE
+ export DEFINES_IUSE=$( cat ${T}/defines.IUSE )
+ done
+}
+
+extensions_add_make_conf()
+{
+ # copy all ifdef for extensions-patch to Make.config
+ sed -e '1,/need to touch the following:/d' \
+ -e '/need to touch the following/,/^$/d' \
+ Make.config.template >> Make.config
+}
+
+extensions_all_defines() {
+ # extract all possible settings for extensions-patch
+ sed -e '/^#\?[A-Z].*= 1/!d' -e 's/^#\?//' -e 's/ .*//' \
+ Make.config.template \
+ | sort \
+ | tr '[:upper:]' '[:lower:]'
+}
+
+lang_po() {
+ LING_PO=$( ls ${S}/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
+}
+
+src_prepare() {
+ # apply maintainace-patches
+ ebegin "Changing paths for gentoo"
+
+ local DVBDIR=/usr/include
+ local i
+ for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do
+ [[ -d ${i} ]] || continue
+ if [[ -f ${i}/linux/dvb/dmx.h ]]; then
+ einfo "Found DVB header files in ${i}"
+ DVBDIR=${i}
+ break
+ fi
+ done
+
+ # checking for s2api headers
+ local api_version
+ api_version=$(awk -F' ' '/define DVB_API_VERSION / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
+ api_version=${api_version}*$(awk -F' ' '/define DVB_API_VERSION_MINOR / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
+
+ if [[ ${api_version:-0} -lt 5*3 ]]; then
+ eerror "DVB header files do not contain s2api support or too old for ${P}"
+ eerror "You cannot compile VDR against old dvb-header"
+ die "DVB headers too old"
+ fi
+
+ cat > Make.config <<-EOT
+ #
+ # Generated by ebuild ${PF}
+ #
+ PREFIX = /usr
+ DVBDIR = ${DVBDIR}
+ PLUGINLIBDIR = ${PLUGIN_LIBDIR}
+ CONFDIR = ${CONF_DIR}
+ VIDEODIR = /var/vdr/video
+ LOCDIR = \$(PREFIX)/share/locale
+ INCDIR = \$(PREFIX)/include
+
+ DEFINES += -DCONFDIR=\"\$(CONFDIR)\"
+ INCLUDES += -I\$(DVBDIR)
+
+ # >=vdr-1.7.36-r1; parameter only used for compiletime on vdr
+ # PLUGINLIBDIR (plugin Makefile old) = LIBDIR (plugin Makefile new)
+ LIBDIR = ${PLUGIN_LIBDIR}
+ PCDIR = /usr/$(get_libdir)/pkgconfig
+ EOT
+ eend 0
+
+ # support languages, written from right to left
+ BUILD_PARAMS+=" BIDI=$(usex bidi 1 0)"
+
+ epatch "${FILESDIR}/${PN}-2.0.6_gentoo.patch"
+
+ if ! use vanilla; then
+
+ # Now apply extensions patch
+ epatch "${WORKDIR}/${EXT_P}.patch"
+
+ # This allows us to start even if some plugin does not exist
+ # or is not loadable.
+ enable_patch PLUGINMISSING
+ enable_patch CHANNELBIND
+
+ if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
+ einfo "Doing maintainer checks:"
+
+ # we do not support these patches
+ # (or have them already hard enabled)
+ local IGNORE_PATCHES="pluginmissing channelbind"
+
+ extensions_all_defines > "${T}"/new.IUSE
+ echo $EXT_PATCH_FLAGS $EXT_PATCH_FLAGS_RENAMED_EXT_NAME \
+ $IGNORE_PATCHES | \
+ tr ' ' '\n' |sort > "${T}"/old.IUSE
+ local DIFFS=$(diff -u "${T}"/old.IUSE "${T}"/new.IUSE|grep '^[+-][^+-]')
+ if [[ -z ${DIFFS} ]]; then
+ einfo "EXT_PATCH_FLAGS is up to date."
+ else
+ ewarn "IUSE differences!"
+ local diff
+ for diff in $DIFFS; do
+ ewarn "$diff"
+ done
+ fi
+ fi
+
+ ebegin "Enabling selected patches"
+ local flag
+ for flag in $EXT_PATCH_FLAGS; do
+ use $flag && enable_patch ${flag}
+ done
+
+ eend 0
+
+ extensions_add_make_conf
+
+ # add defined use-flags compile options to vdr.pc
+ sed -e "s:\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR):\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR) \$(DEFINES_IUSE):" \
+ -i Makefile
+
+ ebegin "Make depend"
+ emake .dependencies >/dev/null
+ eend $? "make depend failed"
+ fi
+
+ epatch_user
+
+ add_cap CAP_UTF8
+
+ add_cap CAP_IRCTRL_RUNTIME_PARAM \
+ CAP_VFAT_RUNTIME_PARAM \
+ CAP_CHUID \
+ CAP_SHUTDOWN_AUTO_RETRY
+
+ echo -e ${CAPS} > "${CAP_FILE}"
+
+ # LINGUAS support
+ einfo "\n \t VDR supports the LINGUAS values"
+
+ lang_po
+
+ einfo "\t Please set one of this values in your sytem make.conf"
+ einfo "\t LINGUAS=\"${LING_PO}\"\n"
+
+ if [[ -z ${LINGUAS} ]]; then
+ einfo "\n \t No values in LINGUAS="
+ einfo "\t You will get only english text on OSD \n"
+ fi
+
+ strip-linguas ${LING_PO} en
+}
+
+src_install() {
+# # trick makefile not to create a videodir by supplying it with an existing
+# # directory
+ emake \
+ VIDEODIR="/" \
+ DESTDIR="${D}" install || die "emake install failed"
+
+ keepdir "${PLUGIN_LIBDIR}"
+
+ keepdir "${CONF_DIR}"/plugins
+ keepdir "${CONF_DIR}"/themes
+
+ if use html; then
+ dohtml *.html
+ fi
+
+ dodoc MANUAL INSTALL README* HISTORY CONTRIBUTORS
+
+ insinto /usr/share/vdr
+ doins "${CAP_FILE}"
+
+ if use alternatechannel; then
+ insinto /etc/vdr
+ doins "${FILESDIR}"/channel_alternative.conf
+ fi
+
+ chown -R vdr:vdr "${D}/${CONF_DIR}"
+}
+
+pkg_postinst() {
+ elog "It is a good idea to run vdrplugin-rebuild now."
+
+ elog "To get nice symbols in OSD we recommend to install"
+ elog "\t1. emerge media-fonts/vdrsymbols-ttf"
+ elog "\t2. select font VDRSymbolsSans in Setup"
+ elog ""
+ elog "To get an idea how to proceed now, have a look at our vdr-guide:"
+ elog "\thttps://wiki.gentoo.org/wiki/VDR"
+}
diff --git a/media-video/vdr/vdr-2.0.7.ebuild b/media-video/vdr/vdr-2.0.7.ebuild
new file mode 100644
index 000000000000..f5d9d5ed815d
--- /dev/null
+++ b/media-video/vdr/vdr-2.0.7.ebuild
@@ -0,0 +1,288 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+# Switches supported by extensions-patch
+EXT_PATCH_FLAGS="alternatechannel ddepgentry dvlvidprefer graphtft
+ jumpplay jumpingseconds mainmenuhooks menuorg naludump permashift permashift_v1
+ pinplugin rotor ttxtsubs vasarajanauloja wareagleicon yaepg"
+
+# names of the use-flags
+EXT_PATCH_FLAGS_RENAMED=""
+
+# names ext-patch uses internally, here only used for maintainer checks
+EXT_PATCH_FLAGS_RENAMED_EXT_NAME=""
+
+IUSE="bidi debug html systemd vanilla ${EXT_PATCH_FLAGS} ${EXT_PATCH_FLAGS_RENAMED}"
+
+MY_PV="${PV%_p*}"
+MY_P="${PN}-${MY_PV}"
+S="${WORKDIR}/${MY_P}"
+
+EXT_P="extpng-${PN}-2.0.6-gentoo-edition-v6"
+
+DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB"
+HOMEPAGE="http://www.tvdr.de/"
+SRC_URI="ftp://ftp.tvdr.de/vdr/${MY_P}.tar.bz2
+ https://dev.gentoo.org/~hd_brummy/distfiles/${EXT_P}.patch.bz2"
+
+KEYWORDS="~arm ~amd64 ~ppc ~x86"
+SLOT="0"
+LICENSE="GPL-2"
+
+REQUIRED_USE="
+ permashift? ( !permashift_v1 )
+ permashift_v1? ( !permashift )"
+
+COMMON_DEPEND="virtual/jpeg:*
+ sys-libs/libcap
+ >=media-libs/fontconfig-2.4.2
+ >=media-libs/freetype-2"
+
+DEPEND="${COMMON_DEPEND}
+ >=virtual/linuxtv-dvb-headers-5.3
+ sys-devel/gettext"
+
+RDEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ >=media-tv/gentoo-vdr-scripts-2.5
+ media-fonts/corefonts
+ bidi? ( dev-libs/fribidi )
+ systemd? ( sys-apps/systemd )"
+
+CONF_DIR=/etc/vdr
+CAP_FILE=${S}/capabilities.sh
+CAPS="# Capabilities of the vdr-executable for use by startscript etc."
+
+pkg_setup() {
+ use debug && append-flags -g
+
+ PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
+
+ tc-export CC CXX AR
+}
+
+add_cap() {
+ local arg
+ for arg; do
+ CAPS="${CAPS}\n${arg}=1"
+ done
+}
+
+enable_patch() {
+ local arg ARG_UPPER
+ for arg; do
+ ARG_UPPER=$(echo $arg|tr '[:lower:]' '[:upper:]')
+ echo "${ARG_UPPER} = 1" >> Make.config
+
+ # codesnippet to bring the extpng defines into the vdr.pc CXXFLAGS CFLAGS
+ echo "-DUSE_${ARG_UPPER}" >> "${T}"/defines.tmp
+ cat "${T}"/defines.tmp | tr \\\012 ' ' > "${T}"/defines.IUSE
+ export DEFINES_IUSE=$( cat ${T}/defines.IUSE )
+ done
+}
+
+extensions_add_make_conf()
+{
+ # copy all ifdef for extensions-patch to Make.config
+ sed -e '1,/need to touch the following:/d' \
+ -e '/need to touch the following/,/^$/d' \
+ Make.config.template >> Make.config
+}
+
+extensions_all_defines() {
+ # extract all possible settings for extensions-patch
+ sed -e '/^#\?[A-Z].*= 1/!d' -e 's/^#\?//' -e 's/ .*//' \
+ Make.config.template \
+ | sort \
+ | tr '[:upper:]' '[:lower:]'
+}
+
+lang_po() {
+ LING_PO=$( ls ${S}/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
+}
+
+src_prepare() {
+ # apply maintainace-patches
+ ebegin "Changing paths for gentoo"
+
+ local DVBDIR=/usr/include
+ local i
+ for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do
+ [[ -d ${i} ]] || continue
+ if [[ -f ${i}/linux/dvb/dmx.h ]]; then
+ einfo "Found DVB header files in ${i}"
+ DVBDIR=${i}
+ break
+ fi
+ done
+
+ # checking for s2api headers
+ local api_version
+ api_version=$(awk -F' ' '/define DVB_API_VERSION / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
+ api_version=${api_version}*$(awk -F' ' '/define DVB_API_VERSION_MINOR / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
+
+ if [[ ${api_version:-0} -lt 5*3 ]]; then
+ eerror "DVB header files do not contain s2api support or too old for ${P}"
+ eerror "You cannot compile VDR against old dvb-header"
+ die "DVB headers too old"
+ fi
+
+ cat > Make.config <<-EOT
+ #
+ # Generated by ebuild ${PF}
+ #
+ PREFIX = /usr
+ DVBDIR = ${DVBDIR}
+ PLUGINLIBDIR = ${PLUGIN_LIBDIR}
+ CONFDIR = ${CONF_DIR}
+ VIDEODIR = /var/vdr/video
+ LOCDIR = \$(PREFIX)/share/locale
+ INCDIR = \$(PREFIX)/include
+
+ DEFINES += -DCONFDIR=\"\$(CONFDIR)\"
+ INCLUDES += -I\$(DVBDIR)
+
+ # >=vdr-1.7.36-r1; parameter only used for compiletime on vdr
+ # PLUGINLIBDIR (plugin Makefile old) = LIBDIR (plugin Makefile new)
+ LIBDIR = ${PLUGIN_LIBDIR}
+ PCDIR = /usr/$(get_libdir)/pkgconfig
+ EOT
+ eend 0
+
+ # support languages, written from right to left
+ BUILD_PARAMS+=" BIDI=$(usex bidi 1 0)"
+
+ # systemd support
+ use systemd && BUILD_PARAMS+=" SDNOTIFY=$(usex systemd 1 0)"
+
+ if ! use vanilla; then
+
+ # Now apply extensions patch
+ epatch "${WORKDIR}/${EXT_P}.patch"
+
+ # This allows us to start even if some plugin does not exist
+ # or is not loadable.
+ enable_patch PLUGINMISSING
+ enable_patch CHANNELBIND
+
+ if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
+ einfo "Doing maintainer checks:"
+
+ # we do not support these patches
+ # (or have them already hard enabled)
+ local IGNORE_PATCHES="pluginmissing channelbind"
+
+ extensions_all_defines > "${T}"/new.IUSE
+ echo $EXT_PATCH_FLAGS $EXT_PATCH_FLAGS_RENAMED_EXT_NAME \
+ $IGNORE_PATCHES | \
+ tr ' ' '\n' |sort > "${T}"/old.IUSE
+ local DIFFS=$(diff -u "${T}"/old.IUSE "${T}"/new.IUSE|grep '^[+-][^+-]')
+ if [[ -z ${DIFFS} ]]; then
+ einfo "EXT_PATCH_FLAGS is up to date."
+ else
+ ewarn "IUSE differences!"
+ local diff
+ for diff in $DIFFS; do
+ ewarn "$diff"
+ done
+ fi
+ fi
+
+ ebegin "Enabling selected patches"
+ local flag
+ for flag in $EXT_PATCH_FLAGS; do
+ use $flag && enable_patch ${flag}
+ done
+
+ eend 0
+
+ extensions_add_make_conf
+
+ # add defined use-flags compile options to vdr.pc
+ sed -e "s:\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR):\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR) \$(DEFINES_IUSE):" \
+ -i Makefile
+
+ ebegin "Make depend"
+ emake .dependencies >/dev/null
+ eend $? "make depend failed"
+ fi
+
+ epatch "${FILESDIR}/${PN}-2.0.6-r2_gentoo.patch"
+
+ # backport from vdr-2.1.7 for better systemd support
+ if use vanilla; then
+ epatch "${FILESDIR}/${P}_systemd_argsdir_vanilla.patch"
+ else
+ epatch "${FILESDIR}/${P}_systemd_argsdir.patch"
+ fi
+
+ epatch_user
+
+ add_cap CAP_UTF8
+
+ add_cap CAP_IRCTRL_RUNTIME_PARAM \
+ CAP_VFAT_RUNTIME_PARAM \
+ CAP_CHUID \
+ CAP_SHUTDOWN_AUTO_RETRY
+
+ echo -e ${CAPS} > "${CAP_FILE}"
+
+ # LINGUAS support
+ einfo "\n \t VDR supports the LINGUAS values"
+
+ lang_po
+
+ einfo "\t Please set one of this values in your sytem make.conf"
+ einfo "\t LINGUAS=\"${LING_PO}\"\n"
+
+ if [[ -z ${LINGUAS} ]]; then
+ einfo "\n \t No values in LINGUAS="
+ einfo "\t You will get only english text on OSD \n"
+ fi
+
+ strip-linguas ${LING_PO} en
+}
+
+src_install() {
+# # trick makefile not to create a videodir by supplying it with an existing
+# # directory
+ emake \
+ VIDEODIR="/" \
+ DESTDIR="${D}" install || die "emake install failed"
+
+ keepdir "${PLUGIN_LIBDIR}"
+
+ # backup for plugins they don't be able to create this dir
+ keepdir "${CONF_DIR}"/plugins
+
+ if use html; then
+ dohtml *.html
+ fi
+
+ dodoc MANUAL INSTALL README* HISTORY CONTRIBUTORS
+
+ insinto /usr/share/vdr
+ doins "${CAP_FILE}"
+
+ if use alternatechannel; then
+ insinto /etc/vdr
+ doins "${FILESDIR}"/channel_alternative.conf
+ fi
+
+ chown -R vdr:vdr "${D}/${CONF_DIR}"
+}
+
+pkg_postinst() {
+ elog "It is a good idea to run vdrplugin-rebuild now."
+
+ elog "To get nice symbols in OSD we recommend to install"
+ elog "\t1. emerge media-fonts/vdrsymbols-ttf"
+ elog "\t2. select font VDRSymbolsSans in Setup"
+ elog ""
+ elog "To get an idea how to proceed now, have a look at our vdr-guide:"
+ elog "\thttps://wiki.gentoo.org/wiki/VDR"
+}
diff --git a/media-video/vdr/vdr-2.2.0-r1.ebuild b/media-video/vdr/vdr-2.2.0-r1.ebuild
new file mode 100644
index 000000000000..ce73df6b100e
--- /dev/null
+++ b/media-video/vdr/vdr-2.2.0-r1.ebuild
@@ -0,0 +1,299 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+#inherit eutils flag-o-matic multilib toolchain-funcs
+inherit flag-o-matic toolchain-funcs
+
+# Switches supported by extensions-patch
+EXT_PATCH_FLAGS="alternatechannel graphtft naludump permashift_v1 pinplugin
+ mainmenuhooks menuorg menuselection resumereset ttxtsubs"
+
+# names of the use-flags
+EXT_PATCH_FLAGS_RENAMED=""
+
+# names ext-patch uses internally, here only used for maintainer checks
+EXT_PATCH_FLAGS_RENAMED_EXT_NAME="bidi no_kbd sdnotify"
+
+IUSE="bidi debug +kbd html systemd vanilla ${EXT_PATCH_FLAGS} ${EXT_PATCH_FLAGS_RENAMED}"
+
+MY_PV="${PV%_p*}"
+MY_P="${PN}-${MY_PV}"
+S="${WORKDIR}/${MY_P}"
+
+EXT_P="extpng-${P}-gentoo-edition-v1"
+
+DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB"
+HOMEPAGE="http://www.tvdr.de/"
+SRC_URI="ftp://ftp.tvdr.de/vdr/${MY_P}.tar.bz2
+ https://dev.gentoo.org/~hd_brummy/distfiles/${EXT_P}.patch.bz2"
+
+KEYWORDS="amd64 ~arm ~arm64 ~ppc x86"
+SLOT="0"
+LICENSE="GPL-2"
+
+COMMON_DEPEND="virtual/jpeg:*
+ sys-libs/libcap
+ >=media-libs/fontconfig-2.4.2
+ >=media-libs/freetype-2"
+
+DEPEND="${COMMON_DEPEND}
+ >=virtual/linuxtv-dvb-headers-5.3
+ sys-devel/gettext"
+
+RDEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ >=media-tv/gentoo-vdr-scripts-2.7
+ media-fonts/corefonts
+ bidi? ( dev-libs/fribidi )
+ systemd? ( sys-apps/systemd )"
+
+CONF_DIR=/etc/vdr
+CAP_FILE=${S}/capabilities.sh
+CAPS="# Capabilities of the vdr-executable for use by startscript etc."
+
+pkg_setup() {
+
+ use debug && append-flags -g
+
+ PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
+
+ tc-export CC CXX AR
+}
+
+add_cap() {
+ local arg
+ for arg; do
+ CAPS="${CAPS}\n${arg}=1"
+ done
+}
+
+enable_patch() {
+ local arg ARG_UPPER
+ for arg; do
+ ARG_UPPER=$(echo $arg|tr '[:lower:]' '[:upper:]')
+ echo "${ARG_UPPER} = 1" >> Make.config
+
+ # codesnippet to bring the extpng defines into the vdr.pc CXXFLAGS CFLAGS
+ echo "-DUSE_${ARG_UPPER}" >> "${T}"/defines.tmp
+ cat "${T}"/defines.tmp | tr \\\012 ' ' > "${T}"/defines.IUSE
+ export DEFINES_IUSE=$( cat ${T}/defines.IUSE )
+ done
+}
+
+extensions_add_make_conf()
+{
+ # copy all ifdef for extensions-patch to Make.config
+ sed -e '1,/need to touch the following:/d' \
+ -e '/need to touch the following/,/^$/d' \
+ Make.config.template >> Make.config
+}
+
+extensions_all_defines() {
+ # extract all possible settings for extensions-patch
+ sed -e '/^#\?[A-Z].*= 1/!d' -e 's/^#\?//' -e 's/ .*//' \
+ Make.config.template \
+ | sort \
+ | tr '[:upper:]' '[:lower:]'
+}
+
+lang_po() {
+ LING_PO=$( ls ${S}/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
+}
+
+src_configure() {
+ # support languages, written from right to left
+ export "BIDI=$(usex bidi 1 0)"
+ # systemd notification support
+ export "SDNOTIFY=$(usex systemd 1 0)"
+ # with/without keyboard
+ export "USE_KBD=$(usex kbd 1 0)"
+}
+
+src_prepare() {
+ # apply maintainace-patches
+ ebegin "Changing paths for gentoo"
+
+ local DVBDIR=/usr/include
+ local i
+ for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do
+ [[ -d ${i} ]] || continue
+ if [[ -f ${i}/linux/dvb/dmx.h ]]; then
+ einfo "Found DVB header files in ${i}"
+ DVBDIR=${i}
+ break
+ fi
+ done
+
+ # checking for s2api headers
+ local api_version
+ api_version=$(awk -F' ' '/define DVB_API_VERSION / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
+ api_version=${api_version}*$(awk -F' ' '/define DVB_API_VERSION_MINOR / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
+
+ if [[ ${api_version:-0} -lt 5*3 ]]; then
+ eerror "DVB header files do not contain s2api support or too old for ${P}"
+ eerror "You cannot compile VDR against old dvb-header"
+ die "DVB headers too old"
+ fi
+
+ cat > Make.config <<-EOT
+ #
+ # Generated by ebuild ${PF}
+ #
+ PREFIX = /usr
+ DVBDIR = ${DVBDIR}
+ PLUGINLIBDIR = ${PLUGIN_LIBDIR}
+ CONFDIR = ${CONF_DIR}
+ VIDEODIR = /var/vdr/video
+ LOCDIR = \$(PREFIX)/share/locale
+ INCDIR = \$(PREFIX)/include
+
+ DEFINES += -DCONFDIR=\"\$(CONFDIR)\"
+ INCLUDES += -I\$(DVBDIR)
+
+ # >=vdr-1.7.36-r1; parameter only used for compiletime on vdr
+ # PLUGINLIBDIR (plugin Makefile old) = LIBDIR (plugin Makefile new)
+ LIBDIR = ${PLUGIN_LIBDIR}
+ PCDIR = /usr/$(get_libdir)/pkgconfig
+
+ EOT
+ eend 0
+
+ # wrt bug 586070
+ if has_version ">=sys-apps/systemd-230"; then
+ sed -e "s:libsystemd-daemon:libsystemd:g" -i Makefile || die "sed libsystemd failed"
+ fi
+
+ if ! use vanilla; then
+
+ # Now apply extensions patch
+ eapply "${WORKDIR}/${EXT_P}.patch"
+
+ # This allows us to start even if some plugin does not exist
+ # or is not loadable.
+ enable_patch PLUGINMISSING
+
+ if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
+ einfo "Doing maintainer checks:"
+
+ # we do not support these patches
+ # (or have them already hard enabled)
+ local IGNORE_PATCHES="pluginmissing"
+
+ extensions_all_defines > "${T}"/new.IUSE
+ echo $EXT_PATCH_FLAGS $EXT_PATCH_FLAGS_RENAMED_EXT_NAME \
+ $IGNORE_PATCHES | \
+ tr ' ' '\n' |sort > "${T}"/old.IUSE
+ local DIFFS=$(diff -u "${T}"/old.IUSE "${T}"/new.IUSE|grep '^[+-][^+-]')
+ if [[ -z ${DIFFS} ]]; then
+ einfo "EXT_PATCH_FLAGS is up to date."
+ else
+ ewarn "IUSE differences!"
+ local diff
+ for diff in $DIFFS; do
+ ewarn "$diff"
+ done
+ fi
+ fi
+
+ ebegin "Enabling selected patches"
+ local flag
+ for flag in $EXT_PATCH_FLAGS; do
+ use $flag && enable_patch ${flag}
+ done
+
+ eend 0
+
+ extensions_add_make_conf
+
+ # add defined use-flags compile options to vdr.pc
+ sed -e "s:\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR):\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR) \$(DEFINES_IUSE):" \
+ -i Makefile
+
+ ebegin "Make depend"
+ emake .dependencies >/dev/null
+ eend $? "make depend failed"
+ fi
+
+ eapply "${FILESDIR}/${P}_gentoo.patch"
+
+ # fix some makefile issues
+ sed -e "s:ifndef NO_KBD:ifeq (\$(USE_KBD),1):" \
+ -e "s:ifdef BIDI:ifeq (\$(BIDI),1):" \
+ -e "s:ifdef SDNOTIFY:ifeq (\$(SDNOTIFY),1):" \
+ -i "${S}"/Makefile
+
+ eapply_user
+
+ add_cap CAP_UTF8
+
+ add_cap CAP_IRCTRL_RUNTIME_PARAM \
+ CAP_VFAT_RUNTIME_PARAM \
+ CAP_CHUID \
+ CAP_SHUTDOWN_AUTO_RETRY
+
+ echo -e ${CAPS} > "${CAP_FILE}"
+
+ # LINGUAS support
+ einfo "\n \t VDR supports the LINGUAS values"
+
+ lang_po
+
+ einfo "\t Please set one of this values in your sytem make.conf"
+ einfo "\t LINGUAS=\"${LING_PO}\"\n"
+
+ if [[ -z ${LINGUAS} ]]; then
+ einfo "\n \t No values in LINGUAS="
+ einfo "\t You will get only english text on OSD \n"
+ fi
+
+ strip-linguas ${LING_PO} en
+}
+
+src_install() {
+ # trick makefile not to create a videodir by supplying it with an existing
+ # directory
+ emake install \
+ VIDEODIR="/" \
+ DESTDIR="${D}" install || die "emake install failed"
+
+ keepdir "${PLUGIN_LIBDIR}"
+
+ # backup for plugins they don't be able to create this dir
+ keepdir "${CONF_DIR}"/plugins
+
+ if use html; then
+ local HTML_DOCS=( *.html )
+ fi
+
+ local DOCS=( MANUAL INSTALL README* HISTORY CONTRIBUTORS )
+
+ einstalldocs
+
+ insinto /usr/share/vdr
+ doins "${CAP_FILE}"
+
+ if use alternatechannel; then
+ insinto /etc/vdr
+ doins "${FILESDIR}"/channel_alternative.conf
+ fi
+
+ chown -R vdr:vdr "${D}/${CONF_DIR}"
+}
+
+pkg_postinst() {
+
+ elog "\n\t---- 15 YEARS ANNIVERSARY EDITON ----\n"
+ elog "\tA lot of thanks to Klaus Schmidinger"
+ elog "\tfor this nice piece of Software...\n"
+
+ elog "It is a good idea to run vdrplugin-rebuild now."
+
+ elog "To get nice symbols in OSD we recommend to install"
+ elog "\t1. emerge media-fonts/vdrsymbols-ttf"
+ elog "\t2. select font VDRSymbolsSans in Setup"
+ elog ""
+ elog "To get an idea how to proceed now, have a look at our vdr-guide:"
+ elog "\thttps://wiki.gentoo.org/wiki/VDR"
+}