aboutsummaryrefslogtreecommitdiffstats
path: root/community/spdx-licenses/APKBUILD
blob: 459f6d3d29e424317d159e8379fda125a0ae56d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=spdx-licenses
pkgver=3.6
pkgrel=0
pkgdesc="Various data formats for the SPDX License List"
url="https://spdx.org/"
arch="noarch"
options="!check"
license="CC-BY-3.0"
source="license-list-data-$pkgver.tar.gz::https://github.com/spdx/license-list-data/archive/v$pkgver.tar.gz"
builddir="$srcdir/license-list-data-$pkgver"
subpackages="$pkgname-list"

_types="html json rdfa rdfnt rdfturtle rdfxml template text"

for type in $_types; do
	subpackages="$subpackages $pkgname-$type:_subpkg"
done

build() {
	cd "$builddir"
}

package() {
	mkdir -p "$pkgdir"
}

_subpkg() {
	local type=${subpkgname/$pkgname-/}
	pkgdesc="$pkgdesc ($type)"
	install_if="$pkgname"
	mkdir -p "$subpkgdir"/usr/share/spdx
	cp -r "$builddir"/$type "$subpkgdir"/usr/share/spdx/
}

list() {
	pkgdesc="$pkgdesc (licence list)"
	mkdir -p "$subpkgdir"/usr/share/spdx
	local i; for i in $builddir/text/*.txt; do
		local license=${i##*/}
		echo ${license%.*} >> "$subpkgdir"/usr/share/spdx/license.lst
	done
}

sha512sums="2caf1308318c388b0580fd0fd330c41bbabb9e0fef68242cd0d994b3e19fbc2fcb092ef8734a12cc91256c77d2b6f5880e325e264b369d06f5239f482a9d7bc5  license-list-data-3.6.tar.gz"