commit:     3a9c74317ca518e97b50188e9d3207c5c0002852
Author:     Martin Dummer <martin.dummer <AT> gmx <DOT> net>
AuthorDate: Tue Jan 26 08:12:11 2021 +0000
Commit:     Jörg Bornkessel <hd_brummy <AT> gentoo <DOT> org>
CommitDate: Fri Feb 12 09:50:48 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a9c7431

www-misc/vdradmin-am: switch tmpfiles handling to tmpfiles.eclass

use tmpfiles.eclass instead of systemd_tmpfiles*
small fixes in systemd service file
small changes in the ebuild's configuration guidance output
remove unused ${FILESDIR}/vdradmin-3.6.6.conf

Closes: https://bugs.gentoo.org/740632
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Martin Dummer <martin.dummer <AT> gmx.net>
Reviewed-by: Joerg Bornkessel <hd_brummy <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/19227
Signed-off-by: Joerg Bornkessel <hd_brummy <AT> gentoo.org>

 www-misc/vdradmin-am/files/vdradmin-3.6.6.conf    |  26 ---
 www-misc/vdradmin-am/files/vdradmind.service      |   2 -
 www-misc/vdradmin-am/metadata.xml                 |   8 +
 www-misc/vdradmin-am/vdradmin-am-3.6.10-r2.ebuild | 187 ++++++++++++++++++++++
 4 files changed, 195 insertions(+), 28 deletions(-)

diff --git a/www-misc/vdradmin-am/files/vdradmin-3.6.6.conf 
b/www-misc/vdradmin-am/files/vdradmin-3.6.6.conf
deleted file mode 100644
index fe6efecbab8..00000000000
--- a/www-misc/vdradmin-am/files/vdradmin-3.6.6.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-# Settings for vdradmin-am
-
-# Run vdradmin-am as this user:
-#
-# If you want vdradmin to run on a port below 1024 you
-# should nevertheless have vdradmin running as root.
-#
-VDRADMIN_USER="vdradmin"
-
-# Use ssl connection
-# Allowed values: yes no
-# SSL using will disable non SSL connections
-#SSL=no
-
-# Use the ipv6 protocol [EXPERIMENTAL]
-# Allowed values: yes no
-#IPV6=no
-
-# Enable Logging
-# Allowed values: syslog file no
-# Setting this value to file will log to /var/log/vdradmin/vdradmind.log
-#LOGGING=no
-
-# Set loglevel
-# Allowed values: 0-7
-#LOGLEVEL=4

diff --git a/www-misc/vdradmin-am/files/vdradmind.service 
b/www-misc/vdradmin-am/files/vdradmind.service
index c7cd8752b3d..ef4dc4dada1 100644
--- a/www-misc/vdradmin-am/files/vdradmind.service
+++ b/www-misc/vdradmin-am/files/vdradmind.service
@@ -6,8 +6,6 @@ Documentation=file:///usr/share/doc/vdradmin-am/INSTALL
 [Service]
 ExecStart=/usr/bin/vdradmind --nofork
 User=vdradmin
-StandardOutput=syslog
-SyslogLevel=warning
 
 [Install]
 WantedBy=multi-user.target

diff --git a/www-misc/vdradmin-am/metadata.xml 
b/www-misc/vdradmin-am/metadata.xml
index 984a01fab26..cd73dfdd596 100644
--- a/www-misc/vdradmin-am/metadata.xml
+++ b/www-misc/vdradmin-am/metadata.xml
@@ -1,6 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Martin Dummer</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
        <maintainer type="project">
                <email>[email protected]</email>
                <name>Gentoo VDR Project</name>

diff --git a/www-misc/vdradmin-am/vdradmin-am-3.6.10-r2.ebuild 
b/www-misc/vdradmin-am/vdradmin-am-3.6.10-r2.ebuild
new file mode 100644
index 00000000000..54754bdb1bf
--- /dev/null
+++ b/www-misc/vdradmin-am/vdradmin-am-3.6.10-r2.ebuild
@@ -0,0 +1,187 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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="http://andreas.vdr-developer.org/vdradmin-am/download/${P}.tar.bz2";
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ipv6 ssl systemd"
+
+DEPEND="
+       acct-group/vdradmin
+       acct-user/vdradmin
+       dev-lang/perl
+       dev-perl/Authen-SASL
+       dev-perl/CGI
+       dev-perl/Digest-HMAC
+       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/IO-Socket-SSL )
+       systemd? ( sys-apps/systemd )
+"
+RDEPEND="${DEPEND}"
+
+ETC_DIR="/etc/vdradmin"
+CERTS_DIR="/etc/vdradmin/certs"
+LIB_DIR="/usr/share/vdradmin"
+VDRADMIN_USER="vdradmin"
+VDRADMIN_GROUP="vdradmin"
+
+create_ssl_cert() {
+       # The ssl-cert eclass is not flexible enough, so do some steps manually
+       SSL_ORGANIZATION="${SSL_ORGANIZATION:-vdradmin-am}"
+       SSL_COMMONNAME="${SSL_COMMONNAME:-`hostname -f`}"
+
+       gen_cnf || return 1
+
+       gen_key 1 || return 1
+       gen_csr 1 || return 1
+       gen_crt 1 || return 1
+}
+
+src_unpack() {
+       unpack ${A}
+       cp "${FILESDIR}"/vdradmind.service "${WORKDIR}"/vdradmind.service
+}
+
+src_prepare() {
+       default
+
+       sed -i vdradmind.pl \
+               -e "s|FILES_IN_SYSTEM    = 0;|FILES_IN_SYSTEM    = 1;|g" || die
+
+       if use ipv6; then
+               sed -e "s|/usr/bin/vdradmind|/usr/bin/vdradmind --ipv6|" \
+                       -i "${WORKDIR}"/vdradmind.service || die
+       fi
+
+       if use ssl; then
+               sed -e "s|/usr/bin/vdradmind|/usr/bin/vdradmind --ssl|" \
+                       -i "${WORKDIR}"/vdradmind.service || die
+       fi
+}
+
+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
+
+       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
+
+       insinto /usr/share/locale/
+       doins -r "${S}"/locale/*
+
+       newman vdradmind.pl.1 vdradmind.8
+
+       dodoc CREDITS ChangeLog 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
+}
+
+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 = "${EROOT}"/etc/vdr
+                       VIDEODIR = "${EROOT}"/var/vdr/video
+                       EPG_FILENAME = "${EROOT}"/var/vdr/video/epg.data
+                       EPGIMAGES = "${EROOT}"/var/vdr/video/epgimages
+                       PASSWORD = gentoo-vdr
+                       USERNAME = gentoo-vdr
+               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
+               if ! use systemd; then
+                       elog
+                       elog "To make use of the ipv6 protocol"
+                       elog "you need to enable it in 
${EROOT}/etc/conf.d/vdradmin"
+               fi
+       fi
+
+       if use ssl; then
+               if ! use systemd; then
+                       elog
+                       elog "To use ssl connection to your vdr"
+                       elog "you need to enable it in 
${EROOT}/etc/conf.d/vdradmin"
+               fi
+
+               if [[ ! -f "${EROOT}"${CERTS_DIR}/server-cert.pem || \
+                       ! -f "${EROOT}"${CERTS_DIR}/server-key.pem ]]; then
+                       create_ssl_cert
+                       local base=$(get_base 1)
+                       install -D -m 0400 -o ${VDRADMIN_USER} -g 
${VDRADMIN_GROUP} \
+                               "${base}".key 
"${EROOT}"${CERTS_DIR}/server-key.pem || die
+                       install -D -m 0444 -o ${VDRADMIN_USER} -g 
${VDRADMIN_GROUP} \
+                               "${base}".crt 
"${EROOT}"${CERTS_DIR}/server-cert.pem || die
+               fi
+       fi
+
+       elog
+       elog "To extend ${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