- 2008-03-31 Dan Locks <dwlocks@zmanda.com>
+2008-05-13 Dan Locks <dwlocks@zmanda.com>
+ * packaging/deb/buildpkg: modified build script to create unsigned
+ packages
+
+2008-05-12 Jean-Louis Martineau <martineau@zmanda.com>
+ Patch by Orion Poplawski
+ * server-src/planner.c: Warn about overwrite of last level 1, and
+ force backup of level 1 if overwrite on this run.
+
+2008-05-12 Dustin J. Mitchell <dustin@zmanda.com>
+ * server-src/dumper.c server-src/server_util.c
+ server-src/infofile.c server-src/amtrmlog.c common-src/debug.c
+ common-src/file.c: Always call mkpdir without the 02000 bit set,
+ as it is not needed and causes problems on MacOS X.
+
+2008-05-08 Jean-Louis Martineau <martineau@zmanda.com>
+ * packaging/deb/buildpkg packaging/rpm/buildpkg: AMVER=amanda-2.6.0p1
+ * packaging/deb/changelog: amanda (2.6.0p1-1)
+ * packaging/deb/rules: AMVER=2.6.0p1
+ * packaging/rpm/amanda.spec: amanda_version 2.6.0p1, amanda_release 1
+ * NEWS: Update for 2.6.0p1
+ * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0p1")
+
+2008-05-08 Jean-Louis Martineau <martineau@zmanda.com>
+ * common-src/conffile.c: Define default tapetype.
+
+2008-05-07 Jean-Louis Martineau <martineau@zmanda.com>
+ * common-src/conffile.c: Check the tapetype is defined.
+
+2008-05-07 Jean-Louis Martineau <martineau@zmanda.com>
+ * device-src/tape-device.c: Allow user to set "read_buffer_size"
+ property.
+ * restore-src/amrestore.c: Don't limit blocksize to
+ --with-maxtapeblocksize.
+ * common-src/conffile.c: Increase readblocksize to blocksize.
+ blocksize and readblocksize can be bigger than
+ --with-maxtapeblocksize.
+
+2008-05-02 Dan Locks <dwlocks@zmanda.com>
+ * packaging/rpm/amanda.spec: Replace ${ with %{ where applicable.
+
+2008-04-23 Jean-Louis Martineau <martineau@zmanda.com>
+ * common-src/security-util.c: Typo.
+
+2008-04-23 Jean-Louis Martineau <martineau@zmanda.com>
+ * server-src/driver.c: Always sent a FAILED to taper if dumper failed.
+
+2008-04-23 Jean-Louis Martineau <martineau@zmanda.com>
+ * server-src/planner.c: Fix vstrextend use.
+
+2008-04-16 Dan Locks <dwlocks@zmanda.com>
+ * Fixes to debian package reported by daniel_P
+ * packaging/deb/preinst: remove spaces near ${amanda_group}
+ * packaging/deb/amanda-backup-server.dirs
+ packaging/deb/amanda-backup-client.dirs: added var/amanda and
+ usr/share/lintian/overrides
+ * packaging/deb/rules: added logic to find PERLSITELIB and append that
+ to amanda-backup-server.install, removed broken brace expansion
+ * packaging/deb/buildpkg: removed extraneous configure step
+ * packaging/deb/amanda-backup-server.postinst: added check for correct
+ permissions on /tmp/amanda
+
+2008-04-16 Jean-Louis Martineau <martineau@zmanda.com>
+ * server-src/amadmin.c: Improve message.
+ * man/xml-source/amanda.conf.5.xml: Fix man page.
+ * server-src/planner.c: Fix DS_INCRONLY and FORCE_FULL
+
+2008-04-16 Dustin J. Mitchell <dustin@zmanda.com>
+ * config/amanda/dumpers.m4: continue searching for gnutar if we
+ find a binary claiming to be gnu tar that is not. This gets
+ around serious breakage on Ubuntu, where star is installed as
+ /bin/gnutar, but /bin/tar is actually GNU Tar.
+
+2008-04-15 Dustin J. Mitchell <dustin@zmanda.com>
+ * common-src/file.c(mk1dir): fix reversed conditional to handle
+ a race condition
+
+2008-04-15 Jean-Louis Martineau <martineau@zmanda.com>
+ * common-src/debug.c (debug_logging_handler, debug_printf): Don't print
+ msg_timestamp() to stderr.
+
+2008-04-15 Jean-Louis Martineau <martineau@zmanda.com>
+ * server-src/find.c (dumps_match_dumpspecs): New function to only keep
+ dumps that match a dumpspecs, using it simplify amfetchdump.
+ * server-src/find.h (dumps_match_dumpspecs): Prototype.
+ * restore-src/amrestore.c: Add a first_restored_file to
+ search_a_tape(), to allow restore ot stop after the first image.
+ * restore-src/restore.c: Set first_restored_file, it was never set,
+ it's needed to stop after the first image.
+ * restore-src/restore.c (restore_from_tapelist): break if piping to
+ stdout.
+ * restore-src/amfetchdump.c: Use dumps_match_dumpspecs.
+ * restore-src/amfetchdump.c: If -p, the keep only one dump.
+ * perl/Amanda/Logfile.swg (dumps_match_dumpspecs): New prototype.
+ * perl/Amanda/Cmdline.swg: cmdline_parse_dumpspecs.
+ * perl/amglue/dumpspecs.swg: Map dumpspecs to perl.
+ * perl/Makefile.am (AMGLUE_SWG): Add amglue/dumpspecs.swg.
+
+2008-04-15 Jean-Louis Martineau <martineau@zmanda.com>
+ * tape-src/tapetype.c: Initialize an default config.
+
+2008-04-15 Jean-Louis Martineau <martineau@zmanda.com>
+ * common-src/util.c (connect_portrange, connect_port, bind_portrange):
+ Return the latest errno reported.
+
+2008-04-04 Jean-Louis Martineau <martineau@zmanda.com>
+ * man/xml-source/*.xml: Use ulink tag to link to wiki.zmanda.com.
+
+2008-04-04 Jean-Louis Martineau <martineau@zmanda.com>
+ * restore-src/restore.c: Check last_header->type != F_UNKNOWN.
+
+2008-03-31 Dan Locks <dwlocks@zmanda.com>
* packaging/deb/buildpkg
packaging/rpm/buildpkg: added -p to cp to preserve file timestamps.
+Changes in release 2.6.0p1
+
+ * Bugs fix only:
+ o amfetchdump -p
+ o amtapetype crash
+ o Fix DS_INCRONLY and FORCE_FULL
+ o planner crash
+ o others small bugs
+
Changes in release 2.6.0
* configure --disable-shared doesn't work because perl modules require
_("tapetype parameter expected"), 1, copy_tapetype);
get_conftoken(CONF_NL);
+ if (tapetype_get_readblocksize(&tpcur) <
+ tapetype_get_blocksize(&tpcur)) {
+ conf_init_size(&tpcur.value[TAPETYPE_READBLOCKSIZE],
+ tapetype_get_blocksize(&tpcur));
+ }
save_tapetype();
allow_overwrites = save_overwrites;
if(val_t__size(val) < DISK_BLOCK_KB) {
conf_parserror(_("Tape blocksize must be at least %d KBytes"),
DISK_BLOCK_KB);
- } else if(val_t__size(val) > MAX_TAPE_BLOCK_KB) {
- conf_parserror(_("Tape blocksize must not be larger than %d KBytes"),
- MAX_TAPE_BLOCK_KB);
}
}
val_t__int(v) = getconf_int(CNF_NETUSAGE);
val_t__seen(v) = getconf_seen(CNF_NETUSAGE);
}
+
+ /* Check the tapetype is defined */
+ if (lookup_tapetype(getconf_str(CNF_TAPETYPE)) == NULL) {
+ /* Create a default tapetype */
+ if (!getconf_seen(CNF_TAPETYPE) &&
+ strcmp(getconf_str(CNF_TAPETYPE), "EXABYTE") == 0 &&
+ !lookup_tapetype("EXABYTE")) {
+ init_tapetype_defaults();
+ tpcur.name = stralloc("EXABYTE");
+ tpcur.seen = -1;
+ save_tapetype();
+ } else {
+ conf_parserror(_("tapetype %s is not defined"),
+ getconf_str(CNF_TAPETYPE));
+ }
+ }
}
/* fill in the debug_* values */
}
for(tp = tapelist; tp != NULL; tp = tp->next) {
- g_printf("\nDEFINE TAPETYPE %s {\n", tp->name);
+ if(tp->seen == -1)
+ prefix = "#";
+ else
+ prefix = "";
+ g_printf("\n%sDEFINE TAPETYPE %s {\n", prefix, tp->name);
for(i=0; i < TAPETYPE_TAPETYPE; i++) {
for(np=tapetype_var; np->token != CONF_UNKNOWN; np++)
if(np->parm == i) break;
if(kt->token == CONF_UNKNOWN)
error(_("tapetype bad token"));
- val_t_print_token(stdout, NULL, " %-9s ", kt, &tp->value[i]);
+ val_t_print_token(stdout, prefix, " %-9s ", kt, &tp->value[i]);
}
- g_printf("}\n");
+ g_printf("%s}\n", prefix);
}
for(dp = dumplist; dp != NULL; dp = dp->next) {
}
if (erroutput_type & ERR_INTERACTIVE) {
- g_fprintf(stderr, "%s: %s: %s\n", get_pname(), msg_timestamp(), message);
+ g_fprintf(stderr, "%s: %s\n", get_pname(), message);
fflush(stderr);
}
dbgdir = vstralloc(AMANDA_DBGDIR, "/", subdir, "/", NULL);
else
dbgdir = stralloc2(AMANDA_DBGDIR, "/");
- if(mkpdir(dbgdir, 02700, get_client_uid(), get_client_gid()) == -1) {
+ if(mkpdir(dbgdir, 0700, get_client_uid(), get_client_gid()) == -1) {
error(_("create debug directory \"%s\": %s"),
dbgdir, strerror(errno));
/*NOTREACHED*/
db_file = stderr;
}
if(db_file != NULL) {
- g_fprintf(db_file, "%s: %s: ", msg_timestamp(), get_pname());
+ if (db_file != stderr)
+ g_fprintf(db_file, "%s: %s: ", msg_timestamp(), get_pname());
+ else
+ g_fprintf(db_file, "%s: ", get_pname());
arglist_start(argp, format);
g_vfprintf(db_file, format, argp);
arglist_end(argp);
mk1dir(
const char *dir, /* directory to create */
mode_t mode, /* mode for new directory */
- uid_t G_GNUC_UNUSED uid, /* uid for new directory */
- gid_t G_GNUC_UNUSED gid) /* gid for new directory */
+ uid_t uid, /* uid for new directory */
+ gid_t gid) /* gid for new directory */
{
int rc; /* return code */
rc = mkdir(dir, mode);
- if(rc != 0) { /* maybe someone beat us to it */
+ if(rc != 0) {
int serrno;
serrno = errno;
- if(access(dir, F_OK) != 0)
- rc = -1;
- errno = serrno; /* pass back the real error */
+ if(access(dir, F_OK) == 0)
+ rc = 0; /* someone just beat us to it, so it's OK */
+ errno = serrno;
}
/* mkdir is affected by umask, so set the mode bits manually */
if (client_uid != (uid_t) -1) {
#if defined(AMANDA_DBGDIR)
d = stralloc2(AMANDA_DBGDIR, "/.");
- (void) mkpdir(d, (mode_t)02700, client_uid, client_gid);
+ (void) mkpdir(d, (mode_t)0700, client_uid, client_gid);
amfree(d);
#endif
d = stralloc2(AMANDA_TMPDIR, "/.");
- (void) mkpdir(d, (mode_t)02700, client_uid, client_gid);
+ (void) mkpdir(d, (mode_t)0700, client_uid, client_gid);
amfree(d);
}
#define CC "gcc"
-#define BUILT_DATE "Mon Mar 31 20:02:23 EDT 2008"
+#define BUILT_DATE "Wed May 14 17:05:51 EDT 2008"
#define BUILT_MACH "x86_64-unknown-linux-gnu"
if (getgrgid_r(sbuf.st_gid, &gr, buf, buflen, &grptr) != 0 ||
grptr == NULL) {
group = alloc(NUM_STR_SIZE + 1);
- g_snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid);
+ g_snprintf(group, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid);
} else {
group = stralloc(grptr->gr_name);
}
-#define BUILT_REV "933"
+#define BUILT_REV "1023"
#define BUILT_BRANCH "amanda-260"
static in_port_t port_in_use[1024];
static int nb_port_in_use = 0;
int i;
+ int save_errno = EAGAIN;
assert(first_port <= last_port);
/* Try a port already used */
if(s > 0) {
return s;
}
+ if (errno != EAGAIN && errno != EBUSY)
+ save_errno = errno;
}
}
port_in_use[nb_port_in_use++] = port;
return s;
}
+ if (errno != EAGAIN && errno != EBUSY)
+ save_errno = errno;
}
dbprintf(_("connect_portrange: All ports between %d and %d are busy.\n"),
first_port,
last_port);
- errno = EAGAIN;
+ errno = save_errno;
return -1;
}
if (servPort != NULL && !strstr(servPort->s_name, "amanda")) {
dbprintf(_("connect_port: Skip port %d: owned by %s.\n"),
port, servPort->s_name);
+ errno = EBUSY;
return -1;
}
socklen_t socklen;
struct servent *servPort;
const in_port_t num_ports = (in_port_t)(last_port - first_port + 1);
+ int save_errno = EAGAIN;
assert(first_port <= last_port);
}
return 0;
}
+ if (errno != EAGAIN && errno != EBUSY)
+ save_errno = errno;
if (servPort == NULL) {
dbprintf(_("bind_portrange2: Try port %d: Available - %s\n"),
port, strerror(errno));
dbprintf(_("bind_portrange: all ports between %d and %d busy\n"),
first_port,
last_port);
- errno = EAGAIN;
+ errno = save_errno;
return -1;
}
const int VERSION_MAJOR = 2;
const int VERSION_MINOR = 6;
const int VERSION_PATCH = 0;
-const char *const VERSION_COMMENT = "";
+const char *const VERSION_COMMENT = "p1";
const char *
versionsuffix(void)
{
#ifdef USE_VERSION_SUFFIXES
- return "-2.6.0";
+ return "-2.6.0p1";
#else
return "";
#endif
const char *
version(void)
{
- return "2.6.0";
+ return "2.6.0p1";
}
]
)
- if test "x$GNUTAR" != "xno"; then
- # call ac_path_progs
- AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH)
- else
+ if test "x$GNUTAR" = "xno"; then
GNUTAR=
- fi
-
- if test ! -z "$GNUTAR"; then
- case "`\"$GNUTAR\" --version 2>&1`" in
- *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar
- ;;
- *)
- # warning..
- AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.])
- GNUTAR=''
- ;;
- esac
+ else
+ for gnutar_name in gtar gnutar tar; do
+ AC_PATH_PROGS(GNUTAR, $gnutar_name, , $LOCSYSPATH)
+ if test -n "$GNUTAR"; then
+ case "`\"$GNUTAR\" --version 2>&1`" in
+ *GNU*tar* | *Free*paxutils* )
+ # OK, it is GNU tar
+ break
+ ;;
+ *)
+ # warning..
+ AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.])
+ # reset the cache for GNUTAR so AC_PATH_PROGS will search again
+ GNUTAR=''
+ unset ac_cv_path_GNUTAR
+ ;;
+ esac
+ fi
+ done
fi
if test "x$GNUTAR" != "x"; then
# Define the identity of the package.
PACKAGE=amanda
- VERSION="2.6.0"
+ VERSION="2.6.0p1"
cat >>confdefs.h <<_ACEOF
fi
- if test "x$GNUTAR" != "xno"; then
- # call ac_path_progs
- for ac_prog in gtar gnutar tar
+ if test "x$GNUTAR" = "xno"; then
+ GNUTAR=
+ else
+ for gnutar_name in gtar gnutar tar; do
+ for ac_prog in $gnutar_name
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
test -n "$GNUTAR" && break
done
- else
- GNUTAR=
- fi
-
- if test ! -z "$GNUTAR"; then
- case "`\"$GNUTAR\" --version 2>&1`" in
- *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar
- ;;
- *)
- # warning..
+ if test -n "$GNUTAR"; then
+ case "`\"$GNUTAR\" --version 2>&1`" in
+ *GNU*tar* | *Free*paxutils* )
+ # OK, it is GNU tar
+ break
+ ;;
+ *)
+ # warning..
{ echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&5
echo "$as_me: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&2;}
AAW_EOF
- GNUTAR=''
- ;;
- esac
+ # reset the cache for GNUTAR so AC_PATH_PROGS will search again
+ GNUTAR=''
+ unset ac_cv_path_GNUTAR
+ ;;
+ esac
+ fi
+ done
fi
if test "x$GNUTAR" != "x"; then
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 32927 "configure"' > conftest.$ac_ext
+ echo '#line 32931 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:35214: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:35218: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:35218: \$? = $ac_status" >&5
+ echo "$as_me:35222: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:35476: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:35480: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:35480: \$? = $ac_status" >&5
+ echo "$as_me:35484: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:35538: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:35542: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:35542: \$? = $ac_status" >&5
+ echo "$as_me:35546: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 37767 "configure"
+#line 37771 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 37865 "configure"
+#line 37869 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:40164: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:40168: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:40168: \$? = $ac_status" >&5
+ echo "$as_me:40172: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:40226: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:40230: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:40230: \$? = $ac_status" >&5
+ echo "$as_me:40234: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 41578 "configure"
+#line 41582 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 41676 "configure"
+#line 41680 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:42561: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:42565: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:42565: \$? = $ac_status" >&5
+ echo "$as_me:42569: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:42623: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:42627: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:42627: \$? = $ac_status" >&5
+ echo "$as_me:42631: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:44770: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:44774: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:44774: \$? = $ac_status" >&5
+ echo "$as_me:44778: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:45032: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:45036: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:45036: \$? = $ac_status" >&5
+ echo "$as_me:45040: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:45094: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:45098: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:45098: \$? = $ac_status" >&5
+ echo "$as_me:45102: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 47323 "configure"
+#line 47327 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 47421 "configure"
+#line 47425 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
PACKAGE=amanda
AC_SUBST(PACKAGE)
-AM_INIT_AUTOMAKE(amanda, "2.6.0")
+AM_INIT_AUTOMAKE(amanda, "2.6.0p1")
AC_CONFIG_HEADERS([config/config.h])
dnl Minimum Autoconf version required.
self->fixed_block_size = g_value_get_int(val);
device_clear_volume_details(d_self);
return TRUE;
+ } else if (id == PROPERTY_READ_BUFFER_SIZE) {
+ if (d_self->access_mode != ACCESS_NULL)
+ return FALSE;
+ self->read_block_size = g_value_get_uint(val);
+ device_clear_volume_details(d_self);
+ return TRUE;
} else if (id == PROPERTY_FSF) {
return try_set_feature(d_self->access_mode,
feature_request_flags,
.\" Title: amaddclient
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMADDCLIENT" "8" "03/31/2008" "" ""
+.TH "AMADDCLIENT" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBssh-keygen\fR(1)
\fBssh-add\fR(1)
\fBscp\fR(1)
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amadmin
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMADMIN" "8" "03/31/2008" "" ""
+.TH "AMADMIN" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamdump\fR(8),
\fBamrestore\fR(8),
\fBamfetchdump\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amaespipe
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMAESPIPE" "8" "03/31/2008" "" ""
+.TH "AMAESPIPE" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBaespipe\fR(1),
\fBamcrypt\fR(8),
\fBgpg\fR(1),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amanda-client.conf
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMANDA\-CLIENT\.CONF" "5" "03/31/2008" "" ""
+.TH "AMANDA\-CLIENT\.CONF" "5" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamanda.conf\fR(5),
\fBamcrypt\fR(8),
\fBaespipe\fR(1),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amanda
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMANDA" "8" "03/31/2008" "" ""
+.TH "AMANDA" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamtoc\fR(8),
\fBamcheckdump\fR(8),
\fBamserverconfig\fR(8),
-\fBamaddclient\fR(8)
-\fBhttp://wiki.zmanda.com\fR()
+\fBamaddclient\fR(8),
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amanda.conf
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMANDA\.CONF" "5" "03/31/2008" "" ""
+.TH "AMANDA\.CONF" "5" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamadmin force\fR
should be used to tell
\fIAmanda\fR
-that a full dump has been performed off\-line, so that it resets to level 1\. It is similar to skip\-full, but with incronly full dumps may be scheduled manually\. Unfortunately, it appears that
-\fIAmanda\fR
-will perform full backups with this configuration, which is probably a bug\.
+that a full dump has been performed off\-line, so that it resets to level 1\.
.RE
.RE
.PP
\fBamanda-client.conf\fR(5),
\fBamcrypt\fR(8),
\fBaespipe\fR(1),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.PP
An updated version of this man page may be available at http://wiki\.zmanda\.com/index\.php/Amanda\.conf\.
.\" Title: amcheck
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMCHECK" "8" "03/31/2008" "" ""
+.TH "AMCHECK" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
\fBamanda\fR(8),
\fBamdump\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amcheckdb
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMCHECKDB" "8" "03/31/2008" "" ""
+.TH "AMCHECKDB" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamadmin\fR(8),
\fBamrmtape\fR(8),
\fBamanda\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amcheckdump
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMCHECKDUMP" "8" "03/31/2008" "" ""
+.TH "AMCHECKDUMP" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
for information on the
\-o
option\.
+.SH "SEE ALSO"
+.PP
+\fBamanda\fR(8),
+\fI\%http://wiki.zmanda.com\fR
.SH "EXAMPLE"
.PP
.RS 4
.\" Title: amcleanup
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMCLEANUP" "8" "03/31/2008" "" ""
+.TH "AMCLEANUP" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
\fBamanda\fR(8),
\fBamdump\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amcrypt-ossl-asym
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMCRYPT\-OSSL\-ASYM" "8" "03/31/2008" "" ""
+.TH "AMCRYPT\-OSSL\-ASYM" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamanda.conf\fR(5),
\fBopenssl\fR(1),
\fBamcrypt-ossl\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.SH "NOTES"
.IP " 1." 4
www.openssl.org
.\" Title: amcrypt-ossl
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMCRYPT\-OSSL" "8" "03/31/2008" "" ""
+.TH "AMCRYPT\-OSSL" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamanda.conf\fR(5),
\fBopenssl\fR(1),
\fBamcrypt-ossl-asym\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.SH "NOTES"
.IP " 1." 4
www.openssl.org
.\" Title: amcrypt
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMCRYPT" "8" "03/31/2008" "" ""
+.TH "AMCRYPT" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBaespipe\fR(1),
\fBamaespipe\fR(8),
\fBgpg\fR(1),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amcryptsimple
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMCRYPTSIMPLE" "8" "03/31/2008" "" ""
+.TH "AMCRYPTSIMPLE" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamgpgcrypt\fR(8),
\fBamrestore\fR(8),
\fBgpg\fR(1),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amdd
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMDD" "8" "03/31/2008" "" ""
+.TH "AMDD" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
\fBamanda\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amdevcheck
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMDEVCHECK" "8" "03/31/2008" "" ""
+.TH "AMDEVCHECK" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamanda\fR(8),
\fBammt\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amdump
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMDUMP" "8" "03/31/2008" "" ""
+.TH "AMDUMP" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamrestore\fR(8),
\fBamflush\fR(8),
\fBcron\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amfetchdump
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMFETCHDUMP" "8" "03/31/2008" "" ""
+.TH "AMFETCHDUMP" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamrestore\fR(8),
\fBtar\fR(1),
\fBrestore\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amflush
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMFLUSH" "8" "03/31/2008" "" ""
+.TH "AMFLUSH" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamanda\fR(8),
\fBamdump\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amgetconf
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMGETCONF" "8" "03/31/2008" "" ""
+.TH "AMGETCONF" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
\fBamanda\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amgpgcrypt
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMGPGCRYPT" "8" "03/31/2008" "" ""
+.TH "AMGPGCRYPT" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamcrypt\fR(8),
\fBamrestore\fR(8),
\fBgpg\fR(1),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amlabel
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMLABEL" "8" "03/31/2008" "" ""
+.TH "AMLABEL" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamanda\fR(8),
\fBamdump\fR(8),
\fBamflush\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: ammt
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMMT" "8" "03/31/2008" "" ""
+.TH "AMMT" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.SH "SEE ALSO"
.PP
\fBamanda\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amoverview
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMOVERVIEW" "8" "03/31/2008" "" ""
+.TH "AMOVERVIEW" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
\fBamadmin\fR(8),
\fBamanda\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amplot
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMPLOT" "8" "03/31/2008" "" ""
+.TH "AMPLOT" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBsh\fR(1),
\fBcompress\fR(1),
\fBgzip\fR(1),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amrecover
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMRECOVER" "8" "03/31/2008" "" ""
+.TH "AMRECOVER" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamrestore\fR(8),
\fBamfetchdump\fR(8),
\fBreadline\fR(3),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amreport
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMREPORT" "8" "03/31/2008" "" ""
+.TH "AMREPORT" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
\fBamanda\fR(8),
\fBamflush\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amrestore
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMRESTORE" "8" "03/31/2008" "" ""
+.TH "AMRESTORE" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamflush\fR(8),
\fBtar\fR(1),
\fBrestore\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amrmtape
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMRMTAPE" "8" "03/31/2008" "" ""
+.TH "AMRMTAPE" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
\fBamadmin\fR(8),
\fBamanda\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amserverconfig
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMSERVERCONFIG" "8" "03/31/2008" "" ""
+.TH "AMSERVERCONFIG" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamanda\fR(8),
\fBamanda.conf\fR(5),
\fBamaddclient\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amstatus
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMSTATUS" "8" "03/31/2008" "" ""
+.TH "AMSTATUS" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamdump\fR(8),
\fBamrestore\fR(8),
\fBamadmin\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amtape
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMTAPE" "8" "03/31/2008" "" ""
+.TH "AMTAPE" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.SH "SEE ALSO"
.PP
\fBamanda\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amtapetype
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMTAPETYPE" "8" "03/31/2008" "" ""
+.TH "AMTAPETYPE" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.SH "SEE ALSO"
.PP
\fBamanda\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amtoc
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMTOC" "8" "03/31/2008" "" ""
+.TH "AMTOC" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamdump\fR(8),
\fBamflush\fR(8),
\fBamgetconf\fR(8), cron, perl,
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.SH "AUTHOR"
.PP
Nicolas Mayencourt
.\" Title: amverify
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMVERIFY" "8" "03/31/2008" "" ""
+.TH "AMVERIFY" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
\fBamrestore\fR(8),
\fBamanda\fR(8),
\fBamverifyrun\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
.\" Title: amverifyrun
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2008
+.\" Date: 05/14/2008
.\" Manual:
.\" Source:
.\"
-.TH "AMVERIFYRUN" "8" "03/31/2008" "" ""
+.TH "AMVERIFYRUN" "8" "05/14/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.PP
\fBamanda\fR(8),
\fBamverify\fR(8),
-\fBhttp://wiki.zmanda.com\fR()
+\fI\%http://wiki.zmanda.com\fR
<citerefentry><refentrytitle>ssh-keygen</refentrytitle><manvolnum>1</manvolnum></citerefentry>
<citerefentry><refentrytitle>ssh-add</refentrytitle><manvolnum>1</manvolnum></citerefentry>
<citerefentry><refentrytitle>scp</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amfetchdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>aespipe</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>aespipe</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amtoc</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amcheckdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amserverconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amaddclient</refentrytitle><manvolnum>8</manvolnum></citerefentry>
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry></para>
+<citerefentry><refentrytitle>amaddclient</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<ulink url="http://wiki.zmanda.com"/>
+</para>
</refsect1>
</refentry>
<term><emphasis remap='B'>incronly</emphasis></term>
<listitem>
<para>Only do incremental dumps. <command>amadmin force</command> should be used to tell
- &A; that a full dump has been performed off-line, so that it resets to level 1.
- It is similar to skip-full, but with incronly full dumps may be scheduled manually.
- Unfortunately, it appears that &A; will perform full backups with this configuration,
- which is probably a bug.</para>
+ &A; that a full dump has been performed off-line, so that it resets to level 1.</para>
</listitem>
</varlistentry>
</variablelist>
<citerefentry><refentrytitle>amanda-client.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>aespipe</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
<para>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<para><citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amrmtape</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>
for information on the <literal>-o</literal> option.</para>
</refsect1>
+ <refsect1><title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+ <ulink url="http://wiki.zmanda.com"/>
+ </para>
+ </refsect1>
<refsect1><title>EXAMPLE</title>
<para><programlisting>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refentrytitle>amcrypt-ossl</refentrytitle>
<manvolnum>8</manvolnum>
</citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
<refentrytitle>amcrypt-ossl-asym</refentrytitle>
<manvolnum>8</manvolnum>
</citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
<citerefentry><refentrytitle>aespipe</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amaespipe</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amgpgcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para>
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<para>
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>ammt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>cron</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<para>
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para>
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+ <ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>compress</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gzip</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amfetchdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>readline</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amaddclient</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<citerefentry><refentrytitle>amgetconf</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
cron,
perl,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
<para><citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amverifyrun</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
<refsect1><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>amverify</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+<ulink url="http://wiki.zmanda.com"/>
</para>
</refsect1>
</refentry>
usr/share/lintian/overrides
usr/share/man/man5
usr/share/man/man8
+var/amanda
var/lib/amanda
var/lib/amanda/gnutar-lists
var/lib/amanda/example
usr/share/lintian/overrides
usr/share/man/man5
usr/share/man/man8
+var/amanda
var/lib/amanda
var/lib/amanda/gnutar-lists
var/lib/amanda/example/label-templates
SYSCONFDIR="/etc"
LOCALSTATEDIR="/var"
AMHOMEDIR="${LOCALSTATEDIR}/lib/amanda"
+AMTMP="/tmp/amanda"
amanda_user=amandabackup
amanda_group=disk
xinetd_reload="restart"
if [ ! -f ${LOCALSTATEDIR}/amanda/amandates ] ; then
touch ${LOCALSTATEDIR}/amanda/amandates || exit 1
fi
-if [ ${ret_val} -eq 0 ]; then
- echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${LOCALSTATEDIR}/amanda/amandates'."
- chown ${amanda_user}:${amanda_group} ${LOCALSTATEDIR}/amanda/amandates || exit 1
- chmod 0640 ${LOCALSTATEDIR}/amanda/amandates || exit 1
- if [ -x /sbin/restorecon ] ; then
- /sbin/restorecon ${LOCALSTATEDIR}/amanda/amandates || exit 1
- fi
+echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${LOCALSTATEDIR}/amanda/amandates'."
+chown ${amanda_user}:${amanda_group} ${LOCALSTATEDIR}/amanda/amandates || exit 1
+chmod 0640 ${LOCALSTATEDIR}/amanda/amandates || exit 1
+if [ -x /sbin/restorecon ] ; then
+ /sbin/restorecon ${LOCALSTATEDIR}/amanda/amandates || exit 1
+fi
+
+# Check for existence of and permissions on ${AMTMP}
+if [ ! -d ${AMTMP} ]; then
+ mkdir ${AMTMP} || exit 1
fi
+echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${AMTMP}'."
+chown ${amanda_user}:${amanda_group} ${AMTMP} || exit 1
+chmod 0640 ${AMTMP} || exit 1
# Install .gnupg directory
echo "`date +'%b %e %Y %T'`: Installing '${AMHOMEDIR}/.gnupg'."
if [ -z $AMVER ]
then
- AMVER=amanda-2.6.0
+ AMVER=amanda-2.6.0p1
fi
if [ -z $AMTARBALL ]
echo "Building package"
cd $AMVER
- # This assumes that you have loaded zmanda's GPG key into your keyring to
- # sign the packages.
- dpkg-buildpackage -rfakeroot -k3C5D1C92 -tc
+ # Create unsigned packages
+ dpkg-buildpackage -rfakeroot -uc -us
}
do_package $1
}
-do_build
do_resources
do_package
-amanda (2.6.0-1) unstable; urgency=low
+amanda (2.6.0p1-1) unstable; urgency=low
* Initial debian release: This package is based on Bdale Garbee's work as
the official debian maintainer for amanda.
+ * Found by Daniel_p: Fixed typos in preinst and postrm. Added permission
+ check for /tmp/amanda. Fixed rules to append default perl site_lib to
+ .install file so that perl modules are installed.
-- Zmanda <support@zmanda.com> Mon, 10 Mar 2008 1:00:09 -0600
echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: HOME: /var/lib/amanda" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: Default group: ${amanda_group} " >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Default group: ${amanda_group}" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Verifying ${amanda_user} user parameters :" >>${TMPFILE}
- if [ "`id -gn ${amanda_user}`" != "${amanda_group} " ] ; then
+ if [ "`id -gn ${amanda_user}`" != "${amanda_group}" ] ; then
echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: !!! user '${amanda_user}' is not part of the ${amanda_group} group,Pl !!!" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: !!! make sure it is corrected before start using amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user '${amanda_user}' is not part of the ${amanda_group} group, !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! please make sure it is corrected before start using amanda !!!" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
else
echo "`date +'%b %e %Y %T'`: Verified group name of user '${amanda_user}'" >>${TMPFILE}
if [ -d /var/lib/amanda ] ; then
echo -n "`date +'%b %e %Y %T'`: Checking ownership of '/var/lib/amanda'... " >>${TMPFILE}
if [ "`ls -dl /var/lib/amanda | awk '//{split($_,x); print x[3]}'`" = "${amanda_user}" ] && \
- [ "`ls -dl /var/lib/amanda | awk '//{split($_,x); print x[4]}'`" = "${amanda_group} " ] ; then
+ [ "`ls -dl /var/lib/amanda | awk '//{split($_,x); print x[4]}'`" = "${amanda_group}" ] ; then
echo "correct." >>${TMPFILE}
VARLIB_OK=0
else
echo "incorrect!" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Please ensure that the directory '/var/lib/amanda' is owned by" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: the user '${amanda_user}' and group '${amanda_group} '." >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: the user '${amanda_user}' and group '${amanda_group}'." >>${TMPFILE}
VARLIB_OK=1
fi
else
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-AMVER=2.6.0
+AMVER=2.6.0p1
# These are variables that the user can override. They get used in various
# places during configure, build, and install.
LOCALSTATEDIR=/var
AMHOMEDIR=$(LOCALSTATEDIR)/lib/amanda
LOGDIR=$(LOCALSTATEDIR)/log/amanda
+# Extract the perl site_lib directory. This is used to install amanda's perl
+# libs. If configure finds a different install or you specify a different path using
+# --with-amperldir= make sure you change this variable as well.
+PERLSITELIB=$(shell perl -V:installsitelib|sed -e"s:installsitelib='/::;s:'\;::")
AMANDAUSER=amandabackup
AMANDAGROUP=disk
WITHOUT_SERVER="False"
--enable-shared \
--sysconfdir=$(SYSCONFDIR) \
--localstatedir=$(LOCALSTATEDIR)\
- --with-star=/bin/star \
- --with-gnutar=/bin/tar \
--with-gnutar-listdir=$(AMHOMEDIR)/gnutar-lists \
--with-index-server=localhost \
--with-tape-server=localhost \
dh_installchangelogs -v >> $(log) 2>&1
echo "---->dh_installdebconf: " >> $(log)
dh_installdebconf -v >> $(log) 2>&1
- echo `pwd` >> $(log)
- echo "---->dh_install -v: " >> $(log)
+ # Here's how we get the perl modules installed into sitelib
+ echo $(PERLSITELIB)/* >> debian/amanda-backup-server.install
+ echo "---->dh_install -v --fail-missing: " >> $(log)
dh_install -v --sourcedir=debian/amanda-common >> $(log) 2>&1
echo "---->dh_strip: " >> $(log)
dh_strip >> $(log) 2>&1
echo "---->dh_compress: " >> $(log)
dh_compress >> $(log) 2>&1
- echo "---->dh_movefiles: " >> $(log)
- dh_movefiles --sourcedir=debian/amanda-common >> $(log) 2>&1
echo "---->dh_fixperms: " >> $(log)
dh_fixperms -v >> $(log) 2>&1
# fix perms manually
chown -R $(AMANDAUSER):$(AMANDAGROUP) debian/*/var/lib/*
#chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
- chown -R $(AMANDAUSER):$(AMANDAGROUP) $(server)/$(LOGDIR)
+ chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(LOGDIR) $(server)/$(LOGDIR)
#chmod -R u=rwX,g=rwX,o-rwx $(server)/$(LOGDIR)
- chown -R $(AMANDAUSER):$(AMANDAGROUP) $(server)/$(SYSCONFDIR)/amanda
+ chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(SYSCONFDIR)/amanda $(server)/$(SYSCONFDIR)/amanda
#chmod -R u=rwX,g=rwX,o-rwx $(server)/$(SYSCONFDIR)/amanda
- chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(AMHOMEDIR)/gnutar-lists
- chmod -R u=rwX,g=rwX,o-rwx $(client)/$(AMHOMEDIR)/gnutar-lists
+ chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(AMHOMEDIR)/gnutar-lists $(server)/$(AMHOMEDIR)/gnutar-lists
+ chmod -R u=rwX,g=rwX,o-rwx $(client)/$(AMHOMEDIR)/gnutar-lists $(server)/$(AMHOMEDIR)/gnutar-lists
# .. setuid
chown root:disk \
$(client)/$(AMLIBEXECDIR)/killpgrp \
$(server)/usr/share/lintian/overrides/amanda-backup-server
dh_makeshlibs >> $(log) 2>&1
dh_installdeb >> $(log) 2>&1
+ dh_perl >> $(log) 2>&1
dh_shlibdeps -l"debian/$(r)/usr/lib:debian/$(client)/usr/lib:debian/$(server)/usr/lib" >> $(log) 2>&1
# strip out the non-versioned amanda-common references, we need
# the versioned ones in the control file and dupes are ugly...
# --- Definitions ---
# Define amanda_version if it is not already defined.
-%{!?amanda_version: %define amanda_version 2.6.0}
+%{!?amanda_version: %define amanda_version 2.6.0p1}
%{!?amanda_release: %define amanda_release 1}
%define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
%define amanda_user amandabackup
# Check for the 'amanda' user
echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
- useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
if [ %{dist} = "SuSE" ]; then
PASSWD_EXIT=$?
else
# Check for the 'amanda' user
echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
- useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
if [ %{dist} = "SuSE" ]; then
PASSWD_EXIT=$?
else
# Check for the 'amanda' user
echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
- useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1
if [ %{dist} = "SuSE" ]; then
PASSWD_EXIT=$?
else
# --- ChangeLog
%changelog
+* Fri May 02 2008 Dan Locks <dwlocks at zmanda dot com>
+- Changed instances of ${ to %%{ where applicable
* Tue Mar 11 2008 Dan Locks <dwlocks at zmanda dot com>
- fixed many rpmlint complaints
- added --quiet to configure statements
--- /dev/null
+#
+# Copyright (C) 2005 Zmanda Incorporated.
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+#
+
+
+%define build_srpm 0
+%{?srpm_only: %define build_srpm 1}
+
+# Pkg-config sometimes needs its own path set, and we need to allow users to
+# override our guess during detection. This macro takes care of that.
+# If no --define PKG_CONFIG_PATH was passed and env var $PKG_CONFIG_PATH is
+# set then use the env var.
+%{!?PKG_CONFIG_PATH: %{expand:%(echo ${PKG_CONFIG_PATH:+"%%define PKG_CONFIG_PATH $PKG_CONFIG_PATH"})}}
+
+%{?PKG_CONFIG_PATH:%{echo:PKG_CONFIG_PATH = %{PKG_CONFIG_PATH}}}
+
+# Define which Distribution we are building:
+# Try to detect the distribution we are building:
+%if %{_vendor} == redhat
+ # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least
+ # fc3-7. So RHEL and Fedora look at the same file. The awk trickery here
+ # forces the field to be numeric so that the spec comparison works
+ %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 3
+ %define dist fedora
+ %define disttag fc
+ %define distver 3
+ %endif
+ %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print$4+0}' /etc/redhat-release) == 4
+ %define dist fedora
+ %define disttag fc
+ %define distver 4
+ %endif
+ %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 5
+ %define dist fedora
+ %define disttag fc
+ %define distver 5
+ %endif
+ %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 6
+ %define dist fedora
+ %define disttag fc
+ %define distver 6
+ %endif
+ %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 7
+ %define dist fedora
+ %define disttag fc
+ %define distver 7
+ %endif
+ %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 8
+ %define dist fedora
+ %define disttag fc
+ %define distver 8
+ # TODO: generalize this so that any platform can cross compile
+ %if %{_host_cpu} == x86_64 && %{_target_cpu} == i686
+ # Do nothing if PKG_CONFIG_PATH was set by the user above.
+ %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig}
+ %endif
+ %endif
+ %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 3
+ %define dist redhat
+ %define disttag rhel
+ %define distver 3
+ %endif
+ %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 4
+ %define dist redhat
+ %define disttag rhel
+ %define distver 4
+ %endif
+ %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 5
+ %define dist redhat
+ %define disttag rhel
+ %define distver 5
+ %endif
+%endif
+# Detect Suse variants. Suse gives us some nice macros in their rpms
+%if %{_vendor} == "suse"
+ %if %{suse_version} == 910
+ %define dist SuSE
+ %define disttag sles
+ %define distver 9
+ %endif
+ %if %{suse_version} == 1010
+ %define dist SuSE
+ %define disttag sles
+ %define distver 10
+ %endif
+ %if %{suse_version} == 1000
+ %define dist SuSE
+ %define disttag suse
+ %define distver 10
+ %endif
+%endif
+
+# Set options per distribution
+%if %{dist} == redhat || %{dist} == fedora
+ %define rpm_group Applications/Archiving
+ %define xinetd_reload restart
+%endif
+%if %{dist} == SuSE
+ %define rpm_group Productivity/Archiving/Backup
+ %define xinetd_reload restart
+%endif
+
+%define packer %(%{__id_u} -n)
+
+# --- Definitions ---
+
+# Define amanda_version if it is not already defined.
+%{!?amanda_version: %define amanda_version 2.6.0p1}
+%{!?amanda_release: %define amanda_release 1}
+%define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
+%define amanda_user amandabackup
+%define amanda_group disk
+%define udpportrange "700,740"
+%define tcpportrange "11000,11040"
+%define low_tcpportrange "700,710"
+
+Summary: The Amanda Backup and Archiving System
+Name: amanda
+Version: %{amanda_version}
+%define rpm_release %{amanda_release}.%{disttag}%{distver}
+%if %{build_srpm}
+%define rpm_release %{amanda_release}
+%endif
+Release: %{rpm_release}
+Source: %{name}-%{version}.tar.gz
+License: http://wiki.zmanda.com/index.php/Amanda_Copyright
+Vendor: Zmanda, Inc.
+Packager: www.zmanda.com
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{packer}-buildroot
+Group: %{rpm_group}
+# TODO - Need required versions for these:
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: binutils
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: gcc
+BuildRequires: glibc >= 2.2.0
+BuildRequires: readline
+BuildRequires: curl >= 7.10.0
+Requires: /bin/awk
+Requires: /bin/date
+Requires: /usr/bin/id
+Requires: /sbin/ldconfig
+Requires: /bin/sh
+Requires: /usr/sbin/useradd
+Requires: /usr/sbin/usermod
+Requires: fileutils
+Requires: grep
+Requires: gnuplot
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+Requires: curl >= 7.10.0
+Requires: xinetd
+Requires: perl >= 5.6.0
+Requires: tar >= 1.15
+%if %{dist} == redhat || %{dist}== fedora
+Requires: libtermcap.so.2
+Requires: initscripts
+%endif
+Provides: amanda-backup_client = %{amanda_version}, amanda-backup_server = %{amanda_version}
+
+%package backup_client
+Summary: The Amanda Backup and Archiving Client
+Group: %{rpm_group}
+Requires: /bin/awk
+Requires: fileutils
+Requires: grep
+%if %{dist} == redhat || %{dist}== fedora
+Requires: libtermcap.so.2
+Requires: initscripts
+%endif
+Requires: xinetd
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+Requires: perl >= 5.6.0
+Requires: tar >= 1.15
+Provides: amanda-backup_client = %{amanda_version}
+Provides: libamclient-%{version}.so = %{amanda_version}
+Provides: libamanda-%{version}.so = %{amanda_version}
+Conflicts: amanda-backup_server
+
+%package backup_server
+Summary: The Amanda Backup and Archiving Server
+Group: %{rpm_group}
+Requires: /bin/awk
+Requires: fileutils
+Requires: grep
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+%if %{dist} == redhat || %{dist}== fedora
+Requires: libtermcap.so.2
+Requires: initscripts
+%endif
+Requires: xinetd
+Requires: perl >= 5.6.0
+Requires: tar >= 1.15
+Provides: amanda-backup_server = %{amanda_version}
+Provides: libamclient-%{version}.so = %{amanda_version}
+Provides: libamanda-%{version}.so = %{amanda_version}
+Provides: libamserver-%{version}.so = %{amanda_version}
+Provides: librestore-%{version}.so = %{amanda_version}
+Provides: libamtape-%{version}.so = %{amanda_version}
+Provides: libamdevice-%{version}.so = %{amanda_version}
+
+# --- Package descriptions ---
+
+%description
+Amanda is the leading Open-Source Backup and Archiving software.
+
+The amanda-backup_server package should be installed on the Amanda server, i.e.
+the machine attached to backup media (such as a tape drive or disk
+drives) where backups will be written. The amanda-backup_server package
+includes Amanda client. The amanda-backup_client package needs
+to be installed on every system that is being backed up.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+
+
+%description backup_server
+Amanda is the leading Open-Source Backup and Archiving software.
+
+This package contains the Amanda server. The amanda-backup_server package
+should be installed on the Amanda server, i.e. the machine attached
+to backup media (such as a tape drive or disk drives) where backups
+will be written. The amanda-backup_server package includes Amanda client.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+
+
+%description backup_client
+Amanda is the leading Open-Source Backup and Archiving software.
+
+This package contains the Amanda client. The amanda-backup_client package
+needs to be installed on every system that is being backed up.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+# --- Directory setup ---
+
+# Configure directories:
+%define PREFIX /usr
+%define EPREFIX %{PREFIX}
+%define BINDIR %{EPREFIX}/bin
+%define SBINDIR %{EPREFIX}/sbin
+%define LIBEXECDIR %{EPREFIX}/libexec
+%define AMLIBEXECDIR %{LIBEXECDIR}/amanda
+%define DATADIR %{PREFIX}/share
+%define SYSCONFDIR /etc
+%define LOCALSTATEDIR /var
+%define AMANDAHOMEDIR %{LOCALSTATEDIR}/lib/amanda
+%ifarch x86_64
+%define LIBDIR %{EPREFIX}/lib64
+%else
+%define LIBDIR %{EPREFIX}/lib
+%endif
+%define AMLIBDIR %{LIBDIR}/amanda
+%define INCLUDEDIR %{PREFIX}/include
+%define MANDIR %{DATADIR}/man
+%define LOGDIR /var/log/amanda
+%define PERLSITELIB %(eval "`perl -V:installsitelib`"; echo $installsitelib)
+
+# Installation directories:
+%define ROOT_SBINDIR %{buildroot}/%{SBINDIR}
+%define ROOT_LIBEXECDIR %{buildroot}/%{LIBEXECDIR}
+%define ROOT_DATADIR %{buildroot}/%{DATADIR}
+%define ROOT_LOCALSTATEDIR %{buildroot}/%{LOCALSTATEDIR}
+%define ROOT_SYSCONFDIR %{buildroot}/%{SYSCONFDIR}
+%define ROOT_AMANDAHOMEDIR %{buildroot}/%{AMANDAHOMEDIR}
+%define ROOT_LIBDIR %{buildroot}/%{LIBDIR}
+%define ROOT_MANDIR %{buildroot}/%{MANDIR}
+%define ROOT_LOGDIR %{buildroot}/%{LOGDIR}
+
+# --- Unpack ---
+
+%prep
+%setup -q
+# --- Configure and compile ---
+
+%build
+%define config_user %{amanda_user}
+%define config_group %{amanda_group}
+
+%if %{disttag} == rhel && %{distver} == 3
+./configure \
+ CFLAGS="%{optflags} -g" CXXFLAGS="%{optflags}" \
+ --quiet \
+ --prefix=%{PREFIX} \
+ --sysconfdir=%{SYSCONFDIR} \
+ --sharedstatedir=%{LOCALSTATEDIR} \
+ --localstatedir=%{LOCALSTATEDIR} \
+ --libdir=%{LIBDIR} \
+ --includedir=%{INCLUDEDIR} \
+ --with-gnuplot=/usr/bin/gnuplot \
+ --with-gnutar=/bin/tar \
+ --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \
+ --with-index-server=localhost \
+ --with-tape-server=localhost \
+ --with-user=%{config_user} \
+ --with-group=%{config_group} \
+ --with-owner=%{packer} \
+ --with-fqdn \
+ --with-bsd-security \
+ --with-bsdtcp-security \
+ --with-bsdudp-security \
+ --with-ssh-security \
+ --with-udpportrange=%{udpportrange} \
+ --with-tcpportrange=%{tcpportrange} \
+ --with-low-tcpportrange=%{low_tcpportrange} \
+ --with-debugging=%{LOGDIR} \
+ --with-assertions \
+ --disable-installperms \
+ --without-ipv6
+%else
+# This confusing macro results in PKG_CONFIG_PATH=some/path if some/path
+# was set on the command line, or by the platform detection bits.
+./configure \
+ %{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \
+ CFLAGS="%{optflags} -g" CXXFLAGS="%{optflags}" \
+ --quiet \
+ --prefix=%{PREFIX} \
+ --sysconfdir=%{SYSCONFDIR} \
+ --sharedstatedir=%{LOCALSTATEDIR} \
+ --localstatedir=%{LOCALSTATEDIR} \
+ --libdir=%{LIBDIR} \
+ --includedir=%{INCLUDEDIR} \
+ --with-star=/usr/bin/star \
+ --with-gnuplot=/usr/bin/gnuplot \
+ --with-gnutar=/bin/tar \
+ --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \
+ --with-index-server=localhost \
+ --with-tape-server=localhost \
+ --with-user=%{config_user} \
+ --with-group=%{config_group} \
+ --with-owner=%{packer} \
+ --with-fqdn \
+ --with-bsd-security \
+ --with-bsdtcp-security \
+ --with-bsdudp-security \
+ --with-ssh-security \
+ --with-udpportrange=%{udpportrange} \
+ --with-tcpportrange=%{tcpportrange} \
+ --with-low-tcpportrange=%{low_tcpportrange} \
+ --with-debugging=%{LOGDIR} \
+ --with-assertions \
+ --disable-installperms
+%endif
+
+make
+
+# --- Install to buildroot ---
+
+%install
+if [ "%{buildroot}" != "/" ]; then
+ if [ -d "%{buildroot}" ] ; then
+ rm -rf %{buildroot}
+ fi
+else
+ echo "BuildRoot was somehow set to / !"
+ exit -1
+fi
+
+make -j1 DESTDIR=%{buildroot} install
+
+rm -rf %{ROOT_DATADIR}/amanda
+rm -f %{ROOT_AMANDAHOMEDIR}/example/inetd.conf.amandaclient
+mkdir %{buildroot}/{etc,var/log}
+mkdir %{ROOT_LOCALSTATEDIR}/amanda
+mkdir %{ROOT_SYSCONFDIR}/amanda
+mkdir %{ROOT_AMANDAHOMEDIR}/gnutar-lists
+mkdir %{ROOT_LOGDIR}
+
+echo "%{amanda_version_info}" >%{ROOT_AMANDAHOMEDIR}/amanda-release
+
+# --- Clean up buildroot ---
+
+%clean
+if [ "%{buildroot}" != "/" ]; then
+ if [ -d "%{buildroot}" ] ; then
+ rm -rf %{buildroot}
+ fi
+else
+ echo "BuildRoot was somehow set to / !"
+ exit -1
+fi
+
+# --- Pre/post (un)installation scripts ---
+
+%pre
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+ echo "Unable to mktemp!" 1>&2
+ exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+ if [ %{dist} = "SuSE" ]; then
+ PASSWD_EXIT=$?
+ else
+ # Lock the amanda account until admin sets password
+ passwd -l %{amanda_user} >>/dev/null
+ PASSWD_EXIT=$?
+ fi
+ if [ ${PASSWD_EXIT} -eq 0 ] ; then
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: for security purposes. Once a password for the '%{amanda_user}'" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: the following command as root.:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: # passwd -u %{amanda_user}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: If this is not a new installation of Amanda and you have" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: in those configurations. Additionally, you should ensure" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: is properly configured to allow connections for the user" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: '%{amanda_user}'." >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ PASSWD_OK=0
+ else
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! The '%{amanda_user}' user account for this system has been !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! created, however the user has no password set. For !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! security purposes this account is normally locked !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! after creation. Unfortunately, when locking this !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! account an error occurred. To ensure the security !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! of your system you should set a password for the !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user account '%{amanda_user}' immediately! To set such a !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! password, please issue the following command.: !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! # passwd %{amanda_user} !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ PASSWD_OK=1
+ fi
+else
+ # log information about 'amanda' user parameters
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: The Amanda backup software is configured to operate as the" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: user '%{amanda_user}'. This user exists on your system and has not" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: been modified. To ensure that Amanda functions properly," >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+ if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! make sure it is corrected before start using amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE}
+ fi
+
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+ fi
+
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' home directory should be set to !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! %{AMANDAHOMEDIR} Pl correct before using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified Default home directory for user amandabackup" >>${TMPFILE}
+ fi
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+ echo -n "`date +'%b %e %Y %T'`: Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+ if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+ [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+ echo "correct." >>${TMPFILE}
+ VARLIB_OK=0
+ else
+ echo "incorrect!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+ VARLIB_OK=1
+ fi
+else
+ VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+if [ ! -e ${LOGDIR} ] ; then
+ # create log directory
+ mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+ chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+ mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+ mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+ chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+ mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+ echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+ exit 1
+else
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+ rm -f "${TMPFILE}"
+fi
+
+%post
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX
+if [ $? -ne 0 ]; then
+ echo "Unable to mktemp!" 1>&2
+ exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating library cache..." >${TMPFILE}
+/sbin/ldconfig >>${TMPFILE} 2>&1
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+ if [ ! -f /etc/xinetd.d/amandaserver ] ; then
+ cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
+ chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
+ if [ -f /etc/xinetd.d/amandaclient ] ; then
+ rm /etc/xinetd.d/amandaclient
+ fi
+ echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+ if [ "%{xinetd_reload}" == "reload" ] ; then
+ /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -ne 0 ] ; then
+ echo -n "reload failed. Attempting restart..." >>${TMPFILE}
+ /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+ else
+ /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+ if [ ${ret_val} -eq 0 ] ; then
+ echo "success." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ else
+ echo "failed. Please check your system logs." >>${TMPFILE}
+ cat ${TMPFILE} 1>&2
+ cat ${TMPFILE} >>${INSTALL_ERR}
+ fi
+ fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
+ touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
+ chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+ chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+ if [ -x /sbin/restorecon ] ; then
+ /sbin/restorecon %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+else
+ echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+ mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+ chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+else
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+ touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+ if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+ echo "${host} root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
+ fi
+ if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+ echo "${host} %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+ fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation for amdump
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amdump"
+COMMENT="%{amanda_user}@server"
+if [ ! -d ${KEYDIR} ] ; then
+ if [ -f ${KEYDIR} ] ; then
+ echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+ mv ${KEYDIR} ${KEYDIR}.rpmsave
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ fi
+ echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+ mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+ echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+ if [ -f ${KEYDIR} ] ; then
+ echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+ mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ fi
+ echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+ mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+ echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+ ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+ touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+ echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >>${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then
+ /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda installation complete. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+ rm -f "${TMPFILE}"
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun
+/sbin/ldconfig
+%pre backup_server
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+ echo "Unable to mktemp!" 1>&2
+ exit 1
+fi
+
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+ if [ %{dist} = "SuSE" ]; then
+ PASSWD_EXIT=$?
+ else
+ # Lock the amanda account until admin sets password
+ passwd -l %{amanda_user} >>/dev/null
+ PASSWD_EXIT=$?
+ fi
+ if [ ${PASSWD_EXIT} -eq 0 ] ; then
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: for security purposes. Once a password for the '%{amanda_user}'" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: the following command as root.:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: # passwd -u %{amanda_user}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: If this is not a new installation of Amanda and you have" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: in those configurations. Additionally, you should ensure" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: is properly configured to allow connections for the user" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: '%{amanda_user}'." >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ PASSWD_OK=0
+ else
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! The '%{amanda_user}' user account for this system has been !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! created, however the user has no password set. For !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! security purposes this account is normally locked !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! after creation. Unfortunately, when locking this !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! account an error occurred. To ensure the security !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! of your system you should set a password for the !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user account '%{amanda_user}' immediately! To set such a !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! password, please issue the following command.: !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! # passwd %{amanda_user} !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ PASSWD_OK=1
+ fi
+else
+ # log information about 'amanda' user parameters
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: The Amanda backup software is configured to operate as the" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: user '%{amanda_user}'. This user exists on your system and has not" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: been modified. To ensure that Amanda functions properly," >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+ if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! make sure it is corrected before start using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE}
+ fi
+
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+ fi
+
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' home directory should be set to !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! %{AMANDAHOMEDIR} Pl correct before using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified Default home directory for user amandabackup" >>${TMPFILE}
+ fi
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+ echo -n "`date +'%b %e %Y %T'`: Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+ if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+ [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+ echo "correct." >>${TMPFILE}
+ VARLIB_OK=0
+ else
+ echo "incorrect!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+ VARLIB_OK=1
+ fi
+else
+ VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+
+if [ ! -e ${LOGDIR} ] ; then
+ # create log directory
+ mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+ chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+ mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+ mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+ chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+ mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+ echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+ exit 1
+else
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup server installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+ rm -f "${TMPFILE}"
+fi
+%post backup_server
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+ echo "Unable to mktemp!" 1>&2
+ exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
+/sbin/ldconfig
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+ if [ ! -f /etc/xinetd.d/amandaserver ] ; then
+ cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
+ chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
+ if [ -f /etc/xinetd.d/amandaclient ] ; then
+ rm /etc/xinetd.d/amandaclient
+ fi
+
+ echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+ if [ "%{xinetd_reload}" == "reload" ] ; then
+ /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -ne 0 ] ; then
+ echo -n "reload failed. Attempting restart..." >>${TMPFILE}
+ /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+ else
+ /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+ if [ ${ret_val} -eq 0 ] ; then
+ echo "success." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ else
+ echo "failed. Please check your system logs." >>${TMPFILE}
+ cat ${TMPFILE} 1>&2
+ cat ${TMPFILE} >>${INSTALL_ERR}
+ fi
+ fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
+ touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
+ chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+ chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+else
+ echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts to server
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+ touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+ if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+ echo "${host} root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
+ fi
+ if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+ echo "${host} %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+ fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install amanda client configuration file
+echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
+if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
+ cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+fi
+chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# install am_passphrase file to server
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.am_passphrase ] ; then
+ echo "`date +'%b %e %Y %T'`: Create '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
+ touch %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+ phrase=`echo "amandabackup" | md5sum | awk '{print $1}'`
+ echo ${phrase} >>%{AMANDAHOMEDIR}/.am_passphrase
+
+ chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+ chmod 0700 %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+ mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+ chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+else
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# SSH RSA key generation on server for amdump
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amdump"
+COMMENT="%{amanda_user}@server"
+if [ ! -d ${KEYDIR} ] ; then
+ if [ -f ${KEYDIR} ] ; then
+ echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+ mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ fi
+ echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+ mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+ echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+ ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+ if [ -f ${KEYDIR} ] ; then
+ echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+ mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ fi
+ echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+ mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+ echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+ ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+ touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+ echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then
+ /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup server installation complete. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+ rm -f "${TMPFILE}" >>${TMPFILE} 2>&1
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun backup_server
+/sbin/ldconfig
+%pre backup_client
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+ echo "Unable to mktemp!" 1>&2
+ exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1
+ if [ %{dist} = "SuSE" ]; then
+ PASSWD_EXIT=$?
+ else
+ # Lock the amanda account until admin sets password
+ passwd -l %{amanda_user} >>/dev/null
+ PASSWD_EXIT=$?
+ fi
+ if [ ${PASSWD_EXIT} -eq 0 ] ; then
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: for security purposes. Once a password for the '%{amanda_user}'" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: the following command as root.:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: # passwd -u %{amanda_user}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: If this is not a new installation of Amanda and you have" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: in those configurations. Additionally, you should ensure" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: is properly configured to allow connections for the user" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: '%{amanda_user}'." >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ PASSWD_OK=0
+ else
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! The '%{amanda_user}' user account for this system has been !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! created, however the user has no password set. For !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! security purposes this account is normally locked !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! after creation. Unfortunately, when locking this !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! account an error occurred. To ensure the security !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! of your system you should set a password for the !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user account '%{amanda_user}' immediately! To set such a !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! password, please issue the following command.: !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! # passwd %{amanda_user} !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ PASSWD_OK=1
+ fi
+else
+ # log information about 'amanda' user parameters
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: The Amanda backup software is configured to operate as the" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: user '%{amanda_user}'. This user exists on your system and has not" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: been modified. To ensure that Amanda functions properly," >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+ if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! make sure it is corrected before start using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE}
+ fi
+
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+ fi
+
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' home directory should be set to !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! %{AMANDAHOMEDIR} Pl correct before using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: Verified Default home directory for user amandabackup" >>${TMPFILE}
+ fi
+ echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+ PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+ echo -n "`date +'%b %e %Y %T'`: Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+ if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+ [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+ echo "correct." >>${TMPFILE}
+ VARLIB_OK=0
+ else
+ echo "incorrect!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+ VARLIB_OK=1
+ fi
+else
+ VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+
+if [ ! -e ${LOGDIR} ] ; then
+ # create log directory
+ mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+ chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+ mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+ mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+ chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+ mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+ echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+ exit 1
+else
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup client installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+ rm -f "${TMPFILE}"
+fi
+
+%post backup_client
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+ echo "Unable to mktemp!" 1>&2
+ exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
+/sbin/ldconfig
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+ if [ ! -f /etc/xinetd.d/amandaclient ] ; then
+ cp %{AMANDAHOMEDIR}/example/xinetd.amandaclient /etc/xinetd.d/amandaclient
+
+ echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+ if [ "%{xinetd_reload}" == "reload" ] ; then
+ /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -ne 0 ] ; then
+ echo -n "reload failed. Attempting restart..." >>${TMPFILE}
+ /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+ else
+ /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+ if [ ${ret_val} -eq 0 ] ; then
+ echo "success." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ else
+ echo "failed. Please check your system logs." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ fi
+ fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
+ touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
+ chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+ chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+else
+ echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts to client
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+ touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+ if [ -z "`grep \"^${host}[[:blank:]]\+\" %{AMANDAHOMEDIR}/.amandahosts | grep \"[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\"`" ] ; then
+ echo "${host} %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+ fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install amanda client configuration file
+echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
+if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
+ cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+fi
+chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+ mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+ else
+ echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+ chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ if [ ${ret_val} -eq 0 ]; then
+ chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+ ret_val=$?
+ fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+else
+ echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+ if [ -f ${KEYDIR} ] ; then
+ echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+ mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+ fi
+ echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+ mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+ echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+ ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+ cat ${TMPFILE}
+ cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+ touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+ echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then
+ /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=client
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup client installation complete. ===" >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+ rm -f "${TMPFILE}"
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun backup_client
+/sbin/ldconfig
+
+# --- Files to install ---
+
+%files backup_client
+%defattr(0755,%{amanda_user},%{amanda_group})
+%{SYSCONFDIR}/amanda
+%{AMANDAHOMEDIR}
+%{AMLIBEXECDIR}
+%{AMLIBDIR}
+%{AMLIBEXECDIR}/amanda-sh-lib.sh
+%{LOCALSTATEDIR}/amanda
+%defattr(4750,root,disk)
+%{AMLIBEXECDIR}/calcsize
+%{AMLIBEXECDIR}/killpgrp
+%{AMLIBEXECDIR}/rundump
+%{AMLIBEXECDIR}/runtar
+%defattr(0750,%{amanda_user},%{amanda_group})
+%{LOGDIR}
+%{SBINDIR}/amaespipe
+%{SBINDIR}/amcryp*
+%{SBINDIR}/amgpgcrypt
+%{SBINDIR}/amoldrecover
+%{SBINDIR}/amrecover
+%defattr(0644,%{amanda_user},%{amanda_group})
+%docdir %{MANDIR}
+%{MANDIR}/man5/amanda.conf.5.gz
+%{MANDIR}/man5/amanda-client.conf.5.gz
+%{MANDIR}/man8/amanda.8.gz
+%{MANDIR}/man8/amcheckdump.8.gz
+%{MANDIR}/man8/amrecover.8.gz
+%{AMLIBEXECDIR}/amcat.awk
+%{AMANDAHOMEDIR}/amanda-release
+%{AMANDAHOMEDIR}/example/xinetd.amandaclient
+%{AMANDAHOMEDIR}/example/amanda-client.conf
+
+%files backup_server
+%defattr(0755,%{amanda_user},%{amanda_group})
+%{SYSCONFDIR}/amanda
+%{AMLIBEXECDIR}
+%{AMLIBDIR}
+%{PERLSITELIB}/Amanda
+%{PERLSITELIB}/auto/Amanda
+%{AMANDAHOMEDIR}
+%{LOCALSTATEDIR}/amanda
+%{SBINDIR}/amaddclient
+%{SBINDIR}/amadmin
+%{SBINDIR}/amcheckdb
+%{SBINDIR}/amcheckdump
+%{SBINDIR}/amcleanup
+%{SBINDIR}/amdd
+%{SBINDIR}/amdevcheck
+%{SBINDIR}/amdump
+%{SBINDIR}/amfetchdump
+%{SBINDIR}/amflush
+%{SBINDIR}/amgetconf
+%{SBINDIR}/amlabel
+%{SBINDIR}/ammt
+%{SBINDIR}/amoverview
+%{SBINDIR}/amplot
+%{SBINDIR}/amreport
+%{SBINDIR}/amrestore
+%{SBINDIR}/amrmtape
+%{SBINDIR}/amserverconfig
+%{SBINDIR}/amstatus
+%{SBINDIR}/amtape
+%{SBINDIR}/amtapetype
+%{SBINDIR}/amtoc
+%{SBINDIR}/amverify
+%{SBINDIR}/amverifyrun
+%{AMLIBEXECDIR}/amanda-sh-lib.sh
+%defattr(4750,root,disk)
+%{AMLIBEXECDIR}/calcsize
+%{AMLIBEXECDIR}/killpgrp
+%{AMLIBEXECDIR}/rundump
+%{AMLIBEXECDIR}/runtar
+%{AMLIBEXECDIR}/dumper
+%{AMLIBEXECDIR}/planner
+%{SBINDIR}/amcheck
+%defattr(0750,%{amanda_user},%{amanda_group})
+%{LOGDIR}
+%{SBINDIR}/amaespipe
+%{SBINDIR}/amcrypt
+%{SBINDIR}/amcrypt-ossl
+%{SBINDIR}/amcrypt-ossl-asym
+%{SBINDIR}/amcryptsimple
+%{SBINDIR}/amgpgcrypt
+%{SBINDIR}/amoldrecover
+%{SBINDIR}/amrecover
+%defattr(0644,%{amanda_user},%{amanda_group})
+%{AMLIBEXECDIR}/amcat.awk
+%{AMLIBEXECDIR}/amplot.awk
+%{AMLIBEXECDIR}/amplot.g
+%{AMLIBEXECDIR}/amplot.gp
+%docdir %{MANDIR}
+%{MANDIR}/man5/amanda.conf.5.gz
+%{MANDIR}/man5/amanda-client.conf.5.gz
+%{MANDIR}/man8/amaddclient.8.gz
+%{MANDIR}/man8/amadmin.8.gz
+%{MANDIR}/man8/amanda.8.gz
+%{MANDIR}/man8/amcheck.8.gz
+%{MANDIR}/man8/amcheckdb.8.gz
+%{MANDIR}/man8/amcheckdump.8.gz
+%{MANDIR}/man8/amcleanup.8.gz
+%{MANDIR}/man8/amdd.8.gz
+%{MANDIR}/man8/amdump.8.gz
+%{MANDIR}/man8/amfetchdump.8.gz
+%{MANDIR}/man8/amflush.8.gz
+%{MANDIR}/man8/amgetconf.8.gz
+%{MANDIR}/man8/amlabel.8.gz
+%{MANDIR}/man8/ammt.8.gz
+%{MANDIR}/man8/amoverview.8.gz
+%{MANDIR}/man8/amplot.8.gz
+%{MANDIR}/man8/amrecover.8.gz
+%{MANDIR}/man8/amreport.8.gz
+%{MANDIR}/man8/amrestore.8.gz
+%{MANDIR}/man8/amrmtape.8.gz
+%{MANDIR}/man8/amserverconfig.8.gz
+%{MANDIR}/man8/amstatus.8.gz
+%{MANDIR}/man8/amtape.8.gz
+%{MANDIR}/man8/amtapetype.8.gz
+%{MANDIR}/man8/amtoc.8.gz
+%{MANDIR}/man8/amverify.8.gz
+%{MANDIR}/man8/amverifyrun.8.gz
+%{MANDIR}/man8/amcrypt.8.gz
+%{MANDIR}/man8/amcrypt-ossl.8.gz
+%{MANDIR}/man8/amcrypt-ossl-asym.8.gz
+%{MANDIR}/man8/amcryptsimple.8.gz
+%{MANDIR}/man8/amgpgcrypt.8.gz
+%{MANDIR}/man8/amaespipe.8.gz
+%{MANDIR}/man8/amdevcheck.8.gz
+%{AMANDAHOMEDIR}/amanda-release
+%{AMANDAHOMEDIR}/example/amanda-client.conf
+%{AMANDAHOMEDIR}/example/xinetd.amandaserver
+
+# --- ChangeLog
+
+%changelog
+* Fri May 02 2008 Dan Locks <dwlocks at zmanda dot com>
+- Changed instances of ${ to %%{ where applicable
+* Tue Mar 11 2008 Dan Locks <dwlocks at zmanda dot com>
+- fixed many rpmlint complaints
+- added --quiet to configure statements
+- moved PERLSITELIB to definitions section
+* Wed Feb 13 2008 Dan Locks <dwlocks at zmanda dot com>
+- added an environment check for PKG_CONFIG_PATH
+- added PKG_CONFIG_PATH conditional to handle cross comp on FC8 (environment
+ var is used if provided)
+* Fri Feb 01 2008 Dan Locks <dwlocks at zmanda dot com>
+- Removed amplot executable and manpages from client installation
+- Added amcheckdump.8 manpage
+- Fixed %%{LOCALSTATEDIR}/amanda dir creation.
+* Wed Jan 23 2008 Dan Locks <dwlocks at zmanda dot com>
+- Change %%{SYSCONFDIR}/amanda/amandates to %%{LOCALSTATEDIR}/amanda/amandates,
+ and added %%{LOCALSTATEDIR}/amanda to the files lists.
+* Mon Jan 14 2008 Dan Locks <dwlocks at zmanda dot com>
+- Updates for perlified amanda, file location moves, gpg setup.
+* Tue Nov 13 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Added SYSCONFDIR to client rpm
+- Set xinetd and amanda-client.conf configuration files as part of postinstall
+* Thu Nov 8 2007 Dan Locks <dwlocks at zmanda dot com>
+- Added Linux distribution detection
+* Wed Nov 7 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Added amserverconfig, amaddclient, amgpgcrypt, amcryptsimple and libamdevice.
+- Added amanda configuration template files
+* Fri Sep 21 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Remove libamserver, libamtape from client rpm
+* Wed Sep 19 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Added Fedora 7
+* Tue Jun 26 2007 Kevin Till <ktill at zmanda dot com>
+- set debug log to /var/log/amanda
+* Fri Jan 12 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Added label templates
+* Thu Dec 07 2006 Paddy Sreenivasan <paddy at zmanda dot com>
+- Application API changes
+* Fri Jun 16 2006 Kevin Till <ktill at zmanda dot com>
+- make install will install necessary example files.
+ No need to "cp"
+* Wed Jun 07 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Added amoldrecover and amanda-client.conf man page.
+* Thu Jun 01 2006 Kevin Till <ktill at zmanda dot com> -
+- Added amcrypt-ossl, amcrypt-ossl-asym by Ben Slusky.
+* Thu May 18 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Added SLES10, RHEL3 build options.
+* Tue May 09 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added amanda-release file to amandabackup home directory.
+- Installation message logging cleanup.
+* Thu Apr 27 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Removed dependency on tar version.
+- Moved log directory creation after backup user creation.
+* Wed Apr 19 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added informative message to note the location of pre- and post-
+- install script logs files.
+* Mon Apr 17 2006 Chris Lee <cmlee at zmanda dot com> -
+- Reworked installation message logging and reporting.
+* Fri Apr 14 2006 Chris Lee <cmlee at zmanda dot com> -
+- Changed behavior for creating required localhost entries in the
+- amandahosts file to check for these entries even when the file
+- already exists.
+* Wed Apr 12 2006 Chris Lee <cmlee at zmanda dot com> -
+- Removed pre-install check for "disk" group. This group should exist
+- by default on almost all modern distributions.
+* Tue Apr 11 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added amandahosts entry for "localhost" without domain.
+* Fri Apr 07 2006 Chris Lee <cmlee at zmanda dot com> -
+- Changed default entries in .amandahosts to use "localdomain" instead
+- of "localnet".
+- Updated amanda_version and release.
+* Mon Apr 03 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added example amanda.conf to files.
+* Thu Mar 16 2006 Chris Lee <cmlee at zmanda dot com> -
+- Corrected an issue with pre-install scripts wrt bug #218.
+- Corrected an issue with post-install scripts and added testing .profile
+- in amandabackup's home directory for setting environment variables wrt
+- bug #220.
+* Mon Mar 13 2006 Chris Lee <cmlee at zmanda dot com> -
+- Corrected a syntactical error with setting ownership of amandates file
+- wrt bug #216.
+* Wed Mar 08 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added pre-install scripts to verify proper ownership of
+- amandabackup home directory.
+* Thu Feb 2 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Require xinetd. Require termcap and initscripts for Fedora and Redhat.
+* Mon Jan 09 2006 Chris Lee <cmlee at zmanda dot com> -
+- Pre/post install scripts updated:
+- o Resolved an issue where an empty amandates file was installed
+- even if the file already existed on the system.
+- o If .amandahosts does not exist a default is now created.
+- The Amanda user account has been changed to 'amandabackup' for
+- additional security.
+* Tue Jan 03 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Removed amandates from files list.
+* Thu Dec 29 2005 Chris Lee <cmlee at zmanda dot com> -
+- Corrected dependency for awk to "/bin/awk".
+* Thu Dec 29 2005 Kevin Till <ktill at zmanda dot com> -
+- add man pages for amcrypt and amaespipe
+* Thu Dec 29 2005 Chris Lee <cmlee at zmanda dot com> -
+- Updated dependancy info to depend on tar >= 1.15.
+- Included dependancies from top-level package in backup_client and
+- backup_server packages.
+- Reorganized files lists for readability (alphabetically).
+- Updated backup_client files list to include some missing files per
+- bug #129.
+- Updated pre- and post-install to handle potential issue when
+- /var/log/amanda exists and is a file rather than a directory.
+- Corrected permissions for /var/log/amanda in pre-install scripts
+- per bug #78 and 13 December change.
+* Thu Dec 22 2005 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Added amaespipe and amcrypt
+- Added sles9 build definitions
+* Tue Dec 13 2005 Chris Lee <cmlee at zmanda dot com> -
+- Changed permissions for /var/log/amanda, removing set group id bit.
+- Added /etc/amandates to backup_client package.
+* Thu Dec 08 2005 Chris Lee <cmlee at zmanda dot com> -
+- Corrected an issue with detection of existing 'amanda' user account.
+- Corrected ownership of setuid executables per Bug #66.
+- Moved the gnutar and noop files to the backup_client package (where
+- they sould be).
+- Removed amqde from files list.
+- Added logging features to pre- and post-install scripts.
+* Wed Dec 07 2005 Chris Lee <cmlee at zmanda dot com> -
+- Changed a number of directory and file permissions from amanda:root
+- to amanda:disk in response to Bug #57.
+* Fri Dec 02 2005 Chris Lee <cmlee at zmanda dot com> -
+- Corrected SYSCONFDIR path definition. Closes Bug #58.
+* Mon Nov 28 2005 Chris Lee <cmlee at zmanda dot com> -
+- Really fixed user creation preinstall scripts.
+* Wed Nov 23 2005 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Updated package description.
+- Changed Group for packages.
+* Tue Nov 22 2005 Chris Lee <cmlee at zmanda dot com> -
+- Corrected dependancy packaging issue with amanda libraries.
+- Fixed creation of amanda user on systems which it does not exist.
+- Corrected Group definition for SuSE.
+- Updated descriptions to include amanda-libs package.
+- Updated release number to 2.
+* Tue Nov 08 2005 Chris Lee <cmlee at zmanda dot com> -
+- Permissions changes: now using user=amanda, group=disk
+* Sun Oct 30 2005 Chris Lee <cmlee at zmanda dot com> -
+- Parameters to configure options --with-user and --with-group changed
+- such that when test_build is set to '1' the username of the user who
+- runs rpmbuild is used for both values. If test_build is set to '0'
+- then root is used for both values.
+- The release field was also changed to automatically reflect the
+- distribution and distribution release version for which the RPM was
+- built.
+* Tue Oct 18 2005 Chris Lee <cmlee at zmanda dot com> -
+- Initial RPM SPEC file created.
+
***************
-*** 1514,1519 ****
- %{AMLIBEXECDIR}
- %{AMLIBEXECDIR}/application
- %{AMLIBDIR}
- %{LOCALSTATEDIR}/amanda
- %defattr(4750,root,disk)
- %{AMLIBEXECDIR}/calcsize
---- 1517,1523 ----
- %{AMLIBEXECDIR}
- %{AMLIBEXECDIR}/application
- %{AMLIBDIR}
-+ %{PERLSITELIB}
- %{LOCALSTATEDIR}/amanda
- %defattr(4750,root,disk)
- %{AMLIBEXECDIR}/calcsize
+*** 122,128 ****
+ # --- Definitions ---
+
+ # Define amanda_version if it is not already defined.
+- %{!?amanda_version: %define amanda_version 2.6.0}
+ %{!?amanda_release: %define amanda_release 2}
+ %define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
+ %define amanda_user amandabackup
+--- 122,128 ----
+ # --- Definitions ---
+
+ # Define amanda_version if it is not already defined.
++ %{!?amanda_version: %define amanda_version 2.6.0p1}
+ %{!?amanda_release: %define amanda_release 2}
+ %define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
+ %define amanda_user amandabackup
# Buildbot exports some useful env variables.
# Check for $AMVER. I couldn't come up with a good way to detect it.
if [ -z $AMVER ]; then
- AMVER=amanda-2.6.0
+ AMVER=amanda-2.6.0p1
fi
# Check for AMTARBALL variable.
if [ -z $AMTARBALL ]; then
--- /dev/null
+#!/bin/bash
+# Buildpkg script for producing RPM packages. Does not require root access.
+
+# This is useful for debugging
+set -x
+# Buildbot exports some useful env variables.
+# Check for $AMVER. I couldn't come up with a good way to detect it.
+if [ -z $AMVER ]; then
+ AMVER=amanda-2.6.0p1
+fi
+# Check for AMTARBALL variable.
+if [ -z $AMTARBALL ]; then
+ AMTARBALL=$AMVER.tar.gz
+fi
+
+# Check for AMTARBALL file, if it's not there, create it.
+if [ ! -f ${AMTARBALL} ]; then
+ mkdir ${AMVER}
+ cp -Rfp * ${AMVER}/
+ tar -cf ${AMTARBALL} -z ${AMVER}
+ rm -rf ${AMVER}
+fi
+
+# Check for the packaging dirs.
+if [ -z $AMPKGDIR ]; then
+ AMPKGDIR=${PWD}
+fi
+if [ ! -d ${AMPKGDIR} ]; then
+ mkdir ${AMPKGDIR}
+fi
+cd ${AMPKGDIR}
+
+if [ -d rpm ]; then
+ rm -rf rpm
+fi
+mkdir rpm
+mkdir rpm/SOURCES
+mkdir rpm/SRPMS
+mkdir rpm/SPECS
+mkdir rpm/BUILD
+mkdir rpm/RPMS
+
+# Make a copy of the tarball with the name that rpmbuild expects
+cp ${AMTARBALL} rpm/SOURCES/${AMVER}.tar.gz
+cp packaging/rpm/amanda.spec rpm/SPECS/amanda.spec
+# Rpmbuild requires absolute paths. annoying. If you need to change the
+# default value of some rpm.spec variable, just pass extra --define options.
+# this is useful for changing %amanda_release or %amanda_version
+rpmbuild -ba --define "_topdir ${AMPKGDIR}/rpm" \
+ ${AMPKGDIR}/rpm/SPECS/amanda.spec
--- /dev/null
+***************
+*** 6,12 ****
+ # Buildbot exports some useful env variables.
+ # Check for $AMVER. I couldn't come up with a good way to detect it.
+ if [ -z $AMVER ]; then
+- AMVER=amanda-2.6.0
+ fi
+ # Check for AMTARBALL variable.
+ if [ -z $AMTARBALL ]; then
+--- 6,12 ----
+ # Buildbot exports some useful env variables.
+ # Check for $AMVER. I couldn't come up with a good way to detect it.
+ if [ -z $AMVER ]; then
++ AMVER=amanda-2.6.0p1
+ fi
+ # Check for AMTARBALL variable.
+ if [ -z $AMTARBALL ]; then
/* -------- TYPES TABLE (BEGIN) -------- */
-#define SWIGTYPE_p_char swig_types[0]
-#define SWIGTYPE_p_double swig_types[1]
-#define SWIGTYPE_p_dumpspec_t swig_types[2]
-#define SWIGTYPE_p_float swig_types[3]
-#define SWIGTYPE_p_int swig_types[4]
-#define SWIGTYPE_p_p_char swig_types[5]
-#define SWIGTYPE_p_unsigned_char swig_types[6]
-static swig_type_info *swig_types[8];
-static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
+#define SWIGTYPE_p_GSList swig_types[0]
+#define SWIGTYPE_p_char swig_types[1]
+#define SWIGTYPE_p_double swig_types[2]
+#define SWIGTYPE_p_dumpspec_t swig_types[3]
+#define SWIGTYPE_p_float swig_types[4]
+#define SWIGTYPE_p_int swig_types[5]
+#define SWIGTYPE_p_p_char swig_types[6]
+#define SWIGTYPE_p_unsigned_char swig_types[7]
+static swig_type_info *swig_types[9];
+static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
#include "amglue.h"
+#include "cmdline.h"
+
+
+typedef GSList amglue_dumpspec_list;
+
+
#include <glib.h>
#include "cmdline.h"
int arg1 ;
char **arg2 = (char **) 0 ;
int arg3 ;
- GSList *result = 0 ;
+ amglue_dumpspec_list *result = 0 ;
int argvi = 0;
dXSARGS;
g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
}
}
- result = (GSList *)cmdline_parse_dumpspecs(arg1,arg2,arg3);
+ result = (amglue_dumpspec_list *)cmdline_parse_dumpspecs(arg1,arg2,arg3);
{
if (result) {
GSList *iter;
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+static swig_type_info _swigt__p_GSList = {"_p_GSList", "amglue_dumpspec_list *|GSList *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_dumpspec_t = {"_p_dumpspec_t", "struct dumpspec_t *|dumpspec_t *", 0, 0, (void*)"Amanda::Cmdline::dumpspec_t", 0};
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
+ &_swigt__p_GSList,
&_swigt__p_char,
&_swigt__p_double,
&_swigt__p_dumpspec_t,
&_swigt__p_unsigned_char,
};
+static swig_cast_info _swigc__p_GSList[] = { {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_dumpspec_t[] = { {&_swigt__p_dumpspec_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
+ _swigc__p_GSList,
_swigc__p_char,
_swigc__p_double,
_swigc__p_dumpspec_t,
%module "Amanda::Cmdline"
%include "amglue/amglue.swg"
%include "exception.i"
+%include "amglue/dumpspecs.swg"
%{
#include <glib.h>
%rename(format_dumpspec_components) cmdline_format_dumpspec_components;
char *cmdline_format_dumpspec_components(char *host, char *disk, char *datestamp, char *level);
-/* Typemap to convert the GSList that cmdline_parse_dumpspecs will
- * return into an array of dumpspec_t's. This uses some SWIG trickery
- * to manage to convert the GSList itself to an array, while leaving the
- * dumpspecs as C objects.
- */
-%typemap(out) GSList * {
- if ($1) {
- GSList *iter;
- EXTEND(SP, g_slist_length($1)); /* make room for return values */
-
- iter = $1;
- while (iter) {
- /* Let SWIG take ownership of the object; we'll free the GSList momentarily */
- $result = SWIG_NewPointerObj(iter->data, $descriptor(dumpspec_t*), SWIG_OWNER | SWIG_SHADOW);
- argvi++;
- iter = iter->next;
- }
-
- /* Now free the GSList, but *not* its contents (which are now "owned" by SWIG) */
- g_slist_free($1);
- }
-}
-
/* Typemap to convert a perl list of strings to the strv that
* cmdline_parse_dumpspecs expects.
*/
amglue_add_constant(CMDLINE_EMPTY_TO_WILDCARD, cmdline_parse_dumpspecs_flags);
%rename(parse_dumpspecs) cmdline_parse_dumpspecs;
-GSList *cmdline_parse_dumpspecs(int argc, char **argv, int flags);
+amglue_dumpspec_list *cmdline_parse_dumpspecs(int argc, char **argv, int flags);
/* TODO:
* convert AV back to GSList as input, convert resulting GSList into an AV of strings
* on output
*/
-/* GSList * cmdline_match_holding(GSList *dumpspec_list); */
+/* amglue_dumpspec_list * cmdline_match_holding(amglue_dumpspec_list *dumpspec_list); */
/* -------- TYPES TABLE (BEGIN) -------- */
#define SWIGTYPE_p_FILE swig_types[0]
-#define SWIGTYPE_p_char swig_types[1]
-#define SWIGTYPE_p_double swig_types[2]
-#define SWIGTYPE_p_find_result_t swig_types[3]
-#define SWIGTYPE_p_float swig_types[4]
-#define SWIGTYPE_p_int swig_types[5]
-#define SWIGTYPE_p_unsigned_char swig_types[6]
-static swig_type_info *swig_types[8];
-static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
+#define SWIGTYPE_p_GSList swig_types[1]
+#define SWIGTYPE_p_char swig_types[2]
+#define SWIGTYPE_p_double swig_types[3]
+#define SWIGTYPE_p_dumpspec_t swig_types[4]
+#define SWIGTYPE_p_find_result_t swig_types[5]
+#define SWIGTYPE_p_float swig_types[6]
+#define SWIGTYPE_p_int swig_types[7]
+#define SWIGTYPE_p_unsigned_char swig_types[8]
+static swig_type_info *swig_types[10];
+static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
#include "amglue.h"
+#include "cmdline.h"
+
+
+typedef GSList amglue_dumpspec_list;
+
+
#include <glib.h>
#include "logfile.h"
#include "find.h"
}
+XS(_wrap_dumps_match_dumpspecs) {
+ {
+ find_result_t *arg1 = (find_result_t *) 0 ;
+ amglue_dumpspec_list *arg2 = (amglue_dumpspec_list *) 0 ;
+ gboolean arg3 ;
+ find_result_t *result = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 3) || (items > 3)) {
+ SWIG_croak("Usage: dumps_match_dumpspecs(output_find,dumpspecs,ok);");
+ }
+ {
+ AV *av;
+ I32 len, i;
+ find_result_t *head = NULL, *tail = NULL;
+
+ if (!SvROK(ST(0)) || SvTYPE(SvRV(ST(0))) != SVt_PVAV) {
+ SWIG_exception(SWIG_TypeError, "expected an arrayref of find_result_t's");
+ }
+
+ av = (AV *)SvRV(ST(0));
+ len = av_len(av) + 1;
+
+ for (i = 0; i < len; i++) {
+ SV **val = av_fetch(av, i, 0);
+ find_result_t *r;
+
+ if (!val || SWIG_ConvertPtr(*val, (void **)&r, SWIGTYPE_p_find_result_t, 0) == -1) {
+ SWIG_exception(SWIG_TypeError, "array member is not a find_result_t");
+ }
+
+ if (!head) {
+ head = tail = r;
+ } else {
+ tail->next = r;
+ tail = r;
+ }
+
+ tail->next = NULL;
+ }
+
+ /* point to the head of that list */
+ arg1 = head;
+ }
+ {
+ AV *av;
+ int len;
+ int i;
+
+ if (!SvROK(ST(1)) || SvTYPE(SvRV(ST(1))) != SVt_PVAV) {
+ SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs");
+ }
+ av = (AV *)SvRV(ST(1));
+
+ len = av_len(av)+1;
+ arg2 = NULL;
+ for (i = 0; i < len; i++) {
+ dumpspec_t *ds = NULL;
+ SV **elt = av_fetch(av, i, 0);
+ if (elt)
+ SWIG_ConvertPtr(*elt, (void **)&ds, SWIGTYPE_p_dumpspec_t, 0);
+ if (!ds)
+ SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs");
+ arg2 = g_slist_append(arg2, ds);
+ }
+ }
+ {
+ if (sizeof(signed int) == 1) {
+ arg3 = amglue_SvI8(ST(2));
+ } else if (sizeof(signed int) == 2) {
+ arg3 = amglue_SvI16(ST(2));
+ } else if (sizeof(signed int) == 4) {
+ arg3 = amglue_SvI32(ST(2));
+ } else if (sizeof(signed int) == 8) {
+ arg3 = amglue_SvI64(ST(2));
+ } else {
+ g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+ }
+ }
+ result = (find_result_t *)dumps_match_dumpspecs(arg1,arg2,arg3);
+ {
+ find_result_t *iter;
+ int len;
+
+ /* measure the list and make room on the perl stack */
+ for (len=0, iter=result; iter; iter=iter->next) len++;
+ EXTEND(SP, len);
+
+ iter = result;
+ while (iter) {
+ find_result_t *next;
+ /* Let SWIG take ownership of the object */
+ ST(argvi) = SWIG_NewPointerObj(iter, SWIGTYPE_p_find_result_t, SWIG_OWNER | SWIG_SHADOW);
+ argvi++;
+
+ /* null out the 'next' field */
+ next = iter->next;
+ iter->next = NULL;
+ iter = next;
+ }
+ }
+ {
+ find_result_t *iter = arg1, *next;
+
+ /* undo all the links we added earlier */
+ while (iter) {
+ next = iter->next;
+ iter->next = NULL;
+ iter = next;
+ }
+ }
+ {
+ /* Free the GSList, but not its contents (which are still owned by SWIG) */
+ g_slist_free(arg2);
+ }
+
+ XSRETURN(argvi);
+ fail:
+ {
+ find_result_t *iter = arg1, *next;
+
+ /* undo all the links we added earlier */
+ while (iter) {
+ next = iter->next;
+ iter->next = NULL;
+ iter = next;
+ }
+ }
+ {
+ /* Free the GSList, but not its contents (which are still owned by SWIG) */
+ g_slist_free(arg2);
+ }
+
+ SWIG_croak_null();
+ }
+}
+
+
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *|loghandle *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GSList = {"_p_GSList", "amglue_dumpspec_list *|GSList *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_dumpspec_t = {"_p_dumpspec_t", "struct dumpspec_t *|dumpspec_t *", 0, 0, (void*)"Amanda::Cmdline::dumpspec_t", 0};
static swig_type_info _swigt__p_find_result_t = {"_p_find_result_t", "find_result_t *", 0, 0, (void*)"Amanda::Logfile::find_result_t", 0};
static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_int = {"_p_int", "int *|logtype_t *|program_t *|gboolean *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|logtype_t *|program_t *|gboolean *|cmdline_parse_dumpspecs_flags *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
&_swigt__p_FILE,
+ &_swigt__p_GSList,
&_swigt__p_char,
&_swigt__p_double,
+ &_swigt__p_dumpspec_t,
&_swigt__p_find_result_t,
&_swigt__p_float,
&_swigt__p_int,
};
static swig_cast_info _swigc__p_FILE[] = { {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GSList[] = { {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_dumpspec_t[] = { {&_swigt__p_dumpspec_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_find_result_t[] = { {&_swigt__p_find_result_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
_swigc__p_FILE,
+ _swigc__p_GSList,
_swigc__p_char,
_swigc__p_double,
+ _swigc__p_dumpspec_t,
_swigc__p_find_result_t,
_swigc__p_float,
_swigc__p_int,
{"Amanda::Logfilec::find_log", _wrap_find_log},
{"Amanda::Logfilec::search_logfile", _wrap_search_logfile},
{"Amanda::Logfilec::dumps_match", _wrap_dumps_match},
+{"Amanda::Logfilec::dumps_match_dumpspecs", _wrap_dumps_match_dumpspecs},
{0,0}
};
/* -----------------------------------------------------------------------------
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
+require Amanda::Cmdline;
package Amanda::Logfilec;
bootstrap Amanda::Logfile;
package Amanda::Logfile;
*find_log = *Amanda::Logfilec::find_log;
*search_logfile = *Amanda::Logfilec::search_logfile;
*dumps_match = *Amanda::Logfilec::dumps_match;
+*dumps_match_dumpspecs = *Amanda::Logfilec::dumps_match_dumpspecs;
############# Class : Amanda::Logfile::find_result_t ##############
%module "Amanda::Logfile"
%include "amglue/amglue.swg"
%include "exception.i"
+%include "amglue/dumpspecs.swg"
+%import "Amanda/Cmdline.swg"
%{
#include <glib.h>
find_result_t *dumps_match(find_result_t *output_find, char *hostname,
char *diskname, char *datestamp, char *level, int ok);
+
+find_result_t *dumps_match_dumpspecs(find_result_t *output_find,
+ amglue_dumpspec_list *dumpspecs,
+ gboolean ok);
AMGLUE_SWG = amglue/amglue.swg \
amglue/amglue.swg \
amglue/constants.swg \
+ amglue/dumpspecs.swg \
amglue/exports.swg \
amglue/glib.swg \
amglue/integers.swg
@WANT_SERVER_TRUE@ $(top_builddir)/server-src/libamserver.la \
@WANT_SERVER_TRUE@ $(top_builddir)/common-src/libamanda.la
am__libCmdline_la_SOURCES_DIST = Amanda/Cmdline.c amglue/amglue.swg \
- amglue/constants.swg amglue/exports.swg amglue/glib.swg \
- amglue/integers.swg
+ amglue/constants.swg amglue/dumpspecs.swg amglue/exports.swg \
+ amglue/glib.swg amglue/integers.swg
am__objects_1 =
@WANT_SERVER_TRUE@am_libCmdline_la_OBJECTS = Cmdline.lo \
@WANT_SERVER_TRUE@ $(am__objects_1)
@WANT_SERVER_TRUE@ $(top_builddir)/device-src/libamdevice.la \
@WANT_SERVER_TRUE@ $(top_builddir)/common-src/libamanda.la
am__libDevice_la_SOURCES_DIST = Amanda/Device.c amglue/amglue.swg \
- amglue/constants.swg amglue/exports.swg amglue/glib.swg \
- amglue/integers.swg
+ amglue/constants.swg amglue/dumpspecs.swg amglue/exports.swg \
+ amglue/glib.swg amglue/integers.swg
@WANT_SERVER_TRUE@am_libDevice_la_OBJECTS = Device.lo $(am__objects_1)
libDevice_la_OBJECTS = $(am_libDevice_la_OBJECTS)
libDevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@WANT_SERVER_TRUE@ $(top_builddir)/server-src/libamserver.la \
@WANT_SERVER_TRUE@ $(top_builddir)/common-src/libamanda.la
am__libLogfile_la_SOURCES_DIST = Amanda/Logfile.c amglue/amglue.swg \
- amglue/constants.swg amglue/exports.swg amglue/glib.swg \
- amglue/integers.swg
+ amglue/constants.swg amglue/dumpspecs.swg amglue/exports.swg \
+ amglue/glib.swg amglue/integers.swg
@WANT_SERVER_TRUE@am_libLogfile_la_OBJECTS = Logfile.lo \
@WANT_SERVER_TRUE@ $(am__objects_1)
libLogfile_la_OBJECTS = $(am_libLogfile_la_OBJECTS)
@WANT_SERVER_TRUE@ $(top_builddir)/server-src/libamserver.la \
@WANT_SERVER_TRUE@ $(top_builddir)/common-src/libamanda.la
am__libTapefile_la_SOURCES_DIST = Amanda/Tapefile.c amglue/amglue.swg \
- amglue/constants.swg amglue/exports.swg amglue/glib.swg \
- amglue/integers.swg
+ amglue/constants.swg amglue/dumpspecs.swg amglue/exports.swg \
+ amglue/glib.swg amglue/integers.swg
@WANT_SERVER_TRUE@am_libTapefile_la_OBJECTS = Tapefile.lo \
@WANT_SERVER_TRUE@ $(am__objects_1)
libTapefile_la_OBJECTS = $(am_libTapefile_la_OBJECTS)
AMGLUE_SWG = amglue/amglue.swg \
amglue/amglue.swg \
amglue/constants.swg \
+ amglue/dumpspecs.swg \
amglue/exports.swg \
amglue/glib.swg \
amglue/integers.swg
--- /dev/null
+/*
+ * Copyright (c) Zmanda, Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300
+ * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+ */
+
+%{
+#include "cmdline.h"
+%}
+
+/*
+ * Typemaps for lists of dumpspecs
+ *
+ * To use:
+ * %include "amglue/dumpspecs.swg"
+ * %import "Amanda/Logfile.swg"
+ * and declare functions as either taking or returning "amglue_dumpspec_list *".
+ */
+
+%inline %{
+typedef GSList amglue_dumpspec_list;
+%}
+
+/* Typemap to convert a GSList of dumpspec_t's into an array of same. This uses
+ * some SWIG trickery to manage to convert the GSList itself to an array, while
+ * leaving the dumpspecs as C objects.
+ */
+%types(dumpspec_t *);
+%typemap(out) amglue_dumpspec_list * {
+ if ($1) {
+ GSList *iter;
+ EXTEND(SP, g_slist_length($1)); /* make room for return values */
+
+ iter = $1;
+ while (iter) {
+ /* Let SWIG take ownership of the object; we'll free the GSList momentarily */
+ $result = SWIG_NewPointerObj(iter->data, $descriptor(dumpspec_t*), SWIG_OWNER | SWIG_SHADOW);
+ argvi++;
+ iter = iter->next;
+ }
+
+ /* Now free the GSList, but *not* its contents (which are now "owned" by SWIG) */
+ g_slist_free($1);
+ }
+}
+
+/* Typemap to convert an arrayref of dumpspecs into a GSList of same. This assumes
+ * that the dumpspecs are all C objects. This borrows references to the underlying
+ * dumpspec objects, which remain owned by SWIG.
+ */
+%typemap(in) amglue_dumpspec_list * {
+ AV *av;
+ int len;
+ int i;
+
+ if (!SvROK($input) || SvTYPE(SvRV($input)) != SVt_PVAV) {
+ SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs");
+ }
+ av = (AV *)SvRV($input);
+
+ len = av_len(av)+1;
+ $1 = NULL;
+ for (i = 0; i < len; i++) {
+ dumpspec_t *ds = NULL;
+ SV **elt = av_fetch(av, i, 0);
+ if (elt)
+ SWIG_ConvertPtr(*elt, (void **)&ds, $descriptor(dumpspec_t *), 0);
+ if (!ds)
+ SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs");
+ $1 = g_slist_append($1, ds);
+ }
+}
+
+%typemap(freearg) amglue_dumpspec_list * {
+ /* Free the GSList, but not its contents (which are still owned by SWIG) */
+ g_slist_free($1);
+}
/* local functions */
-tapelist_t *list_needed_tapes(GSList *dumpspecs);
+tapelist_t *list_needed_tapes(GSList *dumpspecs, int only_one);
void usage(void);
int main(int argc, char **argv);
*/
tapelist_t *
list_needed_tapes(
- GSList * dumpspecs)
+ GSList * dumpspecs,
+ int only_one)
{
needed_tape_t *needed_tapes = NULL, *curtape = NULL;
disklist_t diskqp;
- dumpspec_t *ds = NULL;
find_result_t *alldumps = NULL;
+ find_result_t *curmatch = NULL;
+ find_result_t *matches = NULL;
tapelist_t *tapes = NULL;
int numtapes = 0;
char *conf_diskfile, *conf_tapelist;
g_fprintf(stderr, _("No dump records found\n"));
exit(1);
}
-
+
/* Compare all known dumps to our match list, note what we'll need */
- while (dumpspecs) {
- find_result_t *curmatch = NULL;
- find_result_t *matches = NULL;
- ds = (dumpspec_t *)dumpspecs->data;
-
- matches = dumps_match(alldumps, ds->host, ds->disk,
- ds->datestamp, ds->level, 1);
- sort_find_result("Dhklp", &matches);
- for(curmatch = matches; curmatch; curmatch = curmatch->next){
- int havetape = 0;
- int have_part = 0;
- if(strcmp("OK", curmatch->status)){
- g_fprintf(stderr,_("Dump %s %s %s %d had status '%s', skipping\n"),
- curmatch->timestamp, curmatch->hostname,
- curmatch->diskname, curmatch->level,
- curmatch->status);
- continue;
- }
- /* check if we already have that part */
- for(curtape = needed_tapes; curtape; curtape = curtape->next) {
- find_result_t *rsttemp = NULL;
- for(rsttemp = curtape->files;
- rsttemp;
- rsttemp=rsttemp->next) {
- if (strcmp(rsttemp->partnum, curmatch->partnum) == 0)
- have_part = 1;
+ matches = dumps_match_dumpspecs(alldumps, dumpspecs, 1);
+ sort_find_result("Dhklp", &matches);
+ for(curmatch = matches; curmatch; curmatch = curmatch->next) {
+ int havetape = 0;
+ int have_part = 0;
+
+ /* keep only first dump if only_one */
+ if (only_one &&
+ curmatch != matches &&
+ (strcmp(curmatch->hostname, matches->hostname) ||
+ strcmp(curmatch->diskname, matches->diskname) ||
+ strcmp(curmatch->timestamp, matches->timestamp) ||
+ curmatch->level != matches->level)) {
+ continue;
+ }
+ if(strcmp("OK", curmatch->status)){
+ g_fprintf(stderr,_("Dump %s %s %s %d had status '%s', skipping\n"),
+ curmatch->timestamp, curmatch->hostname,
+ curmatch->diskname, curmatch->level,
+ curmatch->status);
+ continue;
+ }
+ /* check if we already have that part */
+ for(curtape = needed_tapes; curtape; curtape = curtape->next) {
+ find_result_t *rsttemp = NULL;
+ for(rsttemp = curtape->files;
+ rsttemp;
+ rsttemp=rsttemp->next) {
+ if (!strcmp(rsttemp->partnum, curmatch->partnum) &&
+ !strcmp(rsttemp->hostname, curmatch->hostname) &&
+ !strcmp(rsttemp->diskname, curmatch->diskname) &&
+ !strcmp(rsttemp->timestamp, curmatch->timestamp) &&
+ rsttemp->level == curmatch->level) {
+ have_part = 1;
}
}
- if (have_part)
- continue;
- for(curtape = needed_tapes; curtape; curtape = curtape->next) {
- if(!strcmp(curtape->label, curmatch->label)){
- find_result_t *rsttemp = NULL;
- find_result_t *rstfile = alloc(SIZEOF(find_result_t));
- int keep = 1;
+ }
+ if (have_part)
+ continue;
- memcpy(rstfile, curmatch, SIZEOF(find_result_t));
+ for(curtape = needed_tapes; curtape; curtape = curtape->next) {
+ if (!strcmp(curtape->label, curmatch->label)) {
+ find_result_t *rsttemp = NULL;
+ find_result_t *rstfile;
+ int keep = 1;
- havetape = 1;
+ havetape = 1;
- for(rsttemp = curtape->files;
+ for(rsttemp = curtape->files;
rsttemp;
rsttemp=rsttemp->next){
- if(rstfile->filenum == rsttemp->filenum){
- g_fprintf(stderr, _("Seeing multiple entries for tape "
+ if(curmatch->filenum == rsttemp->filenum){
+ g_fprintf(stderr, _("Seeing multiple entries for tape "
"%s file %lld, using most recent\n"),
curtape->label,
- (long long)rstfile->filenum);
- keep = 0;
- }
- }
- if(!keep){
- amfree(rstfile);
- break;
+ (long long)curmatch->filenum);
+ keep = 0;
}
- rstfile->next = curtape->files;
-
- if(curmatch->filenum < 1) curtape->isafile = 1;
- else curtape->isafile = 0;
- curtape->files = rstfile;
+ }
+ if(!keep){
break;
}
- }
- if(!havetape){
- find_result_t *rstfile = alloc(SIZEOF(find_result_t));
- needed_tape_t *newtape =
- alloc(SIZEOF(needed_tape_t));
+
+ rstfile = alloc(SIZEOF(find_result_t));
memcpy(rstfile, curmatch, SIZEOF(find_result_t));
- rstfile->next = NULL;
- newtape->files = rstfile;
- if(curmatch->filenum < 1) newtape->isafile = 1;
- else newtape->isafile = 0;
- newtape->label = curmatch->label;
- if(needed_tapes){
- needed_tapes->prev->next = newtape;
- newtape->prev = needed_tapes->prev;
- needed_tapes->prev = newtape;
- }
- else{
- needed_tapes = newtape;
- needed_tapes->prev = needed_tapes;
- }
- newtape->next = NULL;
- numtapes++;
-#if 0
-// free_find_result(rstfile);
-#endif
- } /* if(!havetape) */
+ rstfile->next = curtape->files;
+
+ if (curmatch->filenum < 1)
+ curtape->isafile = 1;
+ else curtape->isafile = 0;
+ curtape->files = rstfile;
+ break;
+ }
+ }
+ if (!havetape) {
+ find_result_t *rstfile = alloc(SIZEOF(find_result_t));
+ needed_tape_t *newtape = alloc(SIZEOF(needed_tape_t));
+ memcpy(rstfile, curmatch, SIZEOF(find_result_t));
+ rstfile->next = NULL;
+ newtape->files = rstfile;
+ if(curmatch->filenum < 1) newtape->isafile = 1;
+ else newtape->isafile = 0;
+ newtape->label = curmatch->label;
+ if (needed_tapes){
+ needed_tapes->prev->next = newtape;
+ newtape->prev = needed_tapes->prev;
+ needed_tapes->prev = newtape;
+ } else {
+ needed_tapes = newtape;
+ needed_tapes->prev = needed_tapes;
+ }
+ newtape->next = NULL;
+ numtapes++;
+ } /* if(!havetape) */
- } /* for(curmatch = matches ... */
- dumpspecs = dumpspecs->next;
- } /* while (dumpspecs) */
+ } /* for(curmatch = matches ... */
if(numtapes == 0){
g_fprintf(stderr, _("No matching dumps found\n"));
/* Decide what tapes we'll need */
- needed_tapes = list_needed_tapes(dumpspecs);
+ needed_tapes = list_needed_tapes(dumpspecs,
+ rst_flags->pipe_to_fd == STDOUT_FILENO);
parent_pid = getpid();
atexit(cleanup);
Device * device;
ReadLabelStatusFlags read_label_status;
+ dumpfile_t first_restored_file;
+
device_api_init();
+
+ fh_init(&first_restored_file);
device = device_open(device_name);
if (device == NULL) {
}
search_a_tape(device, stderr, flags, NULL, NULL, dumpspecs,
- NULL, NULL, 0, NULL);
+ NULL, &first_restored_file, 0, NULL);
}
/*
} else if(*e == 'm' || *e == 'M') {
rst_flags->blocksize *= 1024 * 1024;
} else if(*e != '\0') {
- error(_("invalid rst_flags->blocksize value \"%s\""), optarg);
+ error(_("invalid blocksize value \"%s\""), optarg);
/*NOTREACHED*/
}
if(rst_flags->blocksize < DISK_BLOCK_BYTES) {
error(_("minimum block size is %dk"), DISK_BLOCK_BYTES / 1024);
/*NOTREACHED*/
}
- if(rst_flags->blocksize > MAX_TAPE_BLOCK_KB * 1024) {
- g_fprintf(stderr,_("maximum block size is %dk, using it\n"),
- MAX_TAPE_BLOCK_KB);
- rst_flags->blocksize = MAX_TAPE_BLOCK_KB * 1024;
- /*NOTREACHED*/
- }
break;
case 'c': rst_flags->compress = 1; break;
case 'o':
}
record_seen_dump(tape_seen, source.header);
restore(&source, flags);
+ if (first_restored_file) {
+ memcpy(first_restored_file, source.header, sizeof(dumpfile_t));
+ }
return RESTORE_STATUS_NEXT_FILE;
}
if (last_header != NULL && !flags->amidxtaped &&
flags->pipe_to_fd == STDOUT_FILENO &&
+ last_header->type != F_UNKNOWN &&
!headers_equal(last_header, source.header, 1)) {
return FALSE;
} else if (this_header != NULL) {
cur_volume, &seentapes,
NULL, &first_restored_file, NULL);
}
+ if (flags->pipe_to_fd == fileno(stdout)) {
+ break;
+ }
} else {
Device * device = NULL;
if (use_changer) {
cur_volume, dumpspecs, &seentapes,
&first_restored_file, 0, logstream)) {
g_object_unref(device);
- break;;
+ break;
}
g_object_unref(device);
}
int tape_count = 0;
dumpfile_t first_restored_file;
+ fh_init(&first_restored_file);
+
/* This loop also aborts if we run out of manual tapes, or
encounter a changer error. */
for (;;) {
get_pname(), hostname, diskname);
}
if(put_info(hostname, diskname, &info) == 0) {
- g_printf(_("%s: %s:%s is set to a forced level 0 at next run.\n"),
- get_pname(), hostname, diskname);
+ if (dp->strategy == DS_INCRONLY) {
+ g_printf(_("%s: %s:%s, full dump done offline, next dump will be at level 1.\n"),
+ get_pname(), hostname, diskname);
+ } else {
+ g_printf(_("%s: %s:%s is set to a forced level 0 at next run.\n"),
+ get_pname(), hostname, diskname);
+ }
} else {
g_fprintf(stderr, _("%s: %s:%s could not be forced.\n"),
get_pname(), hostname, diskname);
conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
olddir = vstralloc(conf_logdir, "/oldlog", NULL);
- if (mkpdir(olddir, 02700, (uid_t)-1, (gid_t)-1) != 0) {
+ if (mkpdir(olddir, 0700, (uid_t)-1, (gid_t)-1) != 0) {
error(_("could not create parents of %s: %s"), olddir, strerror(errno));
/*NOTREACHED*/
}
- if (mkdir(olddir, 02700) != 0 && errno != EEXIST) {
+ if (mkdir(olddir, 0700) != 0 && errno != EEXIST) {
error(_("could not create %s: %s"), olddir, strerror(errno));
/*NOTREACHED*/
}
if (taper_dumper->result == LAST_TOK) {
taper_sendresult = 1;
} else {
- taper_cmd(taper_dumper->result, NULL, NULL, 0, NULL);
+ if( taper_dumper->result == DONE) {
+ taper_cmd(DONE, NULL, NULL, 0, NULL);
+ } else {
+ taper_cmd(FAILED, NULL, NULL, 0, NULL);
+ }
}
break;
indexfile_real = getindexfname(hostname, diskname, dumper_timestamp, level);
indexfile_tmp = stralloc2(indexfile_real, ".tmp");
- if (mkpdir(indexfile_tmp, 02755, (uid_t)-1, (gid_t)-1) == -1) {
+ if (mkpdir(indexfile_tmp, 0755, (uid_t)-1, (gid_t)-1) == -1) {
errstr = newvstrallocf(errstr,
_("err create %s: %s"),
indexfile_tmp,
#include "logfile.h"
#include "holding.h"
#include "find.h"
+#include "cmdline.h"
int find_match(char *host, char *disk);
void search_holding_disk(find_result_t **output_find);
return(matches);
}
+/*
+ * Return the set of dumps that match one or more of the given dumpspecs,
+ * If 'ok' is true, only dumps with a SUCCESS status will be matched.
+ *
+ * Returns a newly allocated list of results, where all strings are also newly
+ * allocated. Apparently some part of Amanda leaks under this condition.
+ */
+find_result_t *
+dumps_match_dumpspecs(
+ find_result_t *output_find,
+ GSList *dumpspecs,
+ int ok)
+{
+ find_result_t *cur_result;
+ find_result_t *matches = NULL;
+ GSList *dumpspec;
+ dumpspec_t *ds;
+
+ for(cur_result=output_find;
+ cur_result;
+ cur_result=cur_result->next) {
+ char level_str[NUM_STR_SIZE];
+ g_snprintf(level_str, SIZEOF(level_str), "%d", cur_result->level);
+ for (dumpspec = dumpspecs; dumpspec; dumpspec = dumpspec->next) {
+ ds = (dumpspec_t *)dumpspec->data;
+ if((!ds->host || *ds->host == '\0' || match_host(ds->host, cur_result->hostname)) &&
+ (!ds->disk || *ds->disk == '\0' || match_disk(ds->disk, cur_result->diskname)) &&
+ (!ds->datestamp || *ds->datestamp== '\0' || match_datestamp(ds->datestamp, cur_result->timestamp)) &&
+ (!ds->level || *ds->level== '\0' || match_level(ds->level, level_str)) &&
+ (!ok || !strcmp(cur_result->status, "OK"))){
+
+ find_result_t *curmatch = alloc(SIZEOF(find_result_t));
+ memcpy(curmatch, cur_result, SIZEOF(find_result_t));
+
+ curmatch->timestamp = stralloc(cur_result->timestamp);
+ curmatch->hostname = stralloc(cur_result->hostname);
+ curmatch->diskname = stralloc(cur_result->diskname);
+ curmatch->level = cur_result->level;
+ curmatch->label = stralloc(cur_result->label);
+ curmatch->filenum = cur_result->filenum;
+ curmatch->status = stralloc(cur_result->status);
+ curmatch->partnum = stralloc(cur_result->partnum);
+
+ curmatch->next = matches;
+ matches = curmatch;
+ break;
+ }
+ }
+ }
+
+ return(matches);
+}
+
find_result_t *
dump_exist(
find_result_t *output_find,
find_result_t *dumps_match(find_result_t *output_find, char *hostname,
char *diskname, char *datestamp, char *level,
int ok);
+find_result_t *dumps_match_dumpspecs(find_result_t *output_find,
+ GSList *dumpspecs,
+ int ok);
/* This function looks in a particular log.xxx file for dumps. Returns TRUE
* if something was found. This function also skips dumps whose disklist
/* create the directory structure if in write mode */
if (writing) {
- if (mkpdir(infofile, 02755, (uid_t)-1, (gid_t)-1) == -1) {
+ if (mkpdir(infofile, 0755, (uid_t)-1, (gid_t)-1) == -1) {
amfree(infofile);
return NULL;
}
}
}
+ /* warn if last level 1 will be overwritten */
+ if (ep->last_level > 1 && strlen(info.inf[1].label) > 0) {
+ overwrite_runs = when_overwrite(info.inf[1].label);
+ if(overwrite_runs == 0) {
+ log_add(L_WARNING, _("Last level 1 dump of %s:%s "
+ "on tape %s overwritten on this run, resetting to level 1"),
+ dp->host->hostname, qname, info.inf[1].label);
+ ep->last_level = 0;
+ } else if(overwrite_runs <= RUNS_REDZONE) {
+ log_add(L_WARNING,
+ plural(_("Last level 1 dump of %s:%s on tape %s overwritten in %d run."),
+ _("Last level 1 dump of %s:%s on tape %s overwritten in %d runs."), overwrite_runs),
+ dp->host->hostname, qname, info.inf[1].label,
+ overwrite_runs);
+ }
+ }
+
if(ep->next_level0 < 0) {
g_fprintf(stderr,plural(_("%s:%s overdue %d day for level 0\n"),
_("%s:%s overdue %d days for level 0\n"),
case DS_INCRONLY:
if (ISSET(info.command, FORCE_FULL))
- askfor(ep, i++, 0, &info);
+ ep->last_level = 0;
break;
}
}
}
strappend(errstr, "]");
qerrstr = quote_string(errstr);
- vstrextend(&bi->errstr, " ", qerrstr);
+ vstrextend(&bi->errstr, " ", qerrstr, NULL);
amfree(errstr);
amfree(qerrstr);
arglist_end(argp);
}
}
if (other_dle_match == 0) {
- if(mkpdir(infofile, (mode_t)02755, (uid_t)-1,
+ if(mkpdir(infofile, (mode_t)0755, (uid_t)-1,
(gid_t)-1) == -1) {
*errmsg = vstralloc("Can't create directory for ",
infofile, NULL);
* tests a tape in a given tape unit and prints a tapetype entry for
* it. */
#include "amanda.h"
+#include "conffile.h"
#include "tapeio.h"
setlocale(LC_MESSAGES, "C");
textdomain("amanda");
+ config_init(0, NULL);
+
if ((sProgName = strrchr(*argv, '/')) == NULL) {
sProgName = *argv;
} else {