# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=patch
pkgver=2.7.5
pkgrel=1
pkgdesc="Utility to apply diffs to files"
url="https://www.gnu.org/software/patch/patch.html"
arch="all"
license="GPL"
depends=""
depends_dev=""
makedepends=""
install=""
subpackages="$pkgname-doc"
source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz"

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

package() {
	make prefix="$pkgdir"/usr \
		mandir="$pkgdir"/usr/share/man \
		-C "$_builddir" install || return 1

	rm -f "$pkgdir"/usr/lib/charset.alias
	rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
}

md5sums="e3da7940431633fb65a01b91d3b7a27a  patch-2.7.5.tar.xz"
sha256sums="fd95153655d6b95567e623843a0e77b81612d502ecf78a489a4aed7867caa299  patch-2.7.5.tar.xz"
sha512sums="6620ac8101f60c0b456ce339fa5e371f40be0b391e2e9728f34f3625f9907e516de61dac2f91bc76e6fd28a9bd1224efc3ba827cfaa606d857730c1af4195a0f  patch-2.7.5.tar.xz"
