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