1 |
|
# Copyright 1999-2021 Gentoo Authors
|
|
1 |
# Copyright 2021 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=7
|
... | ... | |
12 |
12 |
LICENSE="GPL-2 LGPL-2.1"
|
13 |
13 |
SLOT="0"
|
14 |
14 |
KEYWORDS="amd64 x86"
|
15 |
|
IUSE="ipv6 ssl"
|
|
15 |
IUSE="ipv6 ssl systemd"
|
16 |
16 |
|
17 |
|
DEPEND="acct-group/vdradmin
|
|
17 |
DEPEND="
|
|
18 |
acct-group/vdradmin
|
18 |
19 |
acct-user/vdradmin
|
19 |
20 |
dev-lang/perl
|
20 |
|
dev-perl/Template-Toolkit
|
21 |
|
dev-perl/libwww-perl
|
22 |
|
dev-perl/URI
|
|
21 |
dev-perl/Authen-SASL
|
23 |
22 |
dev-perl/CGI
|
|
23 |
dev-perl/Digest-HMAC
|
24 |
24 |
dev-perl/Locale-gettext
|
|
25 |
dev-perl/Template-Toolkit
|
|
26 |
dev-perl/URI
|
|
27 |
dev-perl/libwww-perl
|
25 |
28 |
virtual/perl-IO-Compress
|
|
29 |
virtual/perl-libnet
|
26 |
30 |
ipv6? ( dev-perl/IO-Socket-INET6 )
|
27 |
31 |
ssl? ( dev-perl/IO-Socket-SSL )
|
28 |
|
virtual/perl-libnet
|
29 |
|
dev-perl/Authen-SASL
|
30 |
|
dev-perl/Digest-HMAC"
|
|
32 |
systemd? ( sys-apps/systemd )
|
|
33 |
"
|
31 |
34 |
RDEPEND="${DEPEND}"
|
32 |
35 |
|
33 |
36 |
ETC_DIR="/etc/vdradmin"
|
... | ... | |
57 |
60 |
default
|
58 |
61 |
|
59 |
62 |
sed -i vdradmind.pl \
|
60 |
|
-e "s-FILES_IN_SYSTEM = 0;-FILES_IN_SYSTEM = 1;-g" || die
|
|
63 |
-e "s|FILES_IN_SYSTEM = 0;|FILES_IN_SYSTEM = 1;|g" || die
|
61 |
64 |
|
62 |
65 |
if use ipv6; then
|
63 |
|
sed -e "s:/usr/bin/vdradmind:/usr/bin/vdradmind --ipv6:" \
|
|
66 |
sed -e "s|/usr/bin/vdradmind|/usr/bin/vdradmind --ipv6|" \
|
64 |
67 |
-i "${WORKDIR}"/vdradmind.service || die
|
65 |
68 |
fi
|
66 |
69 |
|
67 |
70 |
if use ssl; then
|
68 |
|
sed -e "s:/usr/bin/vdradmind:/usr/bin/vdradmind --ssl:" \
|
|
71 |
sed -e "s|/usr/bin/vdradmind|/usr/bin/vdradmind --ssl|" \
|
69 |
72 |
-i "${WORKDIR}"/vdradmind.service || die
|
70 |
73 |
fi
|
71 |
74 |
}
|
... | ... | |
100 |
103 |
keepdir "${ETC_DIR}"
|
101 |
104 |
fowners "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" "${ETC_DIR}"
|
102 |
105 |
|
103 |
|
use ssl && keepdir "${CERTS_DIR}" && \
|
104 |
|
fowners "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" "${CERTS_DIR}"
|
|
106 |
if use ssl; then
|
|
107 |
keepdir "${CERTS_DIR}"
|
|
108 |
fowners "${VDRADMIN_USER}":"${VDRADMIN_GROUP}" "${CERTS_DIR}"
|
|
109 |
fi
|
105 |
110 |
}
|
106 |
111 |
|
107 |
112 |
pkg_preinst() {
|
... | ... | |
127 |
132 |
# Feed it with newlines
|
128 |
133 |
yes "" \
|
129 |
134 |
| "${ED}"/usr/bin/vdradmind --cfgdir "${ED}"${ETC_DIR} --config \
|
130 |
|
|sed -e 's/: /: \n/g'
|
|
135 |
|sed -e 's|: |: \n|g'
|
131 |
136 |
|
132 |
137 |
[[ ${PIPESTATUS[1]} == "0" ]] \
|
133 |
138 |
|| die "Failed to create initial configuration."
|
... | ... | |
145 |
150 |
tmpfiles_process vdradmind.conf
|
146 |
151 |
|
147 |
152 |
if use ipv6; then
|
148 |
|
elog
|
149 |
|
elog "To make use of the ipv6 protocol"
|
150 |
|
elog "you need to enable it in ${EROOT}/etc/conf.d/vdradmin"
|
|
153 |
if ! use systemd; then
|
|
154 |
elog
|
|
155 |
elog "To make use of the ipv6 protocol"
|
|
156 |
elog "you need to enable it in ${EROOT}/etc/conf.d/vdradmin"
|
|
157 |
fi
|
151 |
158 |
fi
|
152 |
159 |
|
153 |
160 |
if use ssl; then
|
154 |
|
elog
|
155 |
|
elog "To use ssl connection to your vdr"
|
156 |
|
elog "you need to enable it in ${EROOT}/etc/conf.d/vdradmin"
|
|
161 |
if ! use systemd; then
|
|
162 |
elog
|
|
163 |
elog "To use ssl connection to your vdr"
|
|
164 |
elog "you need to enable it in ${EROOT}/etc/conf.d/vdradmin"
|
|
165 |
fi
|
157 |
166 |
|
158 |
167 |
if [[ ! -f "${EROOT}"${CERTS_DIR}/server-cert.pem || \
|
159 |
168 |
! -f "${EROOT}"${CERTS_DIR}/server-key.pem ]]; then
|
... | ... | |
168 |
177 |
|
169 |
178 |
elog
|
170 |
179 |
elog "To extend ${PN} you can emerge"
|
171 |
|
elog "media-plugins/vdr-epgsearch to search the EPG,"
|
172 |
|
elog "media-plugins/vdr-streamdev for livetv streaming and/or"
|
173 |
|
elog "media-video/vdr with USE=\"liemikuutio/vasarajanauloja/none\" "
|
174 |
|
elog "(depend on your vdr version) to rename recordings"
|
|
180 |
elog " media-plugins/vdr-epgsearch to search the EPG"
|
|
181 |
elog " media-plugins/vdr-streamdev for livetv streaming"
|
175 |
182 |
elog "on the machine running the VDR you connect to with ${PN}."
|
176 |
183 |
}
|
177 |
184 |
|