aboutsummaryrefslogtreecommitdiffstats
path: root/main/libressl/APKBUILD
blob: a5be6cdd5d0fb892e65650623d0abc06bc1f427a (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
92
93
94
95
96
97
98
99
100
101
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Orion <systmkor@gmail.com>
# Maintainer: Orion <systmkor@gmail.com>
#
# secfixes:
#   2.7.4-r0:
#     - CVE-2018-0732
#     - CVE-2018-0495
#   2.5.3-r1:
#     - CVE-2017-8301
#
pkgname=libressl
pkgver=2.9.2
_namever=${pkgname}${pkgver%.*}
pkgrel=1
pkgdesc="Version of the TLS/crypto stack forked from OpenSSL"
url="http://www.libressl.org/"
arch="all"
license="custom"
depends=""
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/$pkgname-$pkgver.tar.gz
	starttls-ldap.patch
	ssl-libcompat.patch
	s_client-add-options-verify_.patch
	fix-getprogname.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare

	cd "$builddir"
	autoreconf -vif
}

build() {
	cd "$builddir"

	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() {
	cd "$builddir"
	make -j1 check
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING

	cd "$pkgdir"

	# /usr/bin/openssl will be replaced with openssl's binary. We provide
	# a /usr/bin/libressl binary in case something needs it.
	mv usr/bin/openssl usr/bin/libressl

	# 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=""

	mkdir -p "$subpkgdir"/lib "$subpkgdir"/usr/lib
	local f; for f in "$pkgdir"/usr/lib/$name.so.*; do
		mv $f "$subpkgdir"/lib/
		ln -s ../../lib/${f##*/} "$subpkgdir"/usr/lib/${f##*/}
	done
	if [ "$name" = "libcrypto" ]; then
		mv "$pkgdir"/etc "$subpkgdir"
	fi
}

sha512sums="b43e73e47c1f14da3c702ab42f29f1d67645a4fa425441337bd6c125b481ef78a40fd13e6b34dadb2af337e1c0c190cfb616186d4db9c9a743a37e594b9b8033  libressl-2.9.2.tar.gz
9f1628fbc2a697b6570353920d784b161ca0a122047066d8bee15225bad1e5271aa2ed72b145506bcd4ffe58b35da2caf38c4a048db7e014dabd16b5eba44581  starttls-ldap.patch
ef8150843f5aae577a859198439673591764fb3ab1da03436607328962f084356fd7f793484c3ad5f2294bd9e8dad15644c311b0da811acbc83eed4b71c0145a  ssl-libcompat.patch
4c992872addbe4fd612ba9e3f859b5ba69b448aafa7676751ca7ca09bbcfc47a2a1cad468c235f8d1a65c65e8efb38f27c512a32b444346c39ec0d8dcfbcd346  s_client-add-options-verify_.patch
73741073629cf85c155d7fc1c66ac41c5a29022a01a36bd3f26953edc60b07bd73f9d728ab8223d3833a14be2dcca88707373dcc2a97532aeb536a22bef9da77  fix-getprogname.patch"