# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=rsnapshot
pkgver=1.4.2
pkgrel=0
pkgdesc="Local and remote filesystem snapshot utility"
url="http://www.rsnapshot.org/"
arch="noarch"
license="GPL-2.0-or-later"
depends="perl rsync openssh-client"
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
source="http://www.rsnapshot.org/downloads/rsnapshot-$pkgver.tar.gz
	"

_builddir="$srcdir"/rsnapshot-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
}

md5sums="860382f19e38fc649f9447397b54e442  rsnapshot-1.4.2.tar.gz"
sha256sums="042a81c45b325296b21c363f417985d857f083f87c5c27f5a64677a052f24e16  rsnapshot-1.4.2.tar.gz"
sha512sums="621be52715a6c1f70ddb251d7f6103ba3487cd0c6c607411d744866547d3ced571862a8f6b5e40a1d050696703f3a15821bd6e829a3fca057848f04566d0e4a0  rsnapshot-1.4.2.tar.gz"
