aboutsummaryrefslogtreecommitdiffstats
path: root/community/libressl/APKBUILD
blob: f279c454e0344171ce200dde1ffa2ece5e4695d0 (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
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
92
93
94
95
96
97
98
99
100
101
102
103
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Orion <systmkor@gmail.com>
# Maintainer: Orion <systmkor@gmail.com>
#
# secfixes:
#   3.4.3-r0:
#     - CVE-2022-0778
#   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.6.2
_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 $pkgname-nc"
source="https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$pkgver.tar.gz 0001-libressl.cnf.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 \
		--enable-nc \
		--program-prefix "libressl-"
	make
}

check() {
	make check
}

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

	# Remove symlinks that point to OpenSSL man pages.
	# The symlink creation does not account for --program-prefix.
	find -L "$pkgdir"/usr/share/man/man3/ -type l -delete

	cd "$pkgdir"

	# compatibility symlink (binary was called libressl previously).
	ln -s libressl-ocspcheck "$pkgdir"/usr/bin/ocspcheck
	ln -s libressl-ocspcheck.8 "$pkgdir"/usr/share/man/man8/ocspcheck.8
	ln -s libressl-openssl "$pkgdir"/usr/bin/libressl
	ln -s libressl-openssl.1 "$pkgdir"/usr/share/man/man1/libressl.1

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

	mv etc/ssl/openssl.cnf etc/ssl/libressl.cnf
}

nc() {
	pkgdesc="libressl TLS-enabled nc(1)"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/libressl-nc "$subpkgdir"/usr/bin/nc
}

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

	amove usr/lib/$name.so.*

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

sha512sums="
8fc81e05d1c9f9259d06508ca97d5a1ba5d46b857088c273c20e6b242921f7eac58a1136564ad9831c923758ee63f7b0897c8c6c7b1e53ab8132a995cc559aeb  libressl-3.6.2.tar.gz
aefa5dc99345462a93f97061fdee6b5b148eed30c4bf7a7097ade8cef9dd890d8d7100558d5e1ebe6790372261c76ce04a874526cb521dea068ec1439259a035  0001-libressl.cnf.patch
"