# vim: set syn=sh:
# Packager: Phill Watkins <ubemail~at~ymail~dot~com>

pkgname=partimage
pkgver=0.6.9
pkgrel=2pw
#arch=noarch
source=("http://downloads.sourceforge.net/project/partimage/stable/$pkgver/partimage-$pkgver.tar.bz2" "rc.partimaged.gz" "README.Slackware.gz")
sourcetemplate=http://people.salixos.org/pwatk/packages/13.2/ap/$pkgname
docs=("ABOUT-NLS" "FORMAT" "INSTALL" "THANKS")
url=http://www.partimage.org/
dotnew=('etc/partimaged/partimagedusers')
options=('noautodotnew' 'nosrcpack')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"partimage (Filesystem backup utilities)"
"Partimage is an opensource disk backup software. It saves partitions"
"having a supported filesystem on a sector basis to an image file."
"The image file can be compressed to save disk space and transfer time"
"and can be split into multiple files to be copied to CDs or DVDs."
"Partitions can be saved across the network using the partimage network"
"support, or using Samba / NFS (Network File Systems). This provides"
"the ability to perform a hard disk partition recovery after a disk"
"crash."
"Note: Read '/usr/doc/partimage-$pkgver/README.Slackware' for help."
)

build() {
	set -e
	
	cd $startdir/src/$pkgname-$pkgver
	./configure \
	  --prefix=/usr \
	  --sysconfdir=/etc \
	  --localstatedir=/var \
	  --libdir=/usr/lib${LIBDIRSUFFIX} \
	  --mandir=/usr/man \
	  --infodir=/usr/info \
	  --docdir=/usr/doc/$pkgname-$pkgver \
	  --build=$arch-slackware-linux
	make -j $numjobs
	make install DESTDIR=$startdir/pkg
	install -d $startdir/pkg/etc/rc.d/desc.d
	cat <<- EOF > $startdir/pkg/etc/rc.d/desc.d/partimaged.txt
	partimaged:Partimage Server Daemon:partimaged
	EOF
	chmod 644 $startdir/pkg/etc/rc.d/desc.d/partimaged.txt
	install -m 0644 $startdir/src/rc.partimaged $startdir/pkg/etc/rc.d/
	install -d $startdir/pkg/var/spool/partimaged
	install -Dm 0644 $startdir/src/README.Slackware $startdir/pkg/usr/doc/$pkgname-$pkgver/README.Slackware

	set +e
}