aboutsummaryrefslogtreecommitdiffstats
path: root/community/libressl/APKBUILD
blob: 9ea8180fbf571e242c7726b49e3ab59d9a1b3078 (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
87
88
89
90
91
# 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.4.1
_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
sonameprefix="libressl:"  # avoid mix up with libretls
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
	disable-test.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="
6a4ff612a9f82da672a66c9db807e34cabc961ffa309900cefde2c5061e129d1ec06f9688f5e83ebc5d8ed21a64ff0035271c807b71113b9e8f54e094cc8632f  libressl-3.4.1.tar.gz
18e72b7db28664ee4e294a4a461e48daa90be9e9323584112a5878fd56a578d02f4730c7c788f57cc39b2bc35447df0a47a4391077d764d953419890ad511d35  ssl-libcompat.patch
e786a19917900122c48b2e5882d357288b918f4ce07d697b4d9819f4c323020ae191a45dd7d5b75a3c20742d69ec89d72bf3a8d078b078c0e97f363db491ce6a  disable-test.patch
"