# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=myrepos
pkgver=1.20171231
pkgrel=0
pkgdesc="A multiple repository management tool"
url="https://git.joeyh.name/git/myrepos.git"
arch="noarch"
license="GPL-2.0-or-later"
depends="perl git"
depends_dev=""
makedepends=""
replaces="mr"
install=""
subpackages="$pkgname-doc"
source="https://git.joeyh.name/index.cgi/myrepos.git/snapshot/myrepos-${pkgver}.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	make
}

package() {
	cd "$builddir"
	install -Dm755 mr "$pkgdir"/usr/bin/mr || return 1
	cd "$builddir"/lib
	for file in git-fake-bare git-svn unison; do
		install -Dpm 0644 $file \
			"$pkgdir"/usr/share/$pkgname/$file
	done
}

check() {
	cd "$builddir"
	make test
}

doc() {
    cd "$builddir"
    mkdir -p "$subpkgdir"/usr/share/man
    mv "$builddir"/*.1 "$subpkgdir"/usr/share/man/
	# Sample configuration files
	for file in mrconfig mrconfig.complex; do
		install -Dpm 0644 $file \
			"$subpkgdir"/usr/share/doc/$pkgname/$file
	done
    default_doc
}

sha512sums="a0705ecaee45a6de71d34e43d238ddbe2a661634df4236e037196bc420136118bd2827c4d860a81371612e578b2d94ecb29f9e0a2506f2ba44bdea40148f8ed0  myrepos-1.20171231.tar.gz"
