Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-backup/amanda/
Date: Thu, 02 Mar 2017 20:36:13
Message-Id: 1488486962.5d1a0310418e71c0467712c9216b2b47f62d0f39.robbat2@gentoo
1 commit: 5d1a0310418e71c0467712c9216b2b47f62d0f39
2 Author: Stefan G. Weichinger <office <AT> oops <DOT> co <DOT> at>
3 AuthorDate: Wed Mar 1 17:48:50 2017 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 2 20:36:02 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d1a0310
7
8 app-backup/amanda: version bump to 3.4.3
9
10 (cherry picked from commit b2ef81c443097de5527d877b77816d79ffaa0887)
11 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
12
13 app-backup/amanda/Manifest | 1 +
14 app-backup/amanda/amanda-3.4.3.ebuild | 479 ++++++++++++++++++++++++++++++++++
15 2 files changed, 480 insertions(+)
16
17 diff --git a/app-backup/amanda/Manifest b/app-backup/amanda/Manifest
18 index 8427d0cfa64..8fcc112a08d 100644
19 --- a/app-backup/amanda/Manifest
20 +++ b/app-backup/amanda/Manifest
21 @@ -4,3 +4,4 @@ DIST amanda-3.3.7.tar.gz 4618547 SHA256 cd1534c7d9c5b97afcb52b189f05fb158972fadb
22 DIST amanda-3.3.9.tar.gz 4673301 SHA256 2520b95ca96f1d521d582b7c94bd631486e7029eda1de8e1887d74b323549a41 SHA512 345670a20cff335453e8dcbf457d1fcdb9f266e4a03d729c2b1ba762f4fac323de4a87713d0fd54c11ca244a08dc97fb8c641625f7fa81cb241b3c17748b1b7e WHIRLPOOL e149ab7dbc30cf3585e41d9fb338dd96ab4dd440e31723be51b8ccc9e5841f8dda31d3b89418474e31c7c2498f40177c646f03713c256a4d9341152e2ce2c8e4
23 DIST amanda-3.4.1.tar.gz 5338575 SHA256 1f69e9bdae774ac2394297dd9d7f98ccbce44ca9199317ada764ca173909d2ac SHA512 245bf334e36fe8b4361d9fc27ea7e7ef5bd2ecec74719caa16cc94d1ebb3abbef058e28d9afd85851654aaae0984531593a35c079d1ba4aed0fc5177e907ec16 WHIRLPOOL b9608456f28fb35137276f16ec24d79ae397a44450b42ec4fa28256763798dee623ab560ba0db147ff41d2abc57810e2318ae64741ea0a054a8ff853f4ad9c59
24 DIST amanda-3.4.2.tar.gz 5353734 SHA256 175c6a2ef57fe480ddeeefc920a93c8d1cde4111eec76d76e088101a53eeafac SHA512 dea44ffa5eb30318336395ccbd582df2f83da9a4cf91def2834a2e65b2e0f36cafc1911f6b73c3afb63be256484a78b006bdeb1db5b3ecf87dc59d34754987fd WHIRLPOOL af08e2b7b42cead569b69edfa264c1439d21d455e36ba5d346a74631e037773f20cd0563c6cdf95eeea0ee0e1e45328e553a5490ef4c66545acc1a3bd85570d0
25 +DIST amanda-3.4.3.tar.gz 5355137 SHA256 8ebca59d7b5fc64179fee3d9de4289cd9e8dbb49558e0a21228b06e16105d688 SHA512 5fa7a8c59961f87568d3459e6b5368e50c6cf74e1a6c7599faf5f85d537e72668775acc11009d1d5699ab92d1c21553b5b86e06b804c6a1ae04500889726694a WHIRLPOOL e1c4cd778d5c71994d2c74fef07948476f367fff42e666fb1b516035746c1e9562b9bf4579875e922c44f8dd65924bf9fec5ca7d30bbee0998540c4c319d18b0
26
27 diff --git a/app-backup/amanda/amanda-3.4.3.ebuild b/app-backup/amanda/amanda-3.4.3.ebuild
28 new file mode 100644
29 index 00000000000..9e26503c1a4
30 --- /dev/null
31 +++ b/app-backup/amanda/amanda-3.4.3.ebuild
32 @@ -0,0 +1,479 @@
33 +# Copyright 1999-2017 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +inherit autotools perl-module user systemd
38 +
39 +DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
40 +HOMEPAGE="http://www.amanda.org/"
41 +SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
42 +
43 +LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
44 +SLOT="0"
45 +IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
46 +
47 +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
48 +RDEPEND="sys-libs/readline:=
49 + virtual/awk
50 + app-arch/tar
51 + dev-lang/perl:=
52 + app-arch/dump
53 + net-misc/openssh
54 + >=dev-libs/glib-2.26.0
55 + dev-perl/JSON
56 + dev-perl/Encode-Locale
57 + nls? ( virtual/libintl )
58 + s3? ( >=net-misc/curl-7.10.0 )
59 + !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
60 + samba? ( net-fs/samba:= )
61 + kerberos? ( app-crypt/mit-krb5 )
62 + xfs? ( sys-fs/xfsdump )
63 + !minimal? (
64 + dev-perl/XML-Simple
65 + virtual/mailx
66 + app-arch/mt-st:=
67 + sys-block/mtx
68 + gnuplot? ( sci-visualization/gnuplot )
69 + app-crypt/aespipe
70 + app-crypt/gnupg
71 + )"
72 +
73 +DEPEND="${RDEPEND}
74 + virtual/pkgconfig
75 + nls? ( sys-devel/gettext )
76 + >=app-text/docbook-xsl-stylesheets-1.72.0
77 + app-text/docbook-xml-dtd
78 + dev-libs/libxslt
79 + dev-lang/swig
80 + "
81 +
82 +MYFILESDIR="${T}/files"
83 +ENVDIR="/etc/env.d"
84 +ENVDFILE="97amanda"
85 +TMPENVFILE="${T}/${ENVDFILE}"
86 +
87 +# This is a complete list of Amanda settings that the ebuild takes from the
88 +# build environment. This allows users to alter the behavior of the package as
89 +# upstream intended, but keeping with Gentoo style. We store a copy of them in
90 +# /etc/env.d/97amanda during the install, so that they are preserved for future
91 +# installed. This variable name must not start with AMANDA_, as we do not want
92 +# it captured into the env file.
93 +ENV_SETTINGS_AMANDA="
94 +AMANDA_GROUP_GID AMANDA_GROUP_NAME
95 +AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
96 +AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_TAPE_DEVICE AMANDA_SERVER_INDEX
97 +AMANDA_TAR_LISTDIR AMANDA_TAR
98 +AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
99 +AMANDA_CONFIG_NAME AMANDA_TMPDIR"
100 +
101 +amanda_variable_setup() {
102 +
103 + # Setting vars
104 + local currentamanda
105 +
106 + # Grab the current settings
107 + currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
108 +
109 + # First we set the defaults
110 + [[ -z "${AMANDA_GROUP_GID}" ]] && AMANDA_GROUP_GID=87
111 + [[ -z "${AMANDA_GROUP_NAME}" ]] && AMANDA_GROUP_NAME=amanda
112 + [[ -z "${AMANDA_USER_NAME}" ]] && AMANDA_USER_NAME=amanda
113 + [[ -z "${AMANDA_USER_UID}" ]] && AMANDA_USER_UID=87
114 + [[ -z "${AMANDA_USER_SH}" ]] && AMANDA_USER_SH=/bin/bash
115 + [[ -z "${AMANDA_USER_HOMEDIR}" ]] && AMANDA_USER_HOMEDIR=/var/spool/amanda
116 + [[ -z "${AMANDA_USER_GROUPS}" ]] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
117 +
118 + # This installs Amanda, with the server. However, it could be a client,
119 + # just specify an alternate server name in AMANDA_SERVER.
120 + [[ -z "${AMANDA_SERVER}" ]] && AMANDA_SERVER="${HOSTNAME}"
121 + [[ -z "${AMANDA_SERVER_TAPE}" ]] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
122 + [[ -z "${AMANDA_SERVER_TAPE_DEVICE}" ]] && AMANDA_SERVER_TAPE_DEVICE="/dev/nst0"
123 + [[ -z "${AMANDA_SERVER_INDEX}" ]] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
124 + [[ -z "${AMANDA_TAR_LISTDIR}" ]] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
125 + [[ -z "${AMANDA_CONFIG_NAME}" ]] && AMANDA_CONFIG_NAME=DailySet1
126 + [[ -z "${AMANDA_TMPDIR}" ]] && AMANDA_TMPDIR=/var/tmp/amanda
127 + [[ -z "${AMANDA_DBGDIR}" ]] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
128 + # These are left empty by default
129 + [[ -z "${AMANDA_PORTS_UDP}" ]] && AMANDA_PORTS_UDP=
130 + [[ -z "${AMANDA_PORTS_TCP}" ]] && AMANDA_PORTS_TCP=
131 + [[ -z "${AMANDA_PORTS_BOTH}" ]] && AMANDA_PORTS_BOTH=
132 + [[ -z "${AMANDA_PORTS}" ]] && AMANDA_PORTS=
133 +
134 + # What tar to use
135 + [[ -z "${AMANDA_TAR}" ]] && AMANDA_TAR=/bin/tar
136 +
137 + # Now pull in the old stuff
138 + if [[ -f "${EROOT}${ENVDIR}/${ENVDFILE}" ]]; then
139 + # We don't just source it as we don't want everything in there.
140 + eval $(egrep "^AMANDA_" "${EROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
141 + fi
142 +
143 + # Re-apply the new settings if any
144 + [ -n "${currentamanda}" ] && eval $(echo "${currentamanda}")
145 +
146 +}
147 +
148 +pkg_setup() {
149 + amanda_variable_setup
150 +
151 + # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
152 + # another host than HOSTNAME.
153 + if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
154 + elog "You are installing a client-only version of Amanda."
155 + elog "You should set the variable \$AMANDA_SERVER to point at your"
156 + elog "Amanda-tape-server, otherwise you will have to specify its name"
157 + elog "when using amrecover on the client."
158 + elog "For example: Use something like"
159 + elog "AMANDA_SERVER=\"myserver\" emerge amanda"
160 + elog
161 + fi
162 +
163 + enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
164 + enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
165 +}
166 +
167 +src_unpack() {
168 + # we do not want the perl src_unpack
169 + default_src_unpack
170 +}
171 +
172 +src_prepare() {
173 + # gentoo bug #331111
174 + sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am || die
175 + sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am || die
176 +
177 + # bug with glibc-2.16.0
178 + sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h || die
179 +
180 + eautoreconf
181 +
182 + # places for us to work in
183 + mkdir -p "${MYFILESDIR}" || die
184 + # Now we store the settings we just created
185 + set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}" || die
186 +
187 + # Prepare our custom files
188 + einfo "Building custom configuration files"
189 + local i # our iterator
190 + local sedexpr # var for sed expr
191 + sedexpr=''
192 + for i in ${ENV_SETTINGS_AMANDA} ; do
193 + local val
194 + eval "val=\"\${${i}}\""
195 + sedexpr="${sedexpr}s|__${i}__|${val}|g;"
196 + done
197 +
198 + # now apply the sed expr
199 + for i in "${FILESDIR}"/amanda-* ; do
200 + sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`" || die
201 + done
202 +
203 + if use minimal; then
204 + cat "${MYFILESDIR}"/amanda-amandahosts-server-2.5.1_p3-r1 > "${T}"/amandahosts || die
205 + else
206 + sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
207 + server-src/am{addclient,serverconfig}.pl || die
208 + cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 > "${T}"/amandahosts || die
209 + fi
210 +
211 + eapply_user
212 +}
213 +
214 +src_configure() {
215 + # fix bug #36316
216 + addpredict /var/cache/samba/gencache.tdb
217 + # fix bug #376169
218 + addpredict /run/blkid
219 + addpredict /etc/blkid.tab
220 +
221 + [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
222 + source "${TMPENVFILE}"
223 + local myconf
224 +
225 + einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
226 + myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
227 + einfo "Using ${AMANDA_SERVER_TAPE_DEVICE} for tape server."
228 + myconf="${myconf} --with-tape-device=${AMANDA_SERVER_TAPE_DEVICE}"
229 + einfo "Using ${AMANDA_SERVER_INDEX} for index server."
230 + myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
231 + einfo "Using ${AMANDA_USER_NAME} for amanda user."
232 + myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
233 + einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
234 + myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
235 + einfo "Using ${AMANDA_TAR} as Tar implementation."
236 + myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
237 + einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
238 + myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
239 + einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
240 + myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
241 + einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
242 + myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
243 +
244 + if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
245 + eerror "If you want _both_ UDP and TCP ports, please use only the"
246 + eerror "AMANDA_PORTS environment variable for identical ports, or set"
247 + eerror "AMANDA_PORTS_BOTH."
248 + die "Bad port setup!"
249 + fi
250 + if [ -n "${AMANDA_PORTS_UDP}" ]; then
251 + einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
252 + myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
253 + fi
254 + if [ -n "${AMANDA_PORTS_TCP}" ]; then
255 + einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
256 + myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
257 + fi
258 + if [ -n "${AMANDA_PORTS}" ]; then
259 + einfo "Using ports ${AMANDA_PORTS/,/-}"
260 + myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
261 + fi
262 +
263 + # Extras
264 + # Speed option
265 + myconf="${myconf} --with-buffered-dump"
266 + # "debugging" in the configuration is NOT debug in the conventional sense.
267 + # It is actually just useful output in the application, and should remain
268 + # enabled. There are some cases of breakage with MTX tape changers as of
269 + # 2.5.1p2 that it exposes when turned off as well.
270 + myconf="${myconf} --with-debugging"
271 + # Where to put our files
272 + myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
273 +
274 + # Samba support
275 + myconf="${myconf} $(use_with samba smbclient /usr/bin/smbclient)"
276 +
277 + # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
278 + # default
279 + myconf="${myconf} --with-bsd-security"
280 + myconf="${myconf} --with-ssh-security"
281 + myconf="${myconf} --with-bsdudp-security"
282 + myconf="${myconf} --with-bsdtcp-security"
283 +
284 + # kerberos-security mechanism version 5
285 + myconf="${myconf} $(use_with kerberos krb5-security)"
286 +
287 + # Amazon S3 support
288 + myconf="${myconf} `use_enable s3 s3-device`"
289 +
290 + # libcurl is required for S3 but otherwise optional
291 + if ! use s3; then
292 + myconf="${myconf} $(use_with curl libcurl)"
293 + fi
294 +
295 + # Client only, as requested in bug #127725
296 + if use minimal ; then
297 + myconf="${myconf} --without-server"
298 + else
299 + # amplot
300 + myconf="${myconf} $(use_with gnuplot)"
301 + fi
302 +
303 + # IPv6 fun.
304 + myconf="${myconf} `use_with ipv6`"
305 + # This is to prevent the IPv6-is-working test
306 + # As the test fails on binpkg build hosts with no IPv6.
307 + use ipv6 && export amanda_cv_working_ipv6=yes
308 +
309 + # I18N
310 + myconf="${myconf} `use_enable nls`"
311 +
312 + # Bug #296634: Perl location
313 + perl_set_version
314 + myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
315 +
316 + # Bug 296633: --disable-syntax-checks
317 + # Some tests are not safe for production systems
318 + myconf="${myconf} --disable-syntax-checks"
319 +
320 + # build manpages
321 + myconf="${myconf} --enable-manpage-build"
322 +
323 + # bug #483120
324 + tc-export AR
325 +
326 + econf \
327 + $(use_with readline) \
328 + ${myconf}
329 +}
330 +
331 +src_compile() {
332 + # Again, do not want the perl-module src_compile
333 + default_src_compile
334 +}
335 +
336 +src_install() {
337 + [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
338 + source ${TMPENVFILE}
339 +
340 + einfo "Doing stock install"
341 + emake DESTDIR="${D}" install || die
342 +
343 + # Build the envdir file
344 + # Don't forget this..
345 + einfo "Building environment file"
346 + (
347 + echo "# These settings are what was present in the environment when this"
348 + echo "# Amanda was compiled. Changing anything below this comment will"
349 + echo "# have no effect on your application, but it merely exists to"
350 + echo "# preserve them for your next emerge of Amanda"
351 + cat "${TMPENVFILE}" | sed "s,=\$,='',g"
352 + ) >> "${MYFILESDIR}/${ENVDFILE}"
353 +
354 + # Env.d
355 + einfo "Installing environment config file"
356 + doenvd "${MYFILESDIR}/${ENVDFILE}"
357 +
358 + # Lock down next section (up until docs).
359 + insopts -m0640
360 + # Installing Amanda Xinetd Services Definition
361 + einfo "Installing xinetd service file"
362 + insinto /etc/xinetd.d
363 + if use minimal ; then
364 + newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
365 + else
366 + newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
367 + fi
368 +
369 + if ! use minimal; then
370 + einfo "Installing Sample Daily Cron Job for Amanda"
371 + insinto /etc/cron.daily
372 + newins "${MYFILESDIR}/amanda-cron" amanda
373 + fi
374 +
375 + einfo "Installing systemd service and socket files for Amanda"
376 + systemd_dounit "${FILESDIR}"/amanda.socket || die
377 + systemd_newunit "${FILESDIR}"/amanda.service 'amanda@.service' || die
378 +
379 + insinto /etc/amanda
380 + einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
381 + doins "${T}/amandahosts"
382 + fperms 600 /etc/amanda/amandahosts
383 +
384 + dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
385 + insinto "${AMANDA_USER_HOMEDIR}"
386 + einfo "Installing .profile for ${AMANDA_USER_NAME} user"
387 + newins "${MYFILESDIR}/amanda-profile" .profile
388 +
389 + insinto /etc/amanda
390 + doins "${S}/example/amanda-client.conf"
391 + if ! use minimal ; then
392 + insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
393 + doins "${S}/example/amanda.conf"
394 + doins "${S}/example/disklist"
395 + keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
396 + fi
397 +
398 + keepdir "${AMANDA_TAR_LISTDIR}"
399 + keepdir "${AMANDA_USER_HOMEDIR}/amanda"
400 + keepdir "${AMANDA_TMPDIR}/dumps"
401 + # Just make sure it exists for XFS to work...
402 + use xfs && keepdir /var/xfsdump/inventory
403 +
404 + local i
405 + for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
406 + "${AMANDA_TMPDIR}" /etc/amanda; do
407 + einfo "Securing directory (${i})"
408 + fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
409 + done
410 + # Do NOT use -R
411 + fperms 0700 \
412 + "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
413 + "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
414 + "${AMANDA_USER_HOMEDIR}/amanda" \
415 + /etc/amanda
416 +
417 + if ! use minimal ; then
418 + fperms 0700 \
419 + "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
420 + /etc/amanda/${AMANDA_CONFIG_NAME}
421 + fi
422 +
423 + einfo "Setting setuid permissions"
424 + amanda_permissions_fix "${D}"
425 +
426 + # Relax permissions again
427 + insopts -m0644
428 +
429 + # docs
430 + einfo "Installing documentation"
431 + dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
432 + # our inetd sample
433 + einfo "Installing standard inetd sample"
434 + newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
435 + # Amanda example configs
436 + einfo "Installing example configurations"
437 + rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes}
438 + mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/"
439 + docinto example1
440 + newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
441 + newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
442 + newdoc "${FILESDIR}/example_global.conf" global.conf
443 +
444 + einfo "Cleaning up dud .la files"
445 + perl_set_version
446 + find "${D}"/"${VENDOR_LIB}" -name '*.la' -print0 |xargs -0 rm -f
447 +}
448 +
449 +pkg_postinst() {
450 + [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
451 + TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
452 + [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
453 + source "${TMPENVFILE}"
454 +
455 + # Migration of amandates from /etc to $localstatedir/amanda
456 + if [ -f "${ROOT}/etc/amandates" -a \
457 + ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
458 + einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
459 + einfo "A backup is also placed at /etc/amandates.orig"
460 + cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
461 + mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
462 + cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
463 + fi
464 + if [ -f "${ROOT}/etc/amandates" ]; then
465 + einfo "If you have migrated safely, please delete /etc/amandates"
466 + fi
467 +
468 + einfo "Checking setuid permissions"
469 + amanda_permissions_fix "${ROOT}"
470 +
471 + elog "You should configure Amanda in /etc/amanda now."
472 + elog
473 + elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
474 + elog "and restart xinetd afterwards!"
475 + elog
476 + elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
477 + elog "as an example of how to configure your inetd."
478 + elog
479 + elog "systemd-users: enable and start amanda.socket or the relevant services"
480 + elog "regarding what auth method you use."
481 + elog
482 + elog "NOTICE: If you need raw access to partitions you need to add the"
483 + elog "amanda user to the 'disk' group."
484 + elog
485 + elog "NOTICE: If you have a tape changer, you need to add the amanda user"
486 + elog "to the 'tape' group."
487 + elog
488 + elog "If you use localhost in your disklist your restores may break."
489 + elog "You should replace it with the actual hostname!"
490 + elog "Please also see the syntax changes to amandahosts."
491 + elog "The only exception is when you use the authentication method 'local'."
492 + elog
493 + elog "Please note that this package no longer explicitly depends on"
494 + elog "virtual/inetd, as it supports modes where an inetd is not needed"
495 + elog "(see bug #506028 for details)."
496 +}
497 +
498 +# We have had reports of amanda file permissions getting screwed up.
499 +# Losing setuid, becoming too lax etc.
500 +# ONLY root and users in the amanda group should be able to run these binaries!
501 +amanda_permissions_fix() {
502 + local root="$1"
503 + [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
504 + local le="/usr/libexec/amanda"
505 + for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
506 + "${le}"/rundump "${le}"/runtar "${le}"/dumper \
507 + "${le}"/planner ; do
508 + chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
509 + chmod u=srwx,g=rx,o= "${root}"/${i}
510 + done
511 +}