commit:     c573590595690a0edd66f71e0253f967ea00f8c2
Author:     Martin Dummer <martin.dummer <AT> gmx <DOT> net>
AuthorDate: Fri Oct 24 12:49:47 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 12 09:48:43 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5735905

www-misc/vdradmin-am: add 3.6.14

Signed-off-by: Martin Dummer <martin.dummer <AT> gmx.net>
Part-of: https://github.com/gentoo/gentoo/pull/44311
Signed-off-by: Sam James <sam <AT> gentoo.org>

 www-misc/vdradmin-am/Manifest                      |   1 +
 .../files/timerlist_prio_lifetime_addon.patch      | 216 +++++++++++++++++++++
 .../vdradmin-am/files/vdradmin-systemd-helper.sh   |  40 ++++
 www-misc/vdradmin-am/files/vdradmind.service       |  13 +-
 www-misc/vdradmin-am/files/vdradmind.service.conf  |   5 +
 www-misc/vdradmin-am/metadata.xml                  |   3 +
 www-misc/vdradmin-am/vdradmin-am-3.6.14.ebuild     | 198 +++++++++++++++++++
 7 files changed, 473 insertions(+), 3 deletions(-)

diff --git a/www-misc/vdradmin-am/Manifest b/www-misc/vdradmin-am/Manifest
index 3bdcee76687a..886ecf0c2d3d 100644
--- a/www-misc/vdradmin-am/Manifest
+++ b/www-misc/vdradmin-am/Manifest
@@ -1 +1,2 @@
 DIST vdradmin-am-3.6.10.tar.bz2 606665 BLAKE2B 
c475b36c840548b6e0d50b2095ce3278b0b526af856c891a25d28bb2f0cb9f950aa9979533a6b6425a2a36a594dc5d6a075fca7713eb1f59071fec854582cf5b
 SHA512 
f7546f79b786ca383c0846656e74bd69dc9faf57fe5794ffd68776123497ec2a96c2f131801e3d5d19247ac36eaa896801e1ac9cd11291418abb518ba208e597
+DIST vdradmin-am-3.6.14.tgz 603368 BLAKE2B 
0b3c13c9c92ba01e6ea9968a286006c5fbae6f6491d39f33857cac058d1ae924d8d19d214566b45017412818a57a5ac9788580b13301614523557d78242e8cc7
 SHA512 
64f75e1ce40086144b4d2d3cec0b2c0560e70e25bbc6ff36ed46261cd58abb1246b6664966adfb39d76266641fe3c6e7febb5644b7bf0c8eb56c7ef8cd4bdbb0

diff --git a/www-misc/vdradmin-am/files/timerlist_prio_lifetime_addon.patch 
b/www-misc/vdradmin-am/files/timerlist_prio_lifetime_addon.patch
new file mode 100644
index 000000000000..2518d5f32a58
--- /dev/null
+++ b/www-misc/vdradmin-am/files/timerlist_prio_lifetime_addon.patch
@@ -0,0 +1,216 @@
+commit 594f576033e8042c1339e45a5ca67dd0395b9788
+Author: Martin Dummer <[email protected]>
+Date:   Sun Oct 12 23:58:35 2025 +0200
+
+    add priority and lifetime to timer list
+
+diff --git a/po/de.po b/po/de.po
+index d532626..6cd13d4 100644
+--- a/po/de.po
++++ b/po/de.po
+@@ -1511,3 +1511,15 @@ msgstr "Timer"
+ 
+ msgid "System default"
+ msgstr "Systemstandard"
++
++msgid "Priority"
++msgstr "Priorität"
++
++msgid "Lifetime"
++msgstr "Lebenszeit"
++
++msgid "Show priority in timer list:"
++msgstr "Timer-Priorität in Timer-Liste anzeigen:"
++
++msgid "Show lifetime in timer list:"
++msgstr "Aufnahme-Lebenszeit in Timer-Liste anzeigen:"
+diff --git a/po/vdradmin.pot b/po/vdradmin.pot
+index 74f854b..4d9a04d 100644
+--- a/po/vdradmin.pot
++++ b/po/vdradmin.pot
+@@ -1523,3 +1523,15 @@ msgstr ""
+ 
+ msgid "System default"
+ msgstr ""
++
++msgid "Priority"
++msgstr ""
++
++msgid "Lifetime"
++msgstr ""
++
++msgid "Show priority in timer list:"
++msgstr ""
++
++msgid "Show lifetime in timer list:"
++msgstr ""
+diff --git a/template/default/config.html b/template/default/config.html
+index 094a327..a3318ab 100644
+--- a/template/default/config.html
++++ b/template/default/config.html
+@@ -315,6 +315,20 @@
+                                       <input type="radio" name="TM_TT_LIST" 
value="0" id="tm_tl_list_no" <?% UNLESS config.TM_TT_LIST 
%?>checked="checked"<?% END %?> /><label for="tm_tl_list_no"><?% gettext('No') 
%?></label>
+                               </td>
+                       </tr>
++                      <tr class="row_odd">
++                              <td class="col_label"><h5><?% gettext('Show 
priority in timer list:') %?></h5></td>
++                              <td class="col_value">
++                                      <input type="radio" 
name="TM_LIST_PRIORITY" value="1" id="tm_list_priority_yes" <?% IF 
config.TM_LIST_PRIORITY %?>checked="checked"<?% END %?> /><label 
for="tm_list_priority_yes"><?% gettext('Yes') %?></label>
++                                      <input type="radio" 
name="TM_LIST_PRIORITY" value="0" id="tm_list_priority_no" <?% UNLESS 
config.TM_LIST_PRIORITY %?>checked="checked"<?% END %?> /><label 
for="tm_list_priority_no"><?% gettext('No') %?></label>
++                              </td>
++                      </tr>
++                      <tr class="row_even">
++                              <td class="col_label"><h5><?% gettext('Show 
lifetime in timer list:') %?></h5></td>
++                              <td class="col_value">
++                                      <input type="radio" 
name="TM_LIST_LIFETIME" value="1" id="tm_list_lifetime_yes" <?% IF 
config.TM_LIST_LIFETIME %?>checked="checked"<?% END %?> /><label 
for="tm_list_lifetime_yes"><?% gettext('Yes') %?></label>
++                                      <input type="radio" 
name="TM_LIST_LIFETIME" value="0" id="tm_list_lifetime_no" <?% UNLESS 
config.TM_LIST_LIFETIME %?>checked="checked"<?% END %?> /><label 
for="tm_list_lifetime_no"><?% gettext('No') %?></label>
++                              </td>
++                      </tr>
+               </table>
+ 
+ <?% IF config.ST_FUNC %?>
+diff --git a/template/default/timer_list.html 
b/template/default/timer_list.html
+index cafe28d..cf47459 100644
+--- a/template/default/timer_list.html
++++ b/template/default/timer_list.html
+@@ -304,6 +304,32 @@
+                                                       </a>
+                                               </h2>
+                                       </td>
++                              <?% IF showprio %?>
++                                      <td class="col_prio <?% IF sortbyprio 
%?>selected<?% END %?>">
++                                              <h2>
++                                                      <a href="<?% 
sortbypriourl %?>"><?% gettext('Priority') %?>
++                                                              <?% IF 
sortbyprio %?>
++                                                                      <img 
src="bilder/sortiert_<?% desc %?>.gif" alt="" width="9" height="11" border="0" 
/>
++                                                              <?% ELSE %?>
++                                                                      <img 
src="bilder/spacer.gif" alt="" width="9" height="11" border="0" />
++                                                              <?% END %?>
++                                                      </a>
++                                              </h2>
++                                      </td>
++                              <?% END %?>
++                              <?% IF showlft %?>
++                                      <td class="col_lft <?% IF sortbylft 
%?>selected<?% END %?>">
++                                              <h2>
++                                                      <a href="<?% 
sortbylfturl %?>"><?% gettext('Lifetime') %?>
++                                                              <?% IF 
sortbylft %?>
++                                                                      <img 
src="bilder/sortiert_<?% desc %?>.gif" alt="" width="9" height="11" border="0" 
/>
++                                                              <?% ELSE %?>
++                                                                      <img 
src="bilder/spacer.gif" alt="" width="9" height="11" border="0" />
++                                                              <?% END %?>
++                                                      </a>
++                                              </h2>
++                                      </td>
++                              <?% END %?>
+                                       <td class="col_name <?% IF sortbyname 
%?>selected<?% END %?>">
+                                               <h2>
+                                                       <a href="<?% 
sortbynameurl %?>">
+@@ -396,6 +422,16 @@
+                                                       <?% timer.stop %?>
+                                               </div>
+                                       </td>
++                              <?% IF showprio %?>
++                                      <td class="col_prio <?% IF 
timer.sortbyprio %?>selected<?% END %?>">
++                                              <div><?% timer.prio %?></div>
++                                      </td>
++                              <?% END %?>
++                              <?% IF showlft %?>
++                                      <td class="col_lft <?% IF 
timer.sortbylft %?>selected<?% END %?>">
++                                              <div><?% timer.lft %?></div>
++                                      </td>
++                              <?% END %?>
+                                       <td class="col_name <?% IF 
timer.sortbyname %?>selected<?% END %?>">
+                                               <div <?% IF config.TM_TT_LIST 
%?>onmouseover="tip('VDR-
+                                                       <?% timer.id %?>'); 
return true;" onmouseout="untip(); return true;"
+diff --git a/vdradmind.pl b/vdradmind.pl
+index 7e83baa..08acbac 100755
+--- a/vdradmind.pl
++++ b/vdradmind.pl
+@@ -213,6 +213,8 @@ $CONFIG{TM_TT_TIMELINE}  = 1;
+ $CONFIG{TM_TT_LIST}      = 1;
+ $CONFIG{TM_SORTBY}       = "day";
+ $CONFIG{TM_DESC}         = 0;
++$CONFIG{TM_LIST_PRIORITY}= 0; # show timer's priority in timerlist
++$CONFIG{TM_LIST_LIFETIME}= 0; # show timer's lifetime in timerlist
+ 
+ #
+ $CONFIG{ST_FUNC}           = 1;
+@@ -4717,6 +4719,8 @@ sub timer_list {
+     $CONFIG{TM_DESC} = ($q->param("desc") ? 1 : 0) if 
(defined($q->param("desc")));
+     $CONFIG{TM_SORTBY} = $q->param("sortby") if 
(defined($q->param("sortby")));
+     $CONFIG{TM_SORTBY} = "day" if (!$CONFIG{TM_SORTBY});
++    $CONFIG{TM_SORTBY} = "day" if (($CONFIG{TM_SORTBY} eq "prio") && (! 
$CONFIG{TM_LIST_PRIORITY}));
++    $CONFIG{TM_SORTBY} = "day" if (($CONFIG{TM_SORTBY} eq "lft") && (! 
$CONFIG{TM_LIST_LIFETIME}));
+ 
+     #
+     my @timer;
+@@ -4757,6 +4761,8 @@ sub timer_list {
+         $timer->{sortbyname}    = 1 if ($CONFIG{TM_SORTBY} eq "name");
+         $timer->{sortbystart}   = 1 if ($CONFIG{TM_SORTBY} eq "start");
+         $timer->{sortbystop}    = 1 if ($CONFIG{TM_SORTBY} eq "stop");
++        $timer->{sortbyprio}    = 1 if ($CONFIG{TM_SORTBY} eq "prio");
++        $timer->{sortbylft}     = 1 if ($CONFIG{TM_SORTBY} eq "lft");
+         $timer->{sortbyday}     = 1 if ($CONFIG{TM_SORTBY} eq "day");
+ 
+         $timer->{transponder} = get_transponder_from_vdrid($timer->{vdr_id});
+@@ -4941,6 +4947,18 @@ sub timer_list {
+         } else {
+             @timer = sort({ $a->{stop} <=> $b->{stop} } @timer);
+         }
++    } elsif ($CONFIG{TM_SORTBY} eq "prio") {
++        if ($CONFIG{TM_DESC}) {
++            @timer = sort({ $b->{prio} <=> $a->{prio} } @timer);
++        } else {
++            @timer = sort({ $a->{prio} <=> $b->{prio} } @timer);
++        }
++    } elsif ($CONFIG{TM_SORTBY} eq "lft") {
++        if ($CONFIG{TM_DESC}) {
++            @timer = sort({ $b->{lft} <=> $a->{lft} } @timer);
++        } else {
++            @timer = sort({ $a->{lft} <=> $b->{lft} } @timer);
++        }
+     } elsif ($CONFIG{TM_SORTBY} eq "day") {
+         if ($CONFIG{TM_DESC}) {
+             @timer = sort({ $b->{startsse} <=> $a->{startsse} } @timer);
+@@ -4958,13 +4976,19 @@ sub timer_list {
+                  sortbyactiveurl  => 
"$MyURL?aktion=timer_list&amp;sortby=active&amp;desc=" .  (($CONFIG{TM_SORTBY} 
eq "active")  ? $toggle_desc : $CONFIG{TM_DESC}),
+                  sortbystarturl   => 
"$MyURL?aktion=timer_list&amp;sortby=start&amp;desc=" .   (($CONFIG{TM_SORTBY} 
eq "start")   ? $toggle_desc : $CONFIG{TM_DESC}),
+                  sortbystopurl    => 
"$MyURL?aktion=timer_list&amp;sortby=stop&amp;desc=" .    (($CONFIG{TM_SORTBY} 
eq "stop")    ? $toggle_desc : $CONFIG{TM_DESC}),
++                 sortbypriourl    => 
"$MyURL?aktion=timer_list&amp;sortby=prio&amp;desc=" .    (($CONFIG{TM_SORTBY} 
eq "prio")    ? $toggle_desc : $CONFIG{TM_DESC}),
++                 sortbylfturl     => 
"$MyURL?aktion=timer_list&amp;sortby=lft&amp;desc=" .     (($CONFIG{TM_SORTBY} 
eq "lft")     ? $toggle_desc : $CONFIG{TM_DESC}),
+                  sortbyday     => ($CONFIG{TM_SORTBY} eq "day")     ? 1 : 0,
+                  sortbychannel => ($CONFIG{TM_SORTBY} eq "channel") ? 1 : 0,
+                  sortbyname    => ($CONFIG{TM_SORTBY} eq "name")    ? 1 : 0,
+                  sortbyactive  => ($CONFIG{TM_SORTBY} eq "active")  ? 1 : 0,
+                  sortbystart   => ($CONFIG{TM_SORTBY} eq "start")   ? 1 : 0,
+                  sortbystop    => ($CONFIG{TM_SORTBY} eq "stop")    ? 1 : 0,
++                 sortbyprio    => ($CONFIG{TM_SORTBY} eq "prio")    ? 1 : 0,
++                 sortbylft     => ($CONFIG{TM_SORTBY} eq "lft")     ? 1 : 0,
+                  sortby        => $CONFIG{TM_SORTBY},
++                 showprio      => $CONFIG{TM_LIST_PRIORITY},
++                 showlft       => $CONFIG{TM_LIST_LIFETIME},
+                  desc          => $CONFIG{TM_DESC} ? "desc" : "asc",
+                  timer_loop    => \@timer,
+                  timers        => \@timer2,
+diff --git a/template/default/style.css b/template/default/style.css
+index 3f83433..c454a3b 100644
+--- a/template/default/style.css
++++ b/template/default/style.css
+@@ -479,11 +479,16 @@ body.help .heading {
+ }
+ .col_start,
+ .col_stop,
++.col_prio,
+ .col_date,
+ .col_time {
+       width: 75px;
+       text-align: left;
+ }
++.col_lft {
++      width: 85px;
++      text-align: left;
++}
+ .col_length {
+       width: 75px;
+       text-align: right;

diff --git a/www-misc/vdradmin-am/files/vdradmin-systemd-helper.sh 
b/www-misc/vdradmin-am/files/vdradmin-systemd-helper.sh
new file mode 100644
index 000000000000..a243d6912786
--- /dev/null
+++ b/www-misc/vdradmin-am/files/vdradmin-systemd-helper.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# VDRADMIN helper script for configuration transfer from gentoo config file
+# to a systemd service env file
+
+# read config file
+. /etc/conf.d/vdradmin
+
+SYSTEMD_ENV_FILE="/etc/vdradmin/vdradmin-systemd.env"
+SYSTEMD_ENV_TMP=$(mktemp)
+
+DAEMON_OPTS=""
+
+if [ "${SSL:=no}" = "yes" ]; then
+       DAEMON_OPTS="--ssl"
+fi
+
+if [ "${IPV6:=no}" = "yes" ]; then
+       DAEMON_OPTS="${DAEMON_OPTS} --ipv6"
+fi
+
+if [ "${LOGGING:=no}" = "yes" ]; then
+       DAEMON_OPTS="${DAEMON_OPTS} --log ${LOGLEVEL:=4} --logfile 
/var/log/vdradmin/vdradmind.log"
+fi
+
+echo "# systemd environment file, created by pre-exec script, do not edit!" > 
${SYSTEMD_ENV_TMP}
+echo "CONF_D_OPTS=\"${DAEMON_OPTS}\"" >> ${SYSTEMD_ENV_TMP}
+
+# compare env file for changes
+diff -q ${SYSTEMD_ENV_TMP} ${SYSTEMD_ENV_FILE} >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+       echo "vdradmin-am configuration changed"
+       cat ${SYSTEMD_ENV_TMP}
+       mv ${SYSTEMD_ENV_TMP} ${SYSTEMD_ENV_FILE}
+       chmod 0644 ${SYSTEMD_ENV_FILE}
+       sudo systemctl daemon-reload
+else
+       echo "vdradmin-am configuration not changed"
+       rm -f ${SYSTEMD_ENV_TMP} >/dev/null 2>&1
+fi

diff --git a/www-misc/vdradmin-am/files/vdradmind.service 
b/www-misc/vdradmin-am/files/vdradmind.service
index ef4dc4dada15..f82da02cd0b8 100644
--- a/www-misc/vdradmin-am/files/vdradmind.service
+++ b/www-misc/vdradmin-am/files/vdradmind.service
@@ -1,10 +1,17 @@
 [Unit]
-Description=WWW interface daemon for VDR
+Description=vdradmin-am, the web-based administration tool for VDR
 Documentation=man:vdradmind(8)
-Documentation=file:///usr/share/doc/vdradmin-am/INSTALL
+
+After=vdr.service
+After=network.target
+
+ConditionPathExists=/etc/vdradmin
+ConditionPathExists=/etc/vdradmin/vdradmind.conf
 
 [Service]
-ExecStart=/usr/bin/vdradmind --nofork
+EnvironmentFile=/etc/vdradmin/vdradmin-systemd.env
+ExecStartPre=/usr/share/vdradmin/systemd/vdradmin-systemd-helper.sh
+ExecStart=/usr/bin/vdradmind $CONF_D_OPTS --nofork
 User=vdradmin
 
 [Install]

diff --git a/www-misc/vdradmin-am/files/vdradmind.service.conf 
b/www-misc/vdradmin-am/files/vdradmind.service.conf
new file mode 100644
index 000000000000..a44eefd46a9a
--- /dev/null
+++ b/www-misc/vdradmin-am/files/vdradmind.service.conf
@@ -0,0 +1,5 @@
+[Service]
+# set options for vdradmind here
+# example: DAEMON_OPTIONS=
+Environment="DAEMON_OPTIONS=/tftproot"
+

diff --git a/www-misc/vdradmin-am/metadata.xml 
b/www-misc/vdradmin-am/metadata.xml
index b4dbb6eb43d2..6cc21dd91e6f 100644
--- a/www-misc/vdradmin-am/metadata.xml
+++ b/www-misc/vdradmin-am/metadata.xml
@@ -13,4 +13,7 @@
                <email>[email protected]</email>
                <name>Gentoo VDR Project</name>
        </maintainer>
+       <upstream>
+               <remote-id type="github">vdr-projects/vdradmin-am</remote-id>
+       </upstream>
 </pkgmetadata>

diff --git a/www-misc/vdradmin-am/vdradmin-am-3.6.14.ebuild 
b/www-misc/vdradmin-am/vdradmin-am-3.6.14.ebuild
new file mode 100644
index 000000000000..1130bc240f89
--- /dev/null
+++ b/www-misc/vdradmin-am/vdradmin-am-3.6.14.ebuild
@@ -0,0 +1,198 @@
+# Copyright 2024-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit ssl-cert systemd tmpfiles
+
+DESCRIPTION="WWW Admin for the Video Disk Recorder"
+HOMEPAGE="http://andreas.vdr-developer.org/vdradmin-am/index.html";
+SRC_URI="https://github.com/vdr-projects/vdradmin-am/archive/refs/tags/v${PV}.tar.gz
 -> ${P}.tgz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ipv6 systemd"
+
+DEPEND="acct-user/vdradmin
+       dev-lang/perl
+       dev-perl/Authen-SASL
+       dev-perl/CGI
+       dev-perl/Digest-HMAC
+       dev-perl/HTTP-Daemon
+       dev-perl/Locale-gettext
+       dev-perl/Template-Toolkit
+       dev-perl/URI
+       dev-perl/libwww-perl
+       virtual/perl-IO-Compress
+       virtual/perl-libnet
+       ipv6? ( dev-perl/IO-Socket-INET6 )
+       ssl? ( dev-perl/HTTP-Daemon-SSL )
+       systemd? ( sys-apps/systemd )"
+RDEPEND="${DEPEND}
+       app-admin/sudo"
+BDEPEND="
+       acct-user/vdradmin
+       sys-devel/gettext"
+PATCHES=( "${FILESDIR}/timerlist_prio_lifetime_addon.patch" )
+
+ETC_DIR="/etc/vdradmin"
+CERTS_DIR="/etc/vdradmin/certs"
+LIB_DIR="/usr/share/vdradmin"
+VDRADMIN_USER="vdradmin"
+VDRADMIN_GROUP="vdradmin"
+
+create_ssl_cert() {
+       elog "Create and install SSL certificate"
+       SSL_ORGANIZATION="VDR vdradmin-am"
+       SSL_COMMONNAME=$("${ROOT}"/bin/hostname -f)
+       elog "install_cert ${CERTS_DIR}/server-cert.pem for host 
$SSL_COMMONNAME"
+       rm -f "${ROOT}${CERTS_DIR}/server-cert.pem" 
"${ROOT}${CERTS_DIR}/server-key.pem" || die
+       install_cert "${ROOT}${CERTS_DIR}/vdradmin"
+       ls -la "${ROOT}${CERTS_DIR}/"
+       rm -f "${ROOT}${CERTS_DIR}/vdradmin.csr" 
"${ROOT}${CERTS_DIR}/vdradmin.pem" || die
+       mv "${ROOT}${CERTS_DIR}/vdradmin.key" 
"${ROOT}${CERTS_DIR}/server-key.pem" || die
+       mv "${ROOT}${CERTS_DIR}/vdradmin.crt" 
"${ROOT}${CERTS_DIR}/server-cert.pem" || die
+       chown "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" 
"${ROOT}${CERTS_DIR}/server-cert.pem" || die
+       chown "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" 
"${ROOT}${CERTS_DIR}/server-key.pem" || die
+}
+
+src_unpack() {
+       unpack ${A}
+       cp "${FILESDIR}"/vdradmind.service "${WORKDIR}"/vdradmind.service || die
+}
+
+src_prepare() {
+       default
+
+       sed -i vdradmind.pl \
+               -e "s|FILES_IN_SYSTEM\s*=\s*0;|FILES_IN_SYSTEM = 1;|" || die
+}
+
+src_install() {
+       newinitd "${FILESDIR}"/vdradmin-3.6.7.init vdradmin
+       newconfd "${FILESDIR}"/vdradmin-3.6.10.conf vdradmin
+
+       systemd_dounit "${WORKDIR}"/vdradmind.service
+       dotmpfiles "${FILESDIR}"/vdradmind.conf
+
+       exeinto /usr/share/vdradmin/systemd
+       doexe "${FILESDIR}"/vdradmin-systemd-helper.sh
+
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}"/vdradmin-3.6.6.logrotate vdradmin
+
+       newbin vdradmind.pl vdradmind
+
+       insinto "${LIB_DIR}"/template
+       doins -r "${S}"/template/*
+
+       insinto "${LIB_DIR}"/lib/Template/Plugin
+       doins -r "${S}"/lib/Template/Plugin/JavaScript.pm
+
+       newman vdradmind.pl.1 vdradmind.8
+
+       dodoc CREDITS FAQ HISTORY INSTALL README* REQUIREMENTS
+       docinto contrib
+       dodoc "${S}"/contrib/*
+
+       keepdir "${ETC_DIR}"
+       fowners "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" "${ETC_DIR}"
+
+       if use ssl; then
+               keepdir "${CERTS_DIR}"
+               fowners "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" "${CERTS_DIR}"
+       fi
+
+       mkdir -p "${ED}/etc/sudoers.d/" || die
+       echo "vdradmin ALL=NOPASSWD:/bin/systemctl daemon-reload" > 
"${ED}/etc/sudoers.d/${PN}" || die
+       chmod 0440 "${ED}/etc/sudoers.d/${PN}" || die
+
+       local PO L
+       for PO in po/*.po
+       do
+               L=$(basename $PO .po)
+               insinto /usr/share/locale/${L}/LC_MESSAGES/
+               msgfmt po/${L}.po -o po/${L}.mo
+               newins po/${L}.mo vdradmin.mo
+       done
+
+}
+
+pkg_preinst() {
+       install -m 0644 -o ${VDRADMIN_USER} -g ${VDRADMIN_GROUP} /dev/null \
+               "${ED}"${ETC_DIR}/vdradmind.conf || die
+
+       if [[ -f "${EROOT}"${ETC_DIR}/vdradmind.conf ]]; then
+               cp "${EROOT}"${ETC_DIR}/vdradmind.conf \
+                       "${ED}"${ETC_DIR}/vdradmind.conf || die
+       else
+               elog
+               elog "Creating a new config-file."
+               echo
+
+               cat <<-EOF > "${ED}"${ETC_DIR}/vdradmind.conf
+                       VDRCONFDIR = /etc/vdr
+                       VIDEODIR = /var/vdr/video
+                       EPG_FILENAME = /var/vdr/video/epg.data
+                       EPGIMAGES = /var/vdr/video/epgimages
+                       PASSWORD = gentoo-vdr
+                       USERNAME = gentoo-vdr
+                       VDR_PORT = 6419
+               EOF
+               # Feed it with newlines
+               yes "" \
+                       | "${ED}"/usr/bin/vdradmind --cfgdir "${ED}"${ETC_DIR} 
--config \
+                       |sed -e 's|: |: \n|g'
+
+               [[ ${PIPESTATUS[1]} == "0" ]] \
+                       || die "Failed to create initial configuration."
+
+               elog
+               elog "Created default user/password: gentoo-vdr/gentoo-vdr"
+               elog
+               elog "You can run \"emerge --config ${PN}\" if the 
default-values"
+               elog "do not match your installation or change them in the 
Setup-Menu"
+               elog "of the Web-Interface."
+       fi
+}
+
+pkg_postinst() {
+       tmpfiles_process vdradmind.conf
+
+       if use ipv6; then
+               elog
+               elog "To make use of the ipv6 protocol"
+               elog "you need to enable it in ${EROOT}/etc/conf.d/vdradmin"
+       fi
+
+       if use ssl; then
+               elog
+               elog "To use ssl connection to your vdradmin"
+               elog "you need to enable it in ${EROOT}/etc/conf.d/vdradmin"
+
+               # only create a certificate if none exists
+               if [[ -f ${ROOT}${CERTS_DIR}/server-cert.pem ]]; then
+                       elog "Existing SSL cert found, not touching it."
+               else
+                       elog "No SSL cert found, creating a default one now"
+                       create_ssl_cert
+               fi
+       fi
+
+       if [[ ! -f "${EROOT}"${ETC_DIR}/vdradmin-systemd.env ]]; then
+               echo "# systemd environment file, created by pre-exec script, 
do not edit!" \
+                       > "${EROOT}"${ETC_DIR}/vdradmin-systemd.env
+               chown "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" 
"${EROOT}"${ETC_DIR}/vdradmin-systemd.env || die
+       fi
+
+       elog
+       elog "To extend the functionality of ${PN} you can emerge"
+       elog "  media-plugins/vdr-epgsearch to search the EPG"
+       elog "  media-plugins/vdr-streamdev for livetv streaming"
+       elog "on the machine running the VDR you connect to with ${PN}."
+}
+
+pkg_config() {
+       "${EROOT}"/usr/bin/vdradmind -c
+}

Reply via email to