Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-backup/amanda: metadata.xml ChangeLog amanda-2.6.0_p2-r4.ebuild
Date: Wed, 19 Nov 2008 02:13:10
Message-Id: E1L2cZ1-0003WX-JD@stork.gentoo.org
1 robbat2 08/11/19 02:13:07
2
3 Modified: metadata.xml ChangeLog
4 Added: amanda-2.6.0_p2-r4.ebuild
5 Log:
6 Split out devpay support, as it is not for all users, thanks to Lisa Seelye <lisa@××××××.com>.
7 (Portage version: 2.2_rc14/cvs/Linux 2.6.28-rc2-00338-g65fc716 x86_64)
8
9 Revision Changes Path
10 1.14 app-backup/amanda/metadata.xml
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/amanda/metadata.xml?rev=1.14&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/amanda/metadata.xml?rev=1.14&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/amanda/metadata.xml?r1=1.13&r2=1.14
15
16 Index: metadata.xml
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/app-backup/amanda/metadata.xml,v
19 retrieving revision 1.13
20 retrieving revision 1.14
21 diff -p -w -b -B -u -u -r1.13 -r1.14
22 --- metadata.xml 18 Sep 2008 04:13:38 -0000 1.13
23 +++ metadata.xml 19 Nov 2008 02:13:07 -0000 1.14
24 @@ -15,5 +15,6 @@
25 <use>
26 <flag name='xfs'>Support for backing up raw XFS filesystems using xfsdump</flag>
27 <flag name='s3'>Support for backing up to the Amazon S3 system</flag>
28 + <flag name='devpay'>Support for using Amazon DevPay with S3</flag>
29 </use>
30 </pkgmetadata>
31
32
33
34 1.47 app-backup/amanda/ChangeLog
35
36 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/amanda/ChangeLog?rev=1.47&view=markup
37 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/amanda/ChangeLog?rev=1.47&content-type=text/plain
38 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/amanda/ChangeLog?r1=1.46&r2=1.47
39
40 Index: ChangeLog
41 ===================================================================
42 RCS file: /var/cvsroot/gentoo-x86/app-backup/amanda/ChangeLog,v
43 retrieving revision 1.46
44 retrieving revision 1.47
45 diff -p -w -b -B -u -u -r1.46 -r1.47
46 --- ChangeLog 24 Sep 2008 09:20:49 -0000 1.46
47 +++ ChangeLog 19 Nov 2008 02:13:07 -0000 1.47
48 @@ -1,6 +1,13 @@
49 # ChangeLog for app-backup/amanda
50 # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
51 -# $Header: /var/cvsroot/gentoo-x86/app-backup/amanda/ChangeLog,v 1.46 2008/09/24 09:20:49 robbat2 Exp $
52 +# $Header: /var/cvsroot/gentoo-x86/app-backup/amanda/ChangeLog,v 1.47 2008/11/19 02:13:07 robbat2 Exp $
53 +
54 +*amanda-2.6.0_p2-r4 (19 Nov 2008)
55 +
56 + 19 Nov 2008; Robin H. Johnson <robbat2@g.o> metadata.xml,
57 + +amanda-2.6.0_p2-r4.ebuild:
58 + Split out devpay support, as it is not for all users, thanks to Lisa
59 + Seelye <lisa@××××××.com>.
60
61 24 Sep 2008; Robin H. Johnson <robbat2@g.o>
62 amanda-2.6.0_p2-r2.ebuild, amanda-2.6.0_p2-r3.ebuild:
63
64
65
66 1.1 app-backup/amanda/amanda-2.6.0_p2-r4.ebuild
67
68 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/amanda/amanda-2.6.0_p2-r4.ebuild?rev=1.1&view=markup
69 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/amanda/amanda-2.6.0_p2-r4.ebuild?rev=1.1&content-type=text/plain
70
71 Index: amanda-2.6.0_p2-r4.ebuild
72 ===================================================================
73 # Copyright 1999-2008 Gentoo Foundation
74 # Distributed under the terms of the GNU General Public License v2
75 # $Header: /var/cvsroot/gentoo-x86/app-backup/amanda/amanda-2.6.0_p2-r4.ebuild,v 1.1 2008/11/19 02:13:07 robbat2 Exp $
76
77 inherit autotools eutils
78
79 DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
80 HOMEPAGE="http://www.amanda.org/"
81 SRC_URI="mirror://sourceforge/amanda/${P/_/}.tar.gz"
82 LICENSE="as-is"
83 SLOT="0"
84 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
85 RDEPEND="sys-libs/readline
86 virtual/inetd
87 sys-apps/gawk
88 app-arch/tar
89 dev-lang/perl
90 app-arch/dump
91 net-misc/openssh
92 dev-libs/glib
93 s3? ( net-misc/curl )
94 samba? ( net-fs/samba )
95 kerberos? ( app-crypt/mit-krb5 )
96 !sparc? ( xfs? ( sys-fs/xfsdump ) )
97 !minimal? ( virtual/mailx
98 app-arch/mt-st
99 sys-block/mtx
100 sci-visualization/gnuplot
101 app-crypt/aespipe
102 app-crypt/gnupg )"
103
104 DEPEND="${RDEPEND}
105 sys-devel/autoconf
106 sys-devel/automake"
107
108 IUSE="berkdb debug gdbm minimal s3 samba xfs kerberos devpay"
109
110 S="${WORKDIR}/${P/_/}"
111 MYFILESDIR="${WORKDIR}/files"
112 MYTMPDIR="${WORKDIR}/tmp"
113 MYINSTTMPDIR="/usr/share/amanda"
114 ENVDIR="/etc/env.d"
115 ENVDFILE="97amanda"
116 TMPENVFILE="${MYTMPDIR}/${ENVDFILE}"
117 TMPINSTENVFILE="${MYINSTTMPDIR}/tmpenv-${ENVDFILE}"
118
119 # This is a complete list of Amanda settings that the ebuild takes from the
120 # build environment. This allows users to alter the behavior of the package as
121 # upstream intended, but keeping with Gentoo style. We store a copy of them in
122 # /etc/env.d/97amanda during the install, so that they are preserved for future
123 # installed. This variable name must not start with AMANDA_, as we do not want
124 # it captured into the env file.
125 ENV_SETTINGS_AMANDA="
126 AMANDA_GROUP_GID AMANDA_GROUP_NAME
127 AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
128 AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_INDEX
129 AMANDA_TAR_LISTDIR AMANDA_TAR
130 AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
131 AMANDA_CONFIG_NAME AMANDA_TMPDIR AMANDA_MAX_TAPE_BLOCK_KB"
132
133 amanda_variable_setup() {
134
135 # Setting vars
136 local currentamanda
137
138 # Grab the current settings
139 currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
140 use debug && einfo "Current settings: ${currentamanda}"
141 #for i in ${currentamanda}; do
142 # eval `eval echo ${i}`
143 # echo "Setting: ${i}"
144 #done;
145
146 # First we set the defaults
147 [ -z "${AMANDA_GROUP_GID}" ] && AMANDA_GROUP_GID=87
148 [ -z "${AMANDA_GROUP_NAME}" ] && AMANDA_GROUP_NAME=amanda
149 [ -z "${AMANDA_USER_NAME}" ] && AMANDA_USER_NAME=amanda
150 [ -z "${AMANDA_USER_UID}" ] && AMANDA_USER_UID=87
151 [ -z "${AMANDA_USER_SH}" ] && AMANDA_USER_SH=-1
152 [ -z "${AMANDA_USER_HOMEDIR}" ] && AMANDA_USER_HOMEDIR=/var/spool/amanda
153 [ -z "${AMANDA_USER_GROUPS}" ] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
154
155 # This installs Amanda, with the server. However, it could be a client,
156 # just specify an alternate server name in AMANDA_SERVER.
157 [ -z "${AMANDA_SERVER}" ] && AMANDA_SERVER="${HOSTNAME}"
158 [ -z "${AMANDA_SERVER_TAPE}" ] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
159 [ -z "${AMANDA_SERVER_INDEX}" ] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
160 [ -z "${AMANDA_TAR_LISTDIR}" ] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
161 [ -z "${AMANDA_CONFIG_NAME}" ] && AMANDA_CONFIG_NAME=DailySet1
162 [ -z "${AMANDA_TMPDIR}" ] && AMANDA_TMPDIR=/var/tmp/amanda
163 [ -z "${AMANDA_DBGDIR}" ] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
164 # These are left empty by default
165 [ -z "${AMANDA_PORTS_UDP}" ] && AMANDA_PORTS_UDP=
166 [ -z "${AMANDA_PORTS_TCP}" ] && AMANDA_PORTS_TCP=
167 [ -z "${AMANDA_PORTS_BOTH}" ] && AMANDA_PORTS_BOTH=
168 [ -z "${AMANDA_PORTS}" ] && AMANDA_PORTS=
169
170 # What tar to use
171 [ -z "${AMANDA_TAR}" ] && AMANDA_TAR=/bin/tar
172
173 # Text mode is the only one left.
174 AMANDA_DBMODE='text'
175
176 # Raise maximum configurable blocksize
177 [ -z "${AMANDA_MAX_TAPE_BLOCK_KB}" ] && AMANDA_MAX_TAPE_BLOCK_KB=512
178
179 # Now pull in the old stuff
180 if [ -f "${ENVDIR}/${ENVDFILE}" ]; then
181 # We don't just source it as we don't want everything in there.
182 eval $(egrep "^AMANDA_" ${ENVDIR}/${ENVDFILE} | grep -v '^AMANDA_ENV_SETTINGS')
183 fi
184
185 # Re-apply the new settings if any
186 [ -n "${currentamanda}" ] && eval `echo "${currentamanda}"`
187
188 }
189
190 pkg_setup() {
191 # Now add users if needed
192 [ -n "${AMANDA_DBMODE}" -a "${AMANDA_DBMODE}" != "text" ] && \
193 ewarn "Using db or gdbm modes for the database is no longer supported."
194 amanda_variable_setup
195 enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
196 enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
197 }
198
199 src_unpack() {
200 unpack ${A}
201
202 # Gentoo bug #192296, chg-multi fails
203 #EPATCH_OPTS="-d ${S}" epatch \
204 # "${FILESDIR}"/${PN}-2.5.2_p1-chg-multi.patch \
205 # || die "Failed to apply patch to correct typo in chg-multi!"
206
207 # Gentoo bug #212970, --as-needed linking
208 #EPATCH_OPTS="-d ${S}" epatch \
209 # "${FILESDIR}"/${PN}-2.5.2_p1-fix-asneeded.patch \
210 # || die "Failed to apply patch to correct bug #212970!"
211
212 # Fix a fun race condition if you use encryption.
213 # This is one of the reasons you should test your recovery procedures often.
214 EPATCH_OPTS="-d ${S} -p1" epatch \
215 "${FILESDIR}"/${PN}-2.6.0p2-amcrypt-ossl-asym-race-fix.patch \
216 || die "Failed to apply race fix for encryption"
217
218 cd "${S}"
219 epatch "${FILESDIR}"/s3-list-keys.diff
220 cd "${S}"/device-src
221 epatch "${FILESDIR}"/s3.c.part2.diff
222
223 cd "${S}"
224 #sed -i 's,amanda_working_ipv6,amanda_cv_working_ipv6,g' \
225 # "${S}"/configure.in || die "failed to sed"
226 # rm -f "${S}"/acinclude.m4
227 eautomake
228
229 # now the real fun
230 amanda_variable_setup
231 # places for us to work in
232 mkdir -p "${MYFILESDIR}" "${MYTMPDIR}"
233 # Now we store the settings we just created
234 set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}"
235 }
236
237 src_compile() {
238 # fix bug #36316
239 addpredict /var/cache/samba/gencache.tdb
240
241 [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
242 source "${TMPENVFILE}"
243 local myconf
244 cd "${S}"
245
246 einfo "Using '${AMANDA_DBMODE}' style database"
247 myconf="${myconf} --with-db=${AMANDA_DBMODE}"
248 einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
249 myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
250 einfo "Using ${AMANDA_SERVER_INDEX} for index server."
251 myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
252 einfo "Using ${AMANDA_USER_NAME} for amanda user."
253 myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
254 einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
255 myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
256 einfo "Using ${AMANDA_TAR} as Tar implementation."
257 myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
258 einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
259 myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
260 einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
261 myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
262 einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
263 myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
264
265 if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
266 eerror "If you want _both_ UDP and TCP ports, please use only the"
267 eerror "AMANDA_PORTS environment variable for identical ports, or set"
268 eerror "AMANDA_PORTS_BOTH."
269 die "Bad port setup!"
270 fi
271 if [ -n "${AMANDA_PORTS_UDP}" ]; then
272 einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
273 myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
274 fi
275 if [ -n "${AMANDA_PORTS_TCP}" ]; then
276 einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
277 myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
278 fi
279 if [ -n "${AMANDA_PORTS}" ]; then
280 einfo "Using ports ${AMANDA_PORTS/,/-}"
281 myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
282 fi
283
284 # Extras
285 # Speed option
286 myconf="${myconf} --with-buffered-dump"
287 # "debugging" in the configuration is NOT debug in the conventional sense.
288 # It is actually just useful output in the application, and should remain
289 # enabled. There are some cases of breakage with MTX tape changers as of
290 # 2.5.1p2 that it exposes when turned off as well.
291 myconf="${myconf} --with-debugging"
292 # Where to put our files
293 myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
294
295 # Samba support
296 myconf="${myconf} `use_with samba smbclient /usr/bin/smbclient`"
297
298 # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
299 # default
300 myconf="${myconf} --with-bsd-security"
301 myconf="${myconf} --with-ssh-security"
302 myconf="${myconf} --with-bsdudp-security"
303 myconf="${myconf} --with-bsdtcp-security"
304
305 # kerberos-security mechanism version 4
306 # always disable, per bug #173354
307 myconf="${myconf} --without-krb4-security"
308
309 # kerberos-security mechanism version 5
310 myconf="${myconf} `use_with kerberos krb5-security`"
311
312 # Amazon S3 support
313 myconf="${myconf} `use_enable s3 s3-device`"
314 myconf="${myconf} `use_enable devpay devpay`"
315
316 # Client only, as requested in bug #127725
317 use minimal && myconf="${myconf} --without-server"
318
319 # Raise maximum configurable blocksize
320 myconf="${myconf} --with-maxtapeblocksize=${AMANDA_MAX_TAPE_BLOCK_KB}"
321
322 econf ${myconf} || die "econf failed!"
323 emake -j1 || die "emake failed!"
324
325 # Compile the tapetype program too
326 # This is deprecated, use amtapetype instead!
327 # cd tape-src
328 # emake tapetype || die "emake tapetype failed!"
329
330 # Only needed if you we do versioning
331 #dosed "s,/usr/local/bin/perl,/usr/bin/perl," ${S}/contrib/set_prod_link.pl
332 #perl ${S}/contrib/set_prod_link.pl
333
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 -j1 DESTDIR="${D}" install || die
342
343 # Prepare our custom files
344 einfo "Building custom configuration files"
345 cp "${FILESDIR}"/amanda-* "${MYFILESDIR}"
346 local i # our iterator
347 local sedexpr # var for sed expr
348 sedexpr=''
349 for i in ${ENV_SETTINGS_AMANDA} ; do
350 local val
351 eval "val=\"\${${i}}\""
352 sedexpr="${sedexpr}s|__${i}__|${val}|g;"
353 done
354 #einfo "Compiled SED expression: '${sedexpr}'"
355
356 # now apply the sed expr
357 for i in "${FILESDIR}"/amanda-* ; do
358 local filename
359 filename="`basename ${i}`"
360 #einfo "Applying compiled SED expression to ${filename}"
361 sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}"/${filename}
362 done
363
364 # Build the envdir file
365 # Don't forget this..
366 einfo "Building environment file"
367 local t
368 t="${MYFILESDIR}"/${ENVDFILE}
369 echo "# These settings are what was present in the environment when this" >>"${t}"
370 echo "# Amanda was compiled. Changing anything below this comment will" >>"${t}"
371 echo "# have no effect on your application, but it merely exists to" >>"${t}"
372 echo "# preserve them for your next emerge of Amanda" >>"${t}"
373 cat "${TMPENVFILE}" | sed "s,=\$,='',g" >>"${t}"
374
375 into /usr
376
377 # Deprecated, use amtapetype instead
378 #einfo "Installing tapetype utility"
379 #newsbin tape-src/tapetype tapetype
380
381 # docs
382 einfo "Installing documentation"
383 dodoc AUTHORS C* INSTALL NEWS README
384 # Clean up some bits
385 dodoc /usr/share/amanda/*
386 rm -rf "${D}"/usr/share/amanda
387 mkdir -p "${D}"/${MYINSTTMPDIR} || die
388 cp "${TMPENVFILE}" "${D}"/${TMPINSTENVFILE} || die
389 # our inetd sample
390 einfo "Installing standard inetd sample"
391 newdoc "${MYFILESDIR}"/amanda-inetd.amanda.sample-2.6.0_p2-r2 amanda-inetd.amanda.sample
392 # Stock extra docs
393 docinto docs
394 dodoc "${S}"/docs/*
395 # Labels
396 einfo "Installing labels"
397 docinto labels
398 dodoc "${S}"/example/3hole.ps
399 dodoc "${S}"/example/8.5x11.ps
400 dodoc "${S}"/example/DIN-A4.ps
401 dodoc "${S}"/example/DLT.ps
402 dodoc "${S}"/example/EXB-8500.ps
403 dodoc "${S}"/example/HP-DAT.ps
404 # Amanda example configs
405 einfo "Installing example configurations"
406 docinto example
407 dodoc "${S}"/example/*
408 docinto example1
409 newdoc "${FILESDIR}"/example_amanda.conf amanda.conf
410 newdoc "${FILESDIR}"/example_disklist-2.5.1_p3-r1 disklist
411 newdoc "${FILESDIR}"/example_global.conf global.conf
412 docinto example2
413 newdoc "${S}"/example/amanda.conf amanda.conf
414 newdoc "${S}"/example/disklist disklist
415 # Compress it all
416 prepalldocs
417
418 # Just make sure it exists for XFS to work...
419 use !sparc && use xfs && keepdir /var/xfsdump/inventory
420
421 insinto /etc/amanda
422 einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
423
424 cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 \
425 >>"${D}"/etc/amanda/amandahosts
426 use minimal \
427 || cat "${MYFILESDIR}"/amanda-amandahosts-server-2.5.1_p3-r1 \
428 >>"${D}"/etc/amanda/amandahosts
429
430 dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}"/.amandahosts
431 insinto "${AMANDA_USER_HOMEDIR}"
432 einfo "Installing .profile for ${AMANDA_USER_NAME} user"
433 newins "${MYFILESDIR}"/amanda-profile .profile
434
435 einfo "Installing Sample Daily Cron Job for Amanda"
436 CRONDIR=/etc/cron.daily/
437 exeinto ${CRONDIR}
438 newexe "${MYFILESDIR}"/amanda-cron amanda
439 # Not executable by default
440 fperms 644 ${CRONDIR}/amanda
441
442 insinto /etc/amanda/${AMANDA_CONFIG_NAME}
443 keepdir /etc/amanda
444 keepdir /etc/amanda/${AMANDA_CONFIG_NAME}
445
446 local i
447 for i in ${AMANDA_USER_HOMEDIR} ${AMANDA_TAR_LISTDIR} \
448 ${AMANDA_TMPDIR} ${AMANDA_TMPDIR}/dumps \
449 ${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME} \
450 /etc/amanda /etc/amanda/${AMANDA_CONFIG_NAME}; do
451 einfo "Securing directory (${i})"
452 dodir ${i}
453 keepdir ${i}
454 fowners ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
455 fperms 700 ${i}
456 done
457
458 einfo "Setting setuid permissions"
459 amanda_permissions_fix "${D}"
460
461 # DevFS
462 einfo "Installing DevFS config file"
463 insinto /etc/devfs.d
464 newins "${MYFILESDIR}"/amanda-devfs amanda
465
466 # Env.d
467 einfo "Installing environment config file"
468 doenvd "${MYFILESDIR}"/${ENVDFILE}
469
470 # Installing Amanda Xinetd Services Definition
471 einfo "Installing xinetd service file"
472 insinto /etc/xinetd.d
473 newins "${MYFILESDIR}"/amanda-xinetd-2.6.0_p2-r2 amanda
474
475 }
476
477 do_initial() {
478 path="$1"
479 shift
480 for i in $* ; do
481 einfo "Creating inital Amanda file (${i}) in $path"
482 touch "${ROOT}"/${path}/${i}
483 chown ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} "${ROOT}"/${path}/${i}
484 chmod 600 "${ROOT}"/${path}/${i}
485 done
486 }
487
488 pkg_postinst() {
489 local aux="${ROOT}"/${TMPINSTENVFILE}
490 [ ! -f "${aux}" ] && die "Variable setting file (${aux}) should exist!"
491 source "${aux}"
492 rm "${aux}"
493 rmdir "${ROOT}"/${MYINSTTMPDIR} 2>/dev/null # ignore error
494
495 # Migration of amandates from /etc to $localstatedir/amanda
496 if [ -f "${ROOT}/etc/amandates" -a \
497 ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
498 einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
499 einfo "A backup is also placed at /etc/amandates.orig"
500 cp -f "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
501 mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
502 cp -f "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
503 fi
504 if [ -f "${ROOT}/etc/amandates" ]; then
505 einfo "If you have migrated safely, please delete /etc/amandates"
506 fi
507 # Do setups
508 do_initial /etc dumpdates
509 do_initial "${AMANDA_USER_HOMEDIR}/amanda" amandates
510
511 # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
512 # another host than HOSTNAME.
513 if use minimal; then
514 if [[ "${AMANDA_SERVER}" = "${HOSTNAME}" ]]; then
515 echo
516 ewarn "You are installing a client-only version of Amanda."
517 ewarn "You should set the variable $AMANDA_SERVER to point at your"
518 ewarn "Amanda-tape-server, otherwise you will have to specify its name"
519 ewarn "when using amrecover on the client."
520 ewarn "For example: Use something like"
521 ewarn "AMANDA_SERVER=\"myserver\" emerge amanda"
522 echo
523 fi
524 fi
525
526 einfo "Checking setuid permissions"
527 amanda_permissions_fix "${ROOT}"
528
529 elog "You should configure Amanda in /etc/amanda now."
530 elog
531 elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
532 elog "and restart xinetd afterwards!"
533 elog
534 elog "Otherwise, please look at /usr/share/doc/${P}/inetd.amanda.sample"
535 elog "as an example of how to configure your inetd."
536 elog
537 elog "NOTICE: If you need raw access to partitions you need to add the"
538 elog "amanda user to the 'disk' group and uncomment following lines in"
539 elog "your /etc/devfs.d/amanda:"
540 elog "SCSI:"
541 elog "REGISTER ^scsi/host.*/bus.*/target.*/lun.*/part[0-9] PERMISSIONS root.disk 660"
542 elog "IDE:"
543 elog "REGISTER ^ide/host.*/bus.*/target.*/lun.*/part[0-9] PERMISSIONS root.disk 660"
544 elog
545 elog "NOTICE: If you have a tape changer, also uncomment the following"
546 elog "REGISTER ^scsi/host.*/bus.*/target.*/lun.*/generic PERMISSIONS root.disk 660"
547 elog
548 elog "If you use localhost in your disklist your restores may break."
549 elog "You should replace it with the actual hostname!"
550 elog "Please also see the syntax changes to amandahosts."
551 }
552
553 # We have had reports of amanda file permissions getting screwed up.
554 # Losing setuid, becoming too lax etc.
555 # ONLY root and users in the amanda group should be able to run these binaries!
556 amanda_permissions_fix() {
557 local root="$1"
558 [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
559 local le="/usr/libexec/amanda"
560 for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
561 "${le}"/rundump "${le}"/runtar "${le}"/dumper \
562 "${le}"/planner ; do
563 chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
564 chmod u=srwx,g=rx,o= "${root}"/${i}
565 done
566 }