aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/libtls/template
blob: 5ab8c6c84e269028c3fca8a88ebb771a0e51a384 (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
# Template file for 'libtls'
pkgname=libtls
version=3.2.5
revision=2
wrksrc="libressl-${version}"
build_style=gnu-configure
configure_args="$(vopt_enable asm)"
hostmakedepends="automake libtool"
depends="ca-certificates"
short_desc="Version of the TLS/crypto stack forked from OpenSSL"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="OpenSSL, ISC"
homepage="http://www.libressl.org/"
changelog="https://raw.githubusercontent.com/libressl-portable/portable/master/ChangeLog"
distfiles="http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${version}.tar.gz"
checksum=798a65fd61d385e09d559810cdfa46512f8def5919264cfef241a7b086ce7cfe
_lssl_asm_ver="1.2.0"
replaces="libtls20>0"

build_options="asm"
desc_option_asm="Use platform assembly for faster crypto"

build_options_default="asm"

if [ "$build_option_asm" ]; then
	distfiles+=" https://github.com/q66/libressl-portable-asm/archive/v${_lssl_asm_ver}.tar.gz"
	checksum+=" e1c76178c4deb1cd20a0cd7ba553d6607f8131acb2e0844223f797e42f0d6f60"
fi

case "$XBPS_TARGET_MACHINE" in
	# disable ssp
	i686-musl) configure_args+=" --disable-hardening";;
	# on armv5 always disable asm as it's not supported
	armv5*) configure_args+=" --disable-asm";;
esac

post_extract() {
	[ -z "$build_option_asm" ] && return 0
	mv ../libressl-portable-asm-${_lssl_asm_ver} .
}

pre_configure() {
	if [ "$build_option_asm" ]; then
		./libressl-portable-asm-${_lssl_asm_ver}/patch_libressl.sh .
	fi
	autoreconf -if
}

do_install() {
	make -C tls install DESTDIR="$DESTDIR"
	make -C apps/nc install DESTDIR="$DESTDIR"
	vlicense COPYING
	if [ "$build_option_asm" ]; then
		vlicense libressl-portable-asm-${_lssl_asm_ver}/LICENSE.cryptogams
		vlicense libressl-portable-asm-${_lssl_asm_ver}/LICENSE.openssl
	fi
	#find ${DESTDIR}/usr/share/man/man1 -type f ! -name openssl.1 -delete
}

libtls-devel_package() {
	short_desc+=" - development files"
	depends="libtls-${version}_${revision}"
	pkg_install() {
		vinstall include/tls.h 644 usr/include
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
		vinstall libtls.pc 644 usr/lib/pkgconfig
		for m in man/tls_*; do vman $m; done
	}
}

libressl-netcat_package() {
	short_desc="TCP/IP swiss army knife (LibreSSL variant)"
	alternatives="
	 nc:nc:/usr/bin/libressl-nc
	 nc:nc.1:/usr/share/man/man1/libressl-nc.1"
	pkg_install() {
		vbin apps/nc/.libs/nc libressl-nc
		vman apps/nc/nc.1 libressl-nc.1
	}
}