aboutsummaryrefslogtreecommitdiffstats
path: root/main/libretls/APKBUILD
blob: 5f14aa8c6cd4ece58011b9dcbb8380f15c50b7fd (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
47
48
49
50
51
52
53
54
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=libretls
pkgver=3.3.3
pkgrel=2
pkgdesc="port of libtls from libressl to openssl"
arch="all"
url="https://git.causal.agency/libretls/"
license="ISC AND (BSD-3-Clause OR MIT)"
depends="ca-certificates-bundle"
depends_dev="openssl-dev"
makedepends_host="openssl-dev"
makedepends="$depends_dev autoconf automake libtool"
subpackages="$pkgname-doc $pkgname-static $pkgname-dev"
source="https://causal.agency/libretls/libretls-$pkgver.tar.gz
	test_program.c"
# transitional hackfix
provides="so:libtls.so.20=$pkgver"

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
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make all
}

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

check() {
	set -x

	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="
b9fe3d807a0ad8bdd3c4ee7d5437d238bd34386974e369981ba7e33d64c7675626ed4072a6841f0e6aef2a9a0a6966366ff9a6097172db29cb1ec002e10a49f6  libretls-3.3.2.tar.gz
71d36fe25c95a0a45497e3f699b01dddcaae9053dd1b1e2419df94272c47024cf6516c51c902129201061601b04a72551904b15a332a4cf53358983b5db73618  test_program.c
"
sha512sums="21128107ce833690f43400b11c2a841373bbe1f045a6db5ad6cbcbee181ddf97c173bb05ba41805ee0324d7435a52ad3027551f20083df9a3d052956a412bccd  libretls-3.3.3.tar.gz
71d36fe25c95a0a45497e3f699b01dddcaae9053dd1b1e2419df94272c47024cf6516c51c902129201061601b04a72551904b15a332a4cf53358983b5db73618  test_program.c"