Skip to content
Snippets Groups Projects
Unverified Commit 0519b471 authored by Clayton Craft's avatar Clayton Craft :man_dancing_tone3:
Browse files

abuild: add postcheck for required license file

Some licenses require distributing a copy of the license file[1], this
adds a postcheck to make sure that packages of software with one of
these licenses is meeting the requirement.

1. https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package#license
parent 8e2d2f73
No related branches found
No related tags found
No related merge requests found
Pipeline #309296 failed
...@@ -923,6 +923,19 @@ postcheck() { ...@@ -923,6 +923,19 @@ postcheck() {
e=1 e=1
fi fi
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 return $e
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment