diff --git a/abuild.in b/abuild.in index 9a54d7581dd75c74bfc687b50f7772136174fc30..19a0d0d25e74517bc4181b080a1066c5a2fd40d9 100644 --- a/abuild.in +++ b/abuild.in @@ -923,6 +923,19 @@ postcheck() { e=1 fi fi + + # test for required license file + # https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package#license + if [ "$name" = "$pkgname" ]; then + local i; for i in $license; do + list_has "$i" AND OR WITH && continue + if list_has "$i" MIT ISC \ + && [ ! -f "$dir/usr/share/licenses/$pkgname/LICENSE" ]; then + error "Requires license but none found at /usr/share/licenses/$pkgname/LICENSE" + e=1 + fi + done + fi return $e }