aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sbsigntool/APKBUILD
blob: 6c4c4cea6c8ce4cbfbf9e4a7cdeffeb046baf06f (plain)
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
47
48
49
50
51
52
53
54
55
56
# Contributor: Tero Hilpinen <tero.hilpinen@symbio.com>
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>

pkgname=sbsigntool
pkgver=0.9.2
pkgrel=0
_ccancommit=261b10869ddbb4ac650ef8886c5052b1a8dbeecd
pkgdesc="Secure Boot signing tools"
url="https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/"
arch="x86_64"
license="GPL-3.0-only"
makedepends="autoconf automake bash binutils-dev gnu-efi-dev help2man openssl-dev util-linux-dev"
options="!check"	# testsuite is not functional
subpackages="$pkgname-doc"
source="https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/snapshot/sbsigntools-$pkgver.tar.gz
	ccan-$_ccancommit.tar.gz::https://git.ozlabs.org/?p=ccan;a=snapshot;h=$_ccancommit;sf=tgz
	0001-fix-autogen.patch
	"
builddir="$srcdir/sbsigntools-$pkgver"

prepare() {
	default_prepare
	rm -rf "$builddir"/lib/ccan.git "$builddir"/lib/ccan
	ln -s ../../ccan-$(echo $_ccancommit | cut -b -7) "$builddir"/lib/ccan.git

	# fix ccan for musl and to work outside git checkout
	sed -i -e 's,sys/unistd.h,unistd.h,g' "$builddir"/lib/ccan.git/ccan/opt/usage.c
	sed -i -e 's,--git-only "$module_dir","$module_srcdir",g' "$builddir"/lib/ccan.git/tools/create-ccan-tree

	# autogen.sh is missing 'list', instantiate ccan here
	lib/ccan.git/tools/create-ccan-tree \
		--build-type=automake lib/ccan \
		"talloc read_write_all build_assert array_size endian list"

	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="060753ed9c8db794e4755cc66c1940a2ccc89f4ddf0e825da1f1e6eaa75fc67c21060ee4b5dfb0c757b69e6f5959bfa68156d9f95a945cf63c6a20f1414a2c27  sbsigntools-0.9.2.tar.gz
730c70cf88cfbf23796053aa689e419f433285c7fec7a6f4b5cf13efead12f99752db70790ff321da374180e3178aed105ce5bd3f66daadf545ef9b5bb02f6cd  ccan-261b10869ddbb4ac650ef8886c5052b1a8dbeecd.tar.gz
9bf0a12c7735d09e1562ad901676a7ca9572265abee88580d4f830723a28423062d5b77fe02f21414884aeb046e84cf09da599754eafaad660c5938469c460a9  0001-fix-autogen.patch"