Gentoo Archives: gentoo-commits

From: "Jörg Bornkessel" <hd_brummy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-misc/vdradmin-am/files/, www-misc/vdradmin-am/
Date: Sun, 01 Mar 2020 11:07:25
Message-Id: 1583060827.91e95773cff02d136b2487cc7bea8dae8b4f907c.hd_brummy@gentoo
1 commit: 91e95773cff02d136b2487cc7bea8dae8b4f907c
2 Author: Joerg Bornkessel <hd_brummy <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 1 11:06:20 2020 +0000
4 Commit: Jörg Bornkessel <hd_brummy <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 1 11:07:07 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91e95773
7
8 www-misc/vdradmin-am: moved to acct user/group handling
9
10 initial ebuild with new
11 acct user/group handling
12 we use now uid/gid 453 for this
13 drop the user.eclass handling
14
15 Package-Manager: Portage-2.3.84, Repoman-2.3.20
16 Signed-off-by: Joerg Bornkessel <hd_brummy <AT> gentoo.org>
17
18 www-misc/vdradmin-am/files/vdradmin-3.6.10.conf | 19 +++
19 www-misc/vdradmin-am/vdradmin-am-3.6.10-r1.ebuild | 178 ++++++++++++++++++++++
20 2 files changed, 197 insertions(+)
21
22 diff --git a/www-misc/vdradmin-am/files/vdradmin-3.6.10.conf b/www-misc/vdradmin-am/files/vdradmin-3.6.10.conf
23 new file mode 100644
24 index 00000000000..1895b9c51dd
25 --- /dev/null
26 +++ b/www-misc/vdradmin-am/files/vdradmin-3.6.10.conf
27 @@ -0,0 +1,19 @@
28 +# Settings for vdradmin-am
29 +
30 +# Use ssl connection
31 +# Allowed values: yes no
32 +# SSL using will disable non SSL connections
33 +#SSL=no
34 +
35 +# Use the ipv6 protocol [EXPERIMENTAL]
36 +# Allowed values: yes no
37 +#IPV6=no
38 +
39 +# Enable Logging
40 +# Allowed values: syslog file no
41 +# Setting this value to file will log to /var/log/vdradmin/vdradmind.log
42 +#LOGGING=no
43 +
44 +# Set loglevel
45 +# Allowed values: 0-7
46 +#LOGLEVEL=4
47
48 diff --git a/www-misc/vdradmin-am/vdradmin-am-3.6.10-r1.ebuild b/www-misc/vdradmin-am/vdradmin-am-3.6.10-r1.ebuild
49 new file mode 100644
50 index 00000000000..0e82c2c7092
51 --- /dev/null
52 +++ b/www-misc/vdradmin-am/vdradmin-am-3.6.10-r1.ebuild
53 @@ -0,0 +1,178 @@
54 +# Copyright 1999-2020 Gentoo Authors
55 +# Distributed under the terms of the GNU General Public License v2
56 +
57 +EAPI=7
58 +
59 +inherit ssl-cert systemd
60 +
61 +DESCRIPTION="WWW Admin for the Video Disk Recorder"
62 +HOMEPAGE="http://andreas.vdr-developer.org/vdradmin-am/index.html"
63 +SRC_URI="http://andreas.vdr-developer.org/vdradmin-am/download/${P}.tar.bz2"
64 +
65 +LICENSE="GPL-2 LGPL-2.1"
66 +SLOT="0"
67 +KEYWORDS="~amd64 ~x86"
68 +IUSE="ipv6 ssl"
69 +
70 +DEPEND="acct-group/vdradmin
71 + acct-user/vdradmin
72 + dev-lang/perl
73 + dev-perl/Template-Toolkit
74 + dev-perl/libwww-perl
75 + dev-perl/URI
76 + dev-perl/CGI
77 + dev-perl/Locale-gettext
78 + virtual/perl-IO-Compress
79 + ipv6? ( dev-perl/IO-Socket-INET6 )
80 + ssl? ( dev-perl/IO-Socket-SSL )
81 + virtual/perl-libnet
82 + dev-perl/Authen-SASL
83 + dev-perl/Digest-HMAC"
84 +RDEPEND="${DEPEND}"
85 +
86 +ETC_DIR="/etc/vdradmin"
87 +CERTS_DIR="/etc/vdradmin/certs"
88 +LIB_DIR="/usr/share/vdradmin"
89 +VDRADMIN_USER="vdradmin"
90 +VDRADMIN_GROUP="vdradmin"
91 +
92 +create_ssl_cert() {
93 + # The ssl-cert eclass is not flexible enough, so do some steps manually
94 + SSL_ORGANIZATION="${SSL_ORGANIZATION:-vdradmin-am}"
95 + SSL_COMMONNAME="${SSL_COMMONNAME:-`hostname -f`}"
96 +
97 + gen_cnf || return 1
98 +
99 + gen_key 1 || return 1
100 + gen_csr 1 || return 1
101 + gen_crt 1 || return 1
102 +}
103 +
104 +src_unpack() {
105 + unpack ${A}
106 + cp "${FILESDIR}"/vdradmind.service "${WORKDIR}"/vdradmind.service
107 +}
108 +
109 +src_prepare() {
110 + default
111 +
112 + sed -i vdradmind.pl \
113 + -e "s-FILES_IN_SYSTEM = 0;-FILES_IN_SYSTEM = 1;-g" || die
114 +
115 + if use ipv6; then
116 + sed -e "s:/usr/bin/vdradmind:/usr/bin/vdradmind --ipv6:" \
117 + -i "${WORKDIR}"/vdradmind.service || die
118 + fi
119 +
120 + if use ssl; then
121 + sed -e "s:/usr/bin/vdradmind:/usr/bin/vdradmind --ssl:" \
122 + -i "${WORKDIR}"/vdradmind.service || die
123 + fi
124 +}
125 +
126 +src_install() {
127 + newinitd "${FILESDIR}"/vdradmin-3.6.7.init vdradmin
128 + newconfd "${FILESDIR}"/vdradmin-3.6.10.conf vdradmin
129 +
130 + systemd_dounit "${WORKDIR}"/vdradmind.service
131 + systemd_dotmpfilesd "${FILESDIR}"/vdradmind.conf
132 +
133 + insinto /etc/logrotate.d
134 + newins "${FILESDIR}"/vdradmin-3.6.6.logrotate vdradmin
135 +
136 + newbin vdradmind.pl vdradmind
137 +
138 + insinto "${LIB_DIR}"/template
139 + doins -r "${S}"/template/*
140 +
141 + insinto "${LIB_DIR}"/lib/Template/Plugin
142 + doins -r "${S}"/lib/Template/Plugin/JavaScript.pm
143 +
144 + insinto /usr/share/locale/
145 + doins -r "${S}"/locale/*
146 +
147 + newman vdradmind.pl.1 vdradmind.8
148 +
149 + dodoc CREDITS ChangeLog FAQ HISTORY INSTALL README* REQUIREMENTS
150 + docinto contrib
151 + dodoc "${S}"/contrib/*
152 +
153 + keepdir "${ETC_DIR}"
154 + fowners "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" "${ETC_DIR}"
155 +
156 + use ssl && keepdir "${CERTS_DIR}" && \
157 + fowners "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" "${CERTS_DIR}"
158 +}
159 +
160 +pkg_preinst() {
161 + install -m 0644 -o ${VDRADMIN_USER} -g ${VDRADMIN_GROUP} /dev/null \
162 + "${ED}"${ETC_DIR}/vdradmind.conf || die
163 +
164 + if [[ -f "${EROOT}"${ETC_DIR}/vdradmind.conf ]]; then
165 + cp "${EROOT}"${ETC_DIR}/vdradmind.conf \
166 + "${ED}"${ETC_DIR}/vdradmind.conf || die
167 + else
168 + elog
169 + elog "Creating a new config-file."
170 + echo
171 +
172 + cat <<-EOF > "${ED}"${ETC_DIR}/vdradmind.conf
173 + VDRCONFDIR = "${EROOT}"/etc/vdr
174 + VIDEODIR = "${EROOT}"/var/vdr/video
175 + EPG_FILENAME = "${EROOT}"/var/vdr/video/epg.data
176 + EPGIMAGES = "${EROOT}"/var/vdr/video/epgimages
177 + PASSWORD = gentoo-vdr
178 + USERNAME = gentoo-vdr
179 + EOF
180 + # Feed it with newlines
181 + yes "" \
182 + | "${ED}"/usr/bin/vdradmind --cfgdir "${ED}"${ETC_DIR} --config \
183 + |sed -e 's/: /: \n/g'
184 +
185 + [[ ${PIPESTATUS[1]} == "0" ]] \
186 + || die "Failed to create initial configuration."
187 +
188 + elog
189 + elog "Created default user/password: gentoo-vdr/gentoo-vdr"
190 + elog
191 + elog "You can run \"emerge --config ${PN}\" if the default-values"
192 + elog "do not match your installation or change them in the Setup-Menu"
193 + elog "of the Web-Interface."
194 + fi
195 +}
196 +
197 +pkg_postinst() {
198 + if use ipv6; then
199 + elog
200 + elog "To make use of the ipv6 protocol"
201 + elog "you need to enable it in ${EROOT}/etc/conf.d/vdradmin"
202 + fi
203 +
204 + if use ssl; then
205 + elog
206 + elog "To use ssl connection to your vdr"
207 + elog "you need to enable it in ${EROOT}/etc/conf.d/vdradmin"
208 +
209 + if [[ ! -f "${EROOT}"${CERTS_DIR}/server-cert.pem || \
210 + ! -f "${EROOT}"${CERTS_DIR}/server-key.pem ]]; then
211 + create_ssl_cert
212 + local base=$(get_base 1)
213 + install -D -m 0400 -o ${VDRADMIN_USER} -g ${VDRADMIN_GROUP} \
214 + "${base}".key "${EROOT}"${CERTS_DIR}/server-key.pem || die
215 + install -D -m 0444 -o ${VDRADMIN_USER} -g ${VDRADMIN_GROUP} \
216 + "${base}".crt "${EROOT}"${CERTS_DIR}/server-cert.pem || die
217 + fi
218 + fi
219 +
220 + elog
221 + elog "To extend ${PN} you can emerge"
222 + elog "media-plugins/vdr-epgsearch to search the EPG,"
223 + elog "media-plugins/vdr-streamdev for livetv streaming and/or"
224 + elog "media-video/vdr with USE=\"liemikuutio/vasarajanauloja/none\" "
225 + elog "(depend on your vdr version) to rename recordings"
226 + elog "on the machine running the VDR you connect to with ${PN}."
227 +}
228 +
229 +pkg_config() {
230 + "${EROOT}"/usr/bin/vdradmind -c
231 +}