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