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