aboutsummaryrefslogtreecommitdiffstats
path: root/community/libressl/APKBUILD
blob: 9a1eec23cd4f46bfe3d7710a3c5aebeee35f2af4 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Orion <systmkor@gmail.com>
# Maintainer: Orion <systmkor@gmail.com>
#
# secfixes:
#   3.1.5-r0:
#     - CVE-2020-1971
#   2.7.4-r0:
#     - CVE-2018-0732
#     - CVE-2018-0495
#   2.5.3-r1:
#     - CVE-2017-8301
#
pkgname=libressl
pkgver=3.2.5
_namever=${pkgname}${pkgver%.*}
pkgrel=0
pkgdesc="Version of the TLS/crypto stack forked from OpenSSL"
url="https://www.libressl.org/"
arch="all"
license="custom"
pcprefix="libressl:" # avoid mix up with openssl pkg-config
makedepends_build="automake autoconf libtool"
makedepends_host="linux-headers"
makedepends="$makedepends_host $makedepends_build"
subpackages="$pkgname-dbg $_namever-libcrypto:_libs $_namever-libssl:_libs
	$_namever-libtls:_libs $pkgname-dev $pkgname-doc"
source="https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$pkgver.tar.gz
	ssl-libcompat.patch
	"

prepare() {
	default_prepare

	autoreconf -vif
}

build() {
	CFLAGS="-L$CBUILDROOT/usr/lib $CFLAGS" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--with-sysroot=$CBUILDROOT \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING

	cd "$pkgdir"

	# /usr/bin/openssl is provided by the openssl package.
	mv usr/bin/openssl usr/bin/libressl
	mv usr/share/man/man1/openssl.1 usr/share/man/man1/libressl.1

	# Provided by ca-certificates-cacerts
	rm etc/ssl/cert.pem
	rmdir etc/ssl/certs

	# Provided by openssl's libcrypto1.1
	rm etc/ssl/openssl.cnf
}

_libs() {
	local name="${subpkgname#$_namever-}"
	pkgdesc="libressl $name library"
	depends=""

	amove usr/lib/$name.so.*

	if [ "$name" = "libcrypto" ]; then
		amove etc
	fi
}

sha512sums="7b34d826685d8d6da74dee127138ad8cbb0b5a82e9eca8f45891e431a85ed9a7bcdcf28ad69064c5ce7e4d465ad2ac895074ba308e4bad303bcd7a12fcaa3ea2  libressl-3.2.5.tar.gz
18e72b7db28664ee4e294a4a461e48daa90be9e9323584112a5878fd56a578d02f4730c7c788f57cc39b2bc35447df0a47a4391077d764d953419890ad511d35  ssl-libcompat.patch"