Blob Blame History Raw
%define	_libexecdir	%{_libdir}/amanda

# XXX append lib to current _localstatedir setting
%{expand: %%define	_localstatedir	%{_localstatedir}/lib}

Summary: A network-capable tape backup solution.
Name: amanda
Version: 2.4.4p2
Release: 2.1
Source: http://download.sourceforge.net/amanda/amanda-%{version}.tar.gz
Source1: amanda.crontab
Source2: __README_QUICKSETUP__
Source3: amanda.conf
Source4: disklist
Source5: amanda-xinetd
Source6: amandaidx-xinetd
Source7: amidxtape-xinetd
Source8: amandahosts
Patch0: amanda-2.4.2-bug18322.patch
Patch1: amanda-2.4.4p2-pie.patch
License: BSD
Group: Applications/System
URL: http://www.amanda.org
Prereq: fileutils grep initscripts
BuildRequires: dump gnuplot cups samba-client tar grep fileutils
BuildRequires: libtool automake16 autoconf
Requires: tar
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description 
AMANDA, the Advanced Maryland Automatic Network Disk Archiver, is a
backup system that allows the administrator of a LAN to set up a
single master backup server to back up multiple hosts to one or more
tape drives or disk files.  AMANDA uses native dump and/or GNU tar
facilities and can back up a large number of workstations running
multiple versions of Unix.  Newer versions of AMANDA (including this
version) can use SAMBA to back up Microsoft(TM) Windows95/NT hosts.
The amanda package contains the core AMANDA programs and will need to
be installed on both AMANDA clients and AMANDA servers.  Note that you
will have to install the amanda-client and/or amanda-server packages as
well.

%package client
Summary: The client component of the AMANDA tape backup system.
Group: Applications/System
Prereq: fileutils grep /sbin/service xinetd
Requires: amanda = %{version}

%description client
The Amanda-client package should be installed on any machine that will
be backed up by AMANDA (including the server if it also needs to be
backed up).  You will also need to install the amanda package on each
AMANDA client machine.

%package server
Summary: The server side of the AMANDA tape backup system.
Group: Applications/System
Requires: gnuplot
Prereq: fileutils grep /sbin/service xinetd
Requires: amanda = %{version}

%description server
The amanda-server package should be installed on the AMANDA server,
the machine attached to the device(s) (such as a tape drive) where backups
will be written. You will also need to install the amanda package on
the AMANDA server machine.  And, if the server is also to be backed up, the
server also needs to have the amanda-client package installed.

%package devel
Summary: Libraries and documentation of the AMANDA tape backup system.
Group: Development/Libraries
Requires: amanda = %{version}

%description devel
The amanda-devel package should be installed on any machine that will
be used to develop amanda applications.

%prep
%setup -q
%patch0 -p1 -b .bug18322
%patch1 -p1 -b .pie
libtoolize --copy --force
aclocal-1.6
automake-1.6
autoconf

%build
export CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE"
export SED=sed

%configure --enable-shared \
	--with-index-server=localhost \
	--with-gnutar-listdir=%{_localstatedir}/amanda/gnutar-lists \
	--with-smbclient=%{_bindir}/smbclient \
	--with-amandahosts \
	--with-user=amanda \
	--with-group=disk \
        --with-tmpdir=/var/log/amanda \
	--with-gnutar=/bin/tar
	
make %{?_smp_mflags}
(cd common-src; make security)
(cd tape-src; make tapetype)


%install
rm -rf ${RPM_BUILD_ROOT}
export SED=sed

make install BINARY_OWNER=%(id -un) SETUID_GROUP=%(id -gn) DESTDIR=$RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/etc/xinetd.d
perl -p -e "s,\@LIBDIR\@,%{_libexecdir},g" < %SOURCE5 > $RPM_BUILD_ROOT/etc/xinetd.d/amanda
chmod 644 $RPM_BUILD_ROOT/etc/xinetd.d/amanda
perl -p -e "s,\@LIBDIR\@,%{_libexecdir},g" < %SOURCE6 > $RPM_BUILD_ROOT/etc/xinetd.d/amandaidx
chmod 644 $RPM_BUILD_ROOT/etc/xinetd.d/amandaidx
perl -p -e "s,\@LIBDIR\@,%{_libexecdir},g" < %SOURCE7 > $RPM_BUILD_ROOT/etc/xinetd.d/amidxtape
chmod 644 $RPM_BUILD_ROOT/etc/xinetd.d/amidxtape
mkdir -p $RPM_BUILD_ROOT/var/log/amanda
mkdir -p $RPM_BUILD_ROOT/var/lib/amanda
install -m 660 %SOURCE8 $RPM_BUILD_ROOT/var/lib/amanda/.amandahosts

mkdir -p examples
cp example/* examples
rm -f examples/Makefile*
rm -f examples/config.site

cp common-src/security ${RPM_BUILD_ROOT}%{_sbindir}
pushd tape-src/.libs
install -m 755 amtapetype $RPM_BUILD_ROOT/%{_sbindir}
popd

cp ${RPM_SOURCE_DIR}/__README_QUICKSETUP__ docs/

pushd ${RPM_BUILD_ROOT}
  mkdir -p .%{_sysconfdir}/amanda/DailySet1
  cp ${RPM_SOURCE_DIR}/amanda.crontab .%{_sysconfdir}/amanda/crontab.sample
  cp ${RPM_SOURCE_DIR}/amanda.conf .%{_sysconfdir}/amanda/DailySet1
  cp ${RPM_SOURCE_DIR}/disklist .%{_sysconfdir}/amanda/DailySet1
  touch .%{_sysconfdir}/amandates

  mkdir -p .%{_localstatedir}/amanda/gnutar-lists
  mkdir -p .%{_localstatedir}/amanda/DailySet1/index

#  for i in libamanda libamtape libamclient libamserver ; do
#    mv .%{_libdir}/${i}.so .%{_libdir}/${i}-%{version}-19991216-beta1.so
#    mv .%{_libdir}/${i}.la .%{_libdir}/${i}-%{version}-19991216-beta1.la
#    mv .%{_libdir}/${i}.a .%{_libdir}/${i}-%{version}-19991216-beta1.a
#  done

  chmod 755 .%{_libdir}/libam*
popd
rm -rf $RPM_BUILD_ROOT/usr/share/amanda

%clean 
rm -rf ${RPM_BUILD_ROOT}

%pre
useradd -M -n -g disk -o -r -d /var/lib/amanda -s /bin/bash \
	-c "Amanda user" -u 33 amanda >/dev/null 2>&1 || :



%post -p /sbin/ldconfig

%post client
/sbin/ldconfig
[ -f /var/lock/subsys/xinetd ] && /sbin/service xinetd reload > /dev/null 2>&1 || :

%post server
/sbin/ldconfig
[ -f /var/lock/subsys/xinetd ] && /sbin/service xinetd reload > /dev/null 2>&1 || :

%postun -p /sbin/ldconfig

%postun client
/sbin/ldconfig
[ -f /var/lock/subsys/xinetd ] && /sbin/service xinetd reload > /dev/null 2>&1 || :

%postun server
/sbin/ldconfig
[ -f /var/lock/subsys/xinetd ] && /sbin/service xinetd reload > /dev/null 2>&1 || :

%files
%defattr(-,root,root)
%{_libdir}/libamanda*.so
%{_libdir}/libamtape*.so
%attr(-,amanda,disk)	%{_sbindir}/amrestore
%{_mandir}/man8/amrestore.8*
%attr(660,amanda,disk)  %config(noreplace) /var/lib/amanda/.amandahosts

%attr(02700,amanda,disk) %dir /var/log/amanda
%attr(-,amanda,disk)	%dir %{_localstatedir}/amanda/
%attr(-,amanda,disk)	%dir %{_sysconfdir}/amanda/
%attr(-,amanda,disk)	%config(noreplace) %{_sysconfdir}/amandates

%files server
%defattr(-,root,root)
%doc examples docs/[A-LN-Z]* docs/MULTITAPE COPYRIGHT* NEWS README
%{_libdir}/libamserver*.so
%config(noreplace) /etc/xinetd.d/amandaidx
%config(noreplace) /etc/xinetd.d/amidxtape
%attr(-,amanda,disk)    %dir %{_libexecdir}/
%attr(-,amanda,disk)	%{_libexecdir}/amidxtaped
%attr(-,amanda,disk)	%{_libexecdir}/amindexd
%attr(-,amanda,disk)	%{_libexecdir}/amlogroll
%attr(-,amanda,disk)	%{_libexecdir}/amtrmidx
%attr(-,amanda,disk)	%{_libexecdir}/amtrmlog
%attr(-,amanda,disk)	%{_libexecdir}/driver
%attr(4750,root,disk)	%{_libexecdir}/dumper
%attr(4750,root,disk)	%{_libexecdir}/planner
%attr(-,amanda,disk)	%{_libexecdir}/taper
%attr(-,amanda,disk)	%{_libexecdir}/amcleanupdisk
%attr(-,amanda,disk)	%{_libexecdir}/chg-chio
%attr(-,amanda,disk)	%{_libexecdir}/chg-chs
%attr(-,amanda,disk)	%{_libexecdir}/chg-juke
%attr(-,amanda,disk)	%{_libexecdir}/chg-manual
%attr(-,amanda,disk)	%{_libexecdir}/chg-mcutil
%attr(-,amanda,disk)	%{_libexecdir}/chg-mtx
%attr(-,amanda,disk)	%{_libexecdir}/chg-multi
%attr(-,amanda,disk)	%{_libexecdir}/chg-null
%attr(-,amanda,disk)	%{_libexecdir}/chg-rait
%attr(-,amanda,disk)	%{_libexecdir}/chg-rth
%attr(-,amanda,disk)	%{_libexecdir}/chg-scsi
%attr(-,amanda,disk)	%{_libexecdir}/chg-zd-mtx
%attr(-,amanda,disk)	%{_libexecdir}/chg-disk
%attr(-,amanda,disk)	%{_libexecdir}/amcat.awk
%attr(-,amanda,disk)	%{_libexecdir}/amplot.awk
%attr(-,amanda,disk)	%{_libexecdir}/amplot.g
%attr(-,amanda,disk)	%{_libexecdir}/amplot.gp

%attr(-,amanda,disk)	%{_sbindir}/amadmin
%attr(4750,root,disk)	%{_sbindir}/amcheck
%attr(-,amanda,disk)	%{_sbindir}/amflush
%attr(-,amanda,disk)	%{_sbindir}/amgetconf
%attr(-,amanda,disk)	%{_sbindir}/amlabel
%attr(-,amanda,disk)	%{_sbindir}/amtape
%attr(-,amanda,disk)	%{_sbindir}/amreport
%attr(-,amanda,disk)	%{_sbindir}/amcheckdb
%attr(-,amanda,disk)	%{_sbindir}/amcleanup
%attr(-,amanda,disk)	%{_sbindir}/amdump
%attr(-,amanda,disk)	%{_sbindir}/amoverview
%attr(-,amanda,disk)	%{_sbindir}/amrmtape
%attr(-,amanda,disk)	%{_sbindir}/amtoc
%attr(-,amanda,disk)	%{_sbindir}/amverify
%attr(-,amanda,disk)	%{_sbindir}/amstatus
%attr(-,amanda,disk)	%{_sbindir}/amplot
%attr(-,amanda,disk)	%{_sbindir}/amtapetype
%attr(-,amanda,disk)	%{_sbindir}/amdd
%attr(-,amanda,disk)	%{_sbindir}/ammt
%attr(-,amanda,disk)	%{_sbindir}/amverifyrun

%attr(-,amanda,disk)	%dir %{_localstatedir}/amanda/DailySet1/
%attr(-,amanda,disk)	%dir %{_localstatedir}/amanda/DailySet1/index
%attr(-,amanda,disk)	%dir %{_sysconfdir}/amanda
%attr(-,amanda,disk)	%dir %{_sysconfdir}/amanda/DailySet1
%attr(-,amanda,disk)	%config(noreplace) %{_sysconfdir}/amanda/DailySet1/amanda.conf
%attr(-,amanda,disk)	%config(noreplace) %{_sysconfdir}/amanda/crontab.sample
%attr(-,amanda,disk)	%config(noreplace) %{_sysconfdir}/amanda/DailySet1/disklist

%{_mandir}/man8/amadmin.8*
%{_mandir}/man8/amanda.8*
%{_mandir}/man8/amcheck.8*
%{_mandir}/man8/amcheckdb.8*
%{_mandir}/man8/amcleanup.8*
%{_mandir}/man8/amdd.8*
%{_mandir}/man8/amdump.8*
%{_mandir}/man8/amflush.8*
%{_mandir}/man8/amgetconf.8*
%{_mandir}/man8/amlabel.8*
%{_mandir}/man8/ammt.8*
%{_mandir}/man8/amoverview.8*
%{_mandir}/man8/amplot.8*
%{_mandir}/man8/amreport.8*
%{_mandir}/man8/amrmtape.8*
%{_mandir}/man8/amstatus.8*
%{_mandir}/man8/amtape.8*
%{_mandir}/man8/amtapetype.8*
%{_mandir}/man8/amtoc.8*
%{_mandir}/man8/amverify.8*
%{_mandir}/man8/amverifyrun.8*

%files client
%defattr(-,root,root)
%config /etc/xinetd.d/amanda
%{_libdir}/libamclient*.so
%attr(-,amanda,disk)    %dir %{_libexecdir}/
%attr(-,amanda,disk)	%{_libexecdir}/amandad
%attr(4750,root,disk)	%{_libexecdir}/calcsize
%attr(4750,root,disk)	%{_libexecdir}/killpgrp
%attr(-,amanda,disk)	%{_libexecdir}/patch-system
%attr(4750,root,disk)	%{_libexecdir}/rundump
%attr(4750,root,disk)	%{_libexecdir}/runtar
%attr(4750,root,disk)	%{_libexecdir}/amqde
%attr(-,amanda,disk)	%{_libexecdir}/selfcheck
%attr(-,amanda,disk)	%{_libexecdir}/sendbackup
%attr(-,amanda,disk)	%{_libexecdir}/sendsize
%attr(-,amanda,disk)	%{_libexecdir}/versionsuffix
%attr(-,amanda,disk)	%{_sbindir}/amrecover
			%{_mandir}/man8/amrecover.8*
%attr(-,amanda,disk)	%{_sbindir}/security
%attr(-,amanda,disk)	%{_localstatedir}/amanda/gnutar-lists/

%files devel
%defattr(-,root,root)
%{_libdir}/libamanda.a
%{_libdir}/libamtape.a
%{_libdir}/libamclient.a
%{_libdir}/libamserver.a
%{_libdir}/*.la

%changelog
* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue Jan 13 2004 Jay Fenlason <fenlason@redhat.com> 2.4.4p2-1
- New upstream version, includes the -sigchld and -client-utils
  patches.  Also includes a new chg-disk changer script and a new
  amqde "quick-and-dirty estimate" program (called from sendsize--not
  a user command.

* Wed Jul 23 2003 Jay Fenlason <fenlason@redhat.com> 2.4.4p1-1
- Merge from 2.4.4p1-0.3E

* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Wed Feb 26 2003 Jay Fenlason <fenlason@redhat.com> 2.4.4-0
- New upstream version.

* Thu Feb 13 2003 Jay Fenlason <fenlason@redhat.com> 2.4.3-3
- Removed call to signal(SIGCHLD, SIG_IGN) which prevents wait...()
  from working on newer Red Hat systems.  This fixes bug #84092.

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Wed Dec 11 2002 Jay Fenlason <fenlason@redhat.com> 2.4.3-2
- Add spec file entry for /usr/lib/amanda so owner/group set
  correctly  Fixes bugs 74025 and 73379.

* Wed Nov 20 2002 Elliot Lee <sopwith@redhat.com> 2.4.3-1
- Update to version 2.4.3, rebuild
- Update patch for bug18322 to match

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Tue Apr  2 2002 Trond Eivind Glomsrød <teg@redhat.com> 2.4.2p2-7
- Don't strip explicitly
- Require samba-client instead of /usr/bin/smbclient

* Thu Feb 21 2002 Trond Eivind Glomsrød <teg@redhat.com> 2.4.2p2-6
- Rebuild

* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Fri Jul 13 2001 Trond Eivind Glomsrød <teg@redhat.com>
- Build and install the "tapetype"  utility program, for
  tape size identification (#48745)  

* Tue Jun 19 2001 Trond Eivind Glomsrød <teg@redhat.com>
- don't use %%configure, to make it build

* Mon Apr  9 2001 Bill Nottingham <notting@redhat.com>
- include ia64 again

* Wed Apr  4 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 2.4.2p2 - fixes problems with amrecover (#26567)
- made config files noreplace
- don't build on IA64 right now, amanda doesn't like
  the dump there: It segfaults.

* Fri Mar 16 2001 Trond Eivind Glomsrød <teg@redhat.com>
- Add /usr/bin/smbclient to buildprereq (#31996), to
  avoid samba being built without such support

* Thu Feb 22 2001 Trond Eivind Glomsrød <teg@redhat.com>
- Use %%{version} in source URL, and thus actually use 
  2.4.2p1 instead of 2.4.2 (doh! # 28759)
- add patch to handle bogus /dev/root entries (#28759)

* Fri Feb 16 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 2.4.2p1 bugfix release
- move amandaixd and amidxtape to the server package (#28037)

* Wed Jan 31 2001 Trond Eivind Glomsrød <teg@redhat.com>
- move /etc/xinetd.d/amanda to the client subpackage (#25430)

* Tue Jan 30 2001 Trond Eivind Glomsrød <teg@redhat.com>
- don't have "chunksize -1" as the default, as it's no longer
  supported
- make it uid amanda, with home /var/lib/amada
  so programs can actually access it (#20510)
- make .amandahosts a config file (#18322)

* Tue Jan 23 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 2.4.2
- make the UDP service "wait" (#23047)

* Tue Oct 10 2000 Jeff Johnson <jbj@redhat.com>
- build with shared libraries.
- add amanda-devel package to contain static libraries.
- update to 2.4.2-19991216-beta1 (#16818).
- sort out client-server file confusions (#17232).
- amandaidx-xinetd should have "wait = no" (#17551).
- /var/lib/amanda needs operator.disk ownership (17913).
- /etc/xinetd.d/amanda added to the amanda-server package (#18112).
- ignore socket error message (#18322).

* Sun Sep  3 2000 Florian La Roche <Florian.LaRoche@redhat.de>
- do not include /etc/xinetd.d/amandaidx in the server rpm

* Mon Aug 21 2000 Trond Eivind Glomsrød <teg@redhat.com>
- only do reload of xinetd if xinetd is running (#16653)
- don't show output of reload command to STDOUT (#16653)
- don't use /usr/sbin/tcpd in amidx, xinetd is linked
  with tcp_wrappers
- prereq initscripts (fixes #14572 and duplicates)

* Tue Aug  1 2000 Bill Nottingham <notting@redhat.com>
- turn off amandaidx by default (#14937)
- fix some binary permissions (#14938)

* Tue Aug  1 2000 Matt Wilson <msw@redhat.com>
- added Prereq: /sbin/service xinetd to client and server subpackages

* Tue Jul 18 2000 Trond Eivind Glomsrød <teg@redhat.com>
- xinetd support

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Sun Jun 18 2000 Jeff Johnson <jbj@redhat.com>
- add prereqs for scriptlets, requires for common package.

* Sat Jun 10 2000 Jeff Johnson <jbj@redhat.com>
- FHS packaging.
- move to 7.0 distro.

* Tue May 23 2000 Tim Powers <timp@redhat.com>
- built for 7.0
- man pages in /usr/share/man

* Thu Apr 27 2000 Tim Powers <timp@redhat.com>
- added usr/lib/amanda/chg-zd-mtx to the client RPM to fix bug #8282

* Wed Mar 8 2000 Tim Powers <timp@redhat.com>
- fixed files/dirs ending up in the wrong packages.
- last time it wasn't built with dump (doh!), this time it is. Now has a
	BuildRequires for dump.

* Thu Feb 10 2000 Tim Powers <timp@redhat.com>
- strip binaries

* Fri Jan 21 2000 TIm Powers <timp@redhat.com>
- added chown lines to post section

* Tue Jan 11 2000 Tim Powers <timp@redhat.com>
- make sure the man pages are gzipped in each subpackage, overriding the build
	system spec_install_post macro.
- using mega spec file changes from Marc Merlin <merlin_bts@valinux.com> since
	the package we were shipping in the past had some major issues (not in
	Marc's words ;)
- using Marc's added README and modified config files.
- adapted patches written by Alexandre Oliva <oliva@dcc.unicamp.br> from Marc
	Merlin's package so that the patch matches the source version (the patches
	are the glibc2.1 and glibc2.2 patches)

* Mon Jan 3 2000 Tim Powers <timp@redhat.com>
- fix so configure doesn't crap out (libtoolize --force)
- gzip man pages, strip binaries
- rebuilt for 6.2

* Thu Aug 5 1999 Tim Powers <timp@redhat.com>
- applied patch so that it reports the available holding disk space correctly

* Thu Jul 8 1999 Tim Powers <timp@redhat.com>
- added %defattr lines
- rebuilt for 6.1

* Wed May 05 1999 Bill Nottingham <notting@redhat.com>
- update to 2.4.1p1

* Tue Oct 27 1998 Cristian Gafton <gafton@redhat.com>
- version 2.4.1

* Tue May 19 1998 Cristian Gafton <gafton@redhat.com>
- upgraded to full 2.4.0 release

* Thu Feb 19 1998 Otto Hammersmith <otto@redhat.com>
- fixed group for -client and -server packages (Network->Networking)

* Wed Feb 11 1998 Otto Hammersmith <otto@redhat.com>
- updated to 2.4.0b6, fixes security hole among other things
  (as well as finally got the glibc patch in the main source.)
 
* Tue Jan 27 1998 Otto Hammersmith <otto@redhat.com>
- moved versionsuffix to client package to remove dependency of amanda on amanda-client

* Mon Jan 26 1998 Otto Hammersmith <otto@redhat.com>
- fixed libexec garbage.

* Wed Jan 21 1998 Otto Hammersmith <otto@redhat.com>
- split into three packages amanda, amanda-client, and amanda-server

* Fri Jan  9 1998 Otto Hammersmith <otto@redhat.com>
- updated to latest beta... builds much cleaner now.

* Thu Jan  8 1998 Otto Hammersmith <otto@redhat.com>
- created the package