summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4ce9502b910d41062c3bde937983868a6a8bb73b (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
# Maintainer: Issam Maghni <me at concati dot me>

pkgname=bearssl
pkgver=0.6
pkgrel=2
pkgdesc='Implementation of the SSL/TLS protocol (RFC 5246) written in C'
arch=('x86_64')
url='https://bearssl.org'
depends=('glibc')
license=('MIT')
source=("$url/$pkgname-$pkgver.tar.gz")
sha256sums=('6705bba1714961b41a728dfc5debbe348d2966c117649392f8c8139efc83ff14')

build() {
	make -C"$pkgname-$pkgver" CFLAGS="$CFLAGS -fpic" LDFLAGS="$LDFLAGS" D=".so.$pkgver" \
		LDDLLFLAGS="$LDFLAGS -shared -Wl,-soname,lib$pkgname.so.${pkgver%%.*}"
}

check() {
	cd "$pkgname-$pkgver/build"
	./testcrypto all
	./testx509
}

package() {
	mkdir -p "$pkgdir/usr/bin" "$pkgdir/usr/lib" "$pkgdir/usr/include/$pkgname" "$pkgdir/usr/share/licenses/$pkgname"
	cd "$pkgname-$pkgver/build"

	# fix includes
	sed -e 's|"bearssl_|"bearssl/|g' -i ../inc/*
	mv ../inc/bearssl.h "$pkgdir/usr/include"
	for h in ../inc/*
	do  mv $h "$pkgdir/usr/include/bearssl/${h#*_}"
	done

	mv ../LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname"
	mv brssl "$pkgdir/usr/bin"
	mv  "lib$pkgname.so.$pkgver" "lib$pkgname.a" "$pkgdir/usr/lib"
	ln -s "lib$pkgname.so.$pkgver" "$pkgdir/usr/lib/lib$pkgname.so.${pkgver%%.*}"
	ln -s "lib$pkgname.so.${pkgver%%.*}" "$pkgdir/usr/lib/lib$pkgname.so"
}