APKBUILD 1.38 KB
Newer Older
TBK's avatar
TBK committed
1
# Contributor: TBK <alpine@jjtc.eu>
2
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
TBK's avatar
TBK committed
3
pkgname=libretls
J0WI's avatar
J0WI committed
4
pkgver=3.3.3p1
5
pkgrel=1
6
pkgdesc="port of libtls from libressl to openssl"
TBK's avatar
TBK committed
7
8
9
arch="all"
url="https://git.causal.agency/libretls/"
license="ISC AND (BSD-3-Clause OR MIT)"
10
depends="ca-certificates-bundle"
11
depends_dev="openssl-dev"
12
makedepends_host="openssl-dev"
13
makedepends="$depends_dev autoconf automake libtool"
TBK's avatar
TBK committed
14
subpackages="$pkgname-doc $pkgname-static $pkgname-dev"
15
16
source="https://causal.agency/libretls/libretls-$pkgver.tar.gz
	test_program.c"
TBK's avatar
TBK committed
17

18
19
20
21
22
23
24
25
prepare() {
	default_prepare

	# Override the LIBTLS_VERSION to be 2.0.0, as libtls-standalone was 1:0:0.
	echo '2:0:0' > "$builddir"/LIBTLS_VERSION
	autoreconf
}

TBK's avatar
TBK committed
26
build() {
27
28
29
30
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
TBK's avatar
TBK committed
31
32
33
34
35
36
37
	make all
}

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

38
39
40
check() {
	set -x

J0WI's avatar
J0WI committed
41
	# shellcheck disable=SC2046
42
43
44
45
46
47
48
	gcc -o test_program "$srcdir"/test_program.c -I"$builddir"/include -L"$builddir"/.libs -ltls $(pkgconf --cflags --libs openssl)
	LD_LIBRARY_PATH="$builddir"/.libs ./test_program

	set +x
}

sha512sums="
J0WI's avatar
J0WI committed
49
58806e87e9071fd370f7287c29e4e395d8fdb9e2db6105ee2d22d890a497b204d0cf041ea495c5fc565e0ab97d9172966b3e895e30feec30e541bd1b4ecef6db  libretls-3.3.3p1.tar.gz
50
51
71d36fe25c95a0a45497e3f699b01dddcaae9053dd1b1e2419df94272c47024cf6516c51c902129201061601b04a72551904b15a332a4cf53358983b5db73618  test_program.c
"