# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
setvar pkgname = 'patchutils'
setvar pkgver = '0.3.4'
setvar pkgrel = '0'
setvar pkgdesc = ""A collection of programs for manipulating patch files""
setvar url = ""http://cyberelk.net/tim/patchutils/""
setvar arch = ""all""
setvar license = ""GPLv2+""
setvar depends = """"
setvar depends_dev = """"
setvar makedepends = ""$depends_dev xmlto""
setvar install = """"
setvar subpackages = ""$pkgname-doc""
setvar source = ""http://cyberelk.net/tim/data/patchutils/stable/patchutils-$pkgver.tar.xz""

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

proc 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
}

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

setvar md5sums = ""ee95b5993d07ccdf27ca9f2cc4e6ffee  patchutils-0.3.4.tar.xz""
setvar sha256sums = ""cf55d4db83ead41188f5b6be16f60f6b76a87d5db1c42f5459d596e81dabe876  patchutils-0.3.4.tar.xz""
setvar sha512sums = ""ede006122fad180b78feaf69294f1c40c0a764981fa581f1893abeeb0421f9d586fc33f79d065690a6bc6187a31f11311b086669879dde12c6e49c7c8a2aa440  patchutils-0.3.4.tar.xz""