1 # Maintainer: Phillip Smith <fukawi2@NO-SPAM.gmail.com>
2 # http://github.com/fukawi2/aur-packages
4 ### I AM ONLY THE PACKAGER, NOT THE DEVELOPER
5 ### Please ask support questions about this software in one of:
6 ### 1) The AUR comments; OR
7 ### 2) Upstream forums/maillist etc; OR
8 ### 3) The ArchLinux forums
9 ### I do not always know enough about the software itself, or don't have the
10 ### time to promptly respond to direct emails.
11 ### If you have found a problem with the package/PKGBUILD (as opposed to
12 ### the software) then please do email me or post an AUR comment.
17 pkgdesc="Advanced Maryland Automatic Network Disk Archiver"
18 arch=('i686' 'x86_64')
20 depends=('perl>=5.6.0' 'glib2>=2.2.0' 'gawk' 'gnuplot' 'tar>=1.12' 'xinetd')
21 optdepends=('dump: for creating backups in dump format' 'samba: for backing up Windows hosts')
22 install="$pkgname.install"
23 url="http://www.amanda.org"
24 source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz" "xinetd.$pkgname")
25 md5sums=('e206f42fb523c6bfe728b03665d4e277'
26 '910c9823073148c576b14d4a71bc6458')
29 # the amanda user and group are required to build
30 if [ -z `getent passwd amanda` ] ; then
31 msg "Adding user/group amanda (temporarily)"
32 groupadd -g 112 amanda || return 1
33 useradd -u 112 -g amanda -G storage,disk -m -d /var/amanda -s /bin/bash -c "Amanda Backup Daemon" amanda || return 1
39 cd $srcdir/$pkgname-$pkgver
41 ./configure --prefix=/usr \
42 --with-configdir=/etc/amanda \
43 --with-gnutar-listdir=/var/amanda/gnutar-lists \
44 --mandir=/usr/share/man \
49 --htmldir=/srv/http/docs/$pkgname || return 1
53 if [ $cleanup -eq 1 ]; then
54 msg "Removing user/group amanda"
62 _amandahosts='var/amanda/.amandahosts'
63 _amandadates='var/amanda/amandates'
64 _amandadumpdates='var/amanda/dumpdates'
65 _amandagnutarlists='var/amanda/gnutar-lists'
67 # the amanda user and group are required to package
68 if [ -z `getent passwd amanda` ]; then
69 msg "Adding user/group amanda (temporarily)"
70 groupadd -g 112 amanda || return 1
71 useradd -u 112 -g amanda -G storage,disk -m -d /var/amanda -s /bin/bash -c "Amanda Backup Daemon" amanda || return 1
77 cd $srcdir/$pkgname-$pkgver || return 1
79 # Install the compiled output
80 make DESTDIR=$pkgdir install || return 1
82 # Install configuration examples
83 mkdir -p $pkgdir/etc/$pkgname/ || return 1
84 cp -r example $pkgdir/etc/$pkgname/ || return 1
86 # Install xinetd configuration
87 mkdir -p $pkgdir/etc/xinetd.d/ || return 1
88 cp $srcdir/xinetd.$pkgname $pkgdir/etc/xinetd.d/$pkgname || return 1
91 mkdir -p $pkgdir/var/$pkgname/ || return 1
92 chmod 700 $pkgdir/var/$pkgname/ || return 1
93 chown -R $_amandauser:$_devgroup $pkgdir/var/$pkgname || return 1
95 touch $pkgdir/$_amandahosts || return 1
96 chown $_amandauser:$_devgroup $pkgdir/$_amandahosts || return 1
97 chmod 600 $pkgdir/$_amandahosts || return 1
98 cat > $pkgdir/var/$pkgname/.amandahosts << EOT
99 # This is where amanda works out what remote connections to allow in the format
100 # of <host> <username> <command>
102 # server1.example.com amanda amdump
105 touch $pkgdir/$_amandadates || return 1
106 chown $_amandauser:$_devgroup $pkgdir/$_amandadates || return 1
108 touch $pkgdir/$_amandadumpdates || return 1
109 chown $_amandauser:$_devgroup $pkgdir/$_amandadumpdates || return 1
110 chmod 664 $pkgdir/$_amandadumpdates || return 1
112 mkdir -p $pkgdir/$_amandagnutarlists || return 1
113 chown -R $_amandauser:$_devgroup $pkgdir/$_amandagnutarlists || return 1
116 chown -R $_amandauser:$_devgroup $pkgdir/etc/$pkgname/ || return 1
118 # Install the licence
119 install -Dm444 COPYRIGHT $pkgdir/usr/share/licences/$pkgname/COPYRIGHT || return 1
122 rm -Rf $pkgdir/usr/share/amanda/example/ || return 1
123 if [ $cleanup -eq 1 ]; then
124 msg "Removing user/group amanda"
129 # vim:set ts=2 sw=2 et: