# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=augeas
pkgver=1.4.0
pkgrel=4
pkgdesc="A configuration editing tool"
url="http://augeas.net"
arch="all"
license="LGPL2+"
depends=""
depends_dev=""
makedepends="$depends_dev readline-dev libxml2-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-tests $pkgname-libs"
source="http://download.augeas.net/augeas-$pkgver.tar.gz
	0001-Shellvars-accept-and-builtins.patch
	0002-Shellvars-Add-test-for.patch
	0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch
	0004-Shellvars-allow-wrapping-loop-condition-to-multiple-.patch
	0005-Shellvars-guard-against-comments.patch
	0006-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch
	0007-Shellvars-allow-quotes-in-loop-conditions.patch
	0008-Shellvars-case-support-quotes-and-spaces-in-pattern-.patch
	0009-Shellvars-add-eval-builtin-support.patch
	0010-Shellvars-add-alias-builtin-support.patch
	0011-Shellvars-pattern-nodes-in-case-entries.patch
	0012-Shellvars-use-sto_to_semicol-in-condition-lens.patch
	0013-Shellvars-allow-and-constructs-after-condition.patch
	0014-Shellvars-Allow-almost-any-command.patch
	0015-Shellvars-support-pipes-in-commands.patch
	0016-Shellvars-allow-in-commands.patch
	0017-Shellvars-allow-wrapping-command-sequences.patch
	0018-Shellvars-test-case-for-wrapping-command-arguments.patch
	0019-Shellvars-allow-command-specific-environment-variabl.patch"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		|| return 1
	make || return 1
	make tests || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm -rf "$pkgdir"/usr/lib/charset.alias
}

tests() {
	pkgdesc="Tests for Augeas lenses"
	arch="noarch"
	mkdir -p "$subpkgdir"/usr/share/augeas/lenses/dist/
	mv "$pkgdir"/usr/share/augeas/lenses/dist/tests \
		"$subpkgdir"/usr/share/augeas/lenses/dist/
}

libs() {
	pkgdesc="Libraries for augeas"
	replaces="augeas"
	mkdir -p "$subpkgdir"/usr/ "$subpkgdir"/usr/share/augeas/
	mv "$pkgdir"/usr/lib "$subpkgdir"/usr/ || return 1
	mv "$pkgdir"/usr/share/augeas/lenses \
		"$subpkgdir"/usr/share/augeas/ || return 1
}

md5sums="a2536a9c3d744dc09d234228fe4b0c93  augeas-1.4.0.tar.gz
ac6a5348b2fb800c759ee1b9d3f208b2  0001-Shellvars-accept-and-builtins.patch
1b45428c83fb5236e54961716e8efd09  0002-Shellvars-Add-test-for.patch
0bd5bbdf3f22fabf94a737e807113bcc  0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch
feba0e8c53a50edce3362f4cfc9d3042  0004-Shellvars-allow-wrapping-loop-condition-to-multiple-.patch
176c8cedfbe43f31aed65b9186ee6ecf  0005-Shellvars-guard-against-comments.patch
75a620500429bf1b593d09d316de0e03  0006-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch
3c17d8dfeef14a6ed8d4595ec901a8f4  0007-Shellvars-allow-quotes-in-loop-conditions.patch
7f5862b88d906bc7432d88d35dec40c7  0008-Shellvars-case-support-quotes-and-spaces-in-pattern-.patch
c8c7614f2541ded21261de7386eb1583  0009-Shellvars-add-eval-builtin-support.patch
70754abccd6e363daff6e1ccf9033de8  0010-Shellvars-add-alias-builtin-support.patch
2ff6fcd174cc94eea1afecb5132eed25  0011-Shellvars-pattern-nodes-in-case-entries.patch
739e0802c21c3046d33f057f1ffae4d4  0012-Shellvars-use-sto_to_semicol-in-condition-lens.patch
ce58c1557af98c31868aaa046b125652  0013-Shellvars-allow-and-constructs-after-condition.patch
d66b1b77d7f39a9d211765364e7cfa0f  0014-Shellvars-Allow-almost-any-command.patch
9800625964610d417118a893c0e5c754  0015-Shellvars-support-pipes-in-commands.patch
461ac5da32645468623b2cb1f886acae  0016-Shellvars-allow-in-commands.patch
c3b968af2e2aa423581a564c8107605c  0017-Shellvars-allow-wrapping-command-sequences.patch
5e31b0f813afc1d5b43f52d34baa9832  0018-Shellvars-test-case-for-wrapping-command-arguments.patch
59e19136f59c70d6c36025124deb389b  0019-Shellvars-allow-command-specific-environment-variabl.patch"
sha256sums="659fae7ac229029e60a869a3b88c616cfd51cf2fba286cdfe3af3a052cb35b30  augeas-1.4.0.tar.gz
590857f339fc3e758624c6854c8686ba19faa7d28bde58d19ffa4513d63d76ed  0001-Shellvars-accept-and-builtins.patch
4ac77be95a2d98185dd7966acb2b8b8e9af24589d50ba8650862835a9388db27  0002-Shellvars-Add-test-for.patch
dfb422c7382e18cf79b564c59281839a21233235ee9b55c50b64495dc04123ba  0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch
52107a259ce09eeccd32d79c3ded96ab1a9446bcec21f94fb8604f5793b2e8fd  0004-Shellvars-allow-wrapping-loop-condition-to-multiple-.patch
47e2289ec139f4583d1b70b98f09af5284bdd8e9ad42b4c1e484e3abe452ab16  0005-Shellvars-guard-against-comments.patch
a7930d8233d5a0a3151df89ddcbb71b7301347e280e05a6fa6dcc4cc0e8c0fb4  0006-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch
bd15c33425ab6beaf8f34d9bdea3f1d1db3874bbaf8504ab706572990b1c18e1  0007-Shellvars-allow-quotes-in-loop-conditions.patch
68a7841925bd93f063c1e6e5d08ac30487b348be9e91cbd2eaf4e7a9f3420814  0008-Shellvars-case-support-quotes-and-spaces-in-pattern-.patch
4e64c9ed5911ff1023f0c8ba792417eb82eff41b46bd58e36446ec07dd27816b  0009-Shellvars-add-eval-builtin-support.patch
aa41d90913833a91396310da8f874bc75066e4d7813677a516671bd93546154f  0010-Shellvars-add-alias-builtin-support.patch
6e31cea68c0e9ca2dad5d506041eb18d3223c16775b72c88dc64871307239b15  0011-Shellvars-pattern-nodes-in-case-entries.patch
32590f2b9fa6358ee475d922154328fd25d978db406c9a752341c62f4cc1275d  0012-Shellvars-use-sto_to_semicol-in-condition-lens.patch
254a4b1ead8b1ce3c4650b0077d426d607740e37798d9f5311834466cfdb262c  0013-Shellvars-allow-and-constructs-after-condition.patch
bb2a9460a367040186a858bad95aff355fdb9162488bc453125c28ced1680204  0014-Shellvars-Allow-almost-any-command.patch
4c4ebfba20f5ecf9adaa0e88b26b3a1ef8cf274d7a1dd2aec39a1efd39ad493d  0015-Shellvars-support-pipes-in-commands.patch
5a96fe8d5b513014ef77ecb5c64bb6cf27eba560347d498bcda2bc3cc2e4bc56  0016-Shellvars-allow-in-commands.patch
4191d31076f2751996cdffa5dcc8d3337c7cc197b4e2711c368d9d5f061c27e6  0017-Shellvars-allow-wrapping-command-sequences.patch
9bd9ab6b1902202748e0f3dc004297e64a14a68dee025b4a3951330bfe13ac6b  0018-Shellvars-test-case-for-wrapping-command-arguments.patch
bf25ccc9a0bf4cd45f91bfcfa9c6b8dd89f0903c1117d74c8eaf61685173a088  0019-Shellvars-allow-command-specific-environment-variabl.patch"
sha512sums="182457698e51be89feadb16879bae2f2413a5761127efb63a9b7ef30806f4059bca614e8c9627b0c7a010b9ec9c03c85161e655bdb2902f7cf43e89b66e312db  augeas-1.4.0.tar.gz
8844c34c2cbf68d605214d0738e2106d5712ddb2e745910bfb99856fb34a2475e9522d68df6e596e2d81423136b1a6a23db9f5f7a0c4dcc43b618017fa493742  0001-Shellvars-accept-and-builtins.patch
d9178f6f90556b14a4c1295fa9ec0649e0d1ef72bc4431e194ba03b42ef20363d8ea057a209f6a2a278a8b072b56241caa7e5fc574d2c3a01bc4f642f05b8eb4  0002-Shellvars-Add-test-for.patch
35453cfc3335be2862f83eabcec47b6858977fbead22ec32c920510575af52a1bd73d9c8629ae1d4e3907fddef134c76a5d413252b7252aa227efa3e103473fa  0003-Shellvars-allow-partial-quoting-mixing-multiple-styl.patch
3ff2da5feba485546e60b31173612b1775fbcc79252c08d4f75dcc7822d7a080a13ab50c01af7a0f0f019a6ce80fe6d2f122dc21b944f9fe908e67e3984c24fd  0004-Shellvars-allow-wrapping-loop-condition-to-multiple-.patch
461f40d72932191e9b32d2b1e03356768bda84e754a33a57ffc8ca2ee807a93b9290cf6166738d7074c2b8a5b0f7016b105e8f82f51e52afc0ae94df1d632fdc  0005-Shellvars-guard-against-comments.patch
494639e2049b2dd559e4f1ef174b2ee021df7aa86dd24183da637486475d10d9e7a4ce885da0066c488fc25097871057d506c7de487fd5a67d76cc470de91fa0  0006-Shellvars-allow-wrapping-builtin-arguments-to-multip.patch
0675b2e8a23866e28c813c80b52d13b7f8fc90020dd63455f74b8739c4019243ecf2e27b5e71fffdee37c1784f4bc611ed15c53c59d02669147767b41ff18259  0007-Shellvars-allow-quotes-in-loop-conditions.patch
c268d6a45bb3978737431ca97b4b1670db8ca765607fe4c632919e2481258702779205532ee5eba4d14bf9a6b92c4741595d405b42903c8e3e05f937fbf856fe  0008-Shellvars-case-support-quotes-and-spaces-in-pattern-.patch
8b1a26e6cfd6b8367755657ce66332fa0e9bbb49e00a5e368fd946d4f91507cdb9f371cf1ad7519aeb58728feb87fb91cc6c54be253576483aa6b424fb6d5675  0009-Shellvars-add-eval-builtin-support.patch
7b3fddde9677ad2c04374bbbc9da660ec07da3a9f7c212d30b20f8850d48f16a5c31faa13500ac3c5823cea56b0a6f73f54b217d2b95f55674ed2c9bc8919532  0010-Shellvars-add-alias-builtin-support.patch
32b6b65481aa669934f47031e269743d3e4c1dfb5b03d2d8ecffc9b11344b73fed79cddcf3a564dda2645595315714859110b822a0ab4f8a58dcc8d7a72d60b6  0011-Shellvars-pattern-nodes-in-case-entries.patch
0bc6d17ed05147c3846010cc563c983ddcbdc52b5428896afcde9216cc3c4cd4405d564f5847ff9a27e13a584b40b4c239509adbefcb4ed9d65f43ef6e44a103  0012-Shellvars-use-sto_to_semicol-in-condition-lens.patch
4ac2c7c25a7b61cf4a40f50d1e57e6184ca307b20e06f04c3111ff893e54977ca122206bc0c5d1d7377b322c4ebc7cf81e1de7f70d9a9f9dd6e968832ac7d2dc  0013-Shellvars-allow-and-constructs-after-condition.patch
8f636ac0c6058309f6eda50e29a91b1ad3efe17eb62f74d2eb2f79ab8a6ebc1d049b078694bb2ee2b4c121d3b05d79661150a9fef84a7002d3d821d11d3af616  0014-Shellvars-Allow-almost-any-command.patch
2fc5fa8865066c3bece6704c06a257ccbf32e116d780cfb53989e93628de1f486ae236f70a9d447640211b5a7dd1250b1227b0801c6d7966aa9b0bcf540604d4  0015-Shellvars-support-pipes-in-commands.patch
211339389eea3dce5aaed66db416fade2231c8353ccf4dbb1f9e766a8ac54b5857ca0016783da094daa32e32cd25ffd89b12b6cb3920a1dcaf758913978c088d  0016-Shellvars-allow-in-commands.patch
48b3172aec95b52b1473fda28a99e43a085844497027adba8b8cd8830da4a7d5bf0a6f6eb3dbbab24d8023a3a24ab0d19f355f5242488821ed8bceb34a0b5bf8  0017-Shellvars-allow-wrapping-command-sequences.patch
18d986609523ad968b0e006081ad7073a799f40902c880c4a3e4f2478b2792b5568d68e9fa48fed3314c136dac985ae8ea0a4c8d7152c24cbda1b9fb1e097683  0018-Shellvars-test-case-for-wrapping-command-arguments.patch
8371f154457b3dbb8a95f73cd39cd9bc6bfde03418174561eb09fd04f76bd6ce7215890c68d45d4b9ac5fef4433c2ef79c01910dc3a3818cfb46a3aa1d8b0082  0019-Shellvars-allow-command-specific-environment-variabl.patch"