# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Takuya Noguchi <takninnovationresearch@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=ansible
pkgver=2.5.0
pkgrel=0
pkgdesc="A configuration-management, deployment, task-execution, and multinode orchestration framework"
url="https://ansible.com"
arch="noarch"
license="GPL-3.0-or-later"
_py=py2
depends="python2 $_py-yaml $_py-paramiko $_py-jinja2 $_py-markupsafe $_py-crypto"
makedepends="python2-dev py-setuptools"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://releases.ansible.com/ansible/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build
}

package() {
	cd "$builddir"
	python2 setup.py install --prefix=/usr --root="$pkgdir"

	mkdir -p "$pkgdir"/usr/share/man/man1
	install -Dm644 "$builddir"/docs/man/man1/*.1 \
		"$pkgdir"/usr/share/man/man1/

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/examples/
	install -m644 examples/* \
		"$pkgdir"/usr/share/doc/$pkgname/examples/
	install -m644 README.md "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="93dee0404c5de0a9c8c5b8987f1fb2dbacceb848e8d5b4c70c5a6692d6fe8e9d4bec67d592071346f458b46b9ed2d800609a080d7d4b16266943f32d56a19220  ansible-2.5.0.tar.gz"
