# Contributor: Breno Leitao <breno.leitao@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=quilt
pkgver=0.68
pkgrel=0
pkgdesc="Easily manage large numbers of patches"
url="https://savannah.nongnu.org/projects/quilt"
arch="noarch"
license="GPL-2.0-only"
depends="bash bzip2 diffutils gawk gettext patch"
makedepends="lynx perl sed"
checkdepends="ed"
subpackages="
	$pkgname-doc
	$pkgname-lang
	$pkgname-bash-completion
	"
source="https://download.savannah.gnu.org/releases/quilt/quilt-$pkgver.tar.gz"
# Broken: "mv: can't rename 'patches/test.diff': Permission denied !"
options="!check"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make all
}

check() {
	make check
}

package() {
	make BUILD_ROOT="$pkgdir" install

	cd "$pkgdir"
	mkdir -p usr/share/bash-completion
	mv etc/bash_completion.d usr/share/bash-completion/completions
}

sha512sums="
a2a58b330ccb3dd55b1f280310d506c605166bceedf7439582cdf8a198ca4aa34a375fd8bfd4027c540481bcdf5e6175eafd19707aaabe194b01cf7caa40572e  quilt-0.68.tar.gz
"
