APKBUILD 1.48 KB
Newer Older
1 2 3
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
Fabian Affolter's avatar
Fabian Affolter committed
4
pkgname=nettle
A. Klitzing's avatar
A. Klitzing committed
5
pkgver=3.3
6
pkgrel=2
Fabian Affolter's avatar
Fabian Affolter committed
7 8 9
pkgdesc="A low-level cryptographic library"
url="http://www.lysator.liu.se/~nisse/nettle/"
arch="all"
10
license="LGPL-2.0-or-later"
Fabian Affolter's avatar
Fabian Affolter committed
11
depends=""
Jakub Jirutka's avatar
Jakub Jirutka committed
12 13
depends_dev="gmp-dev"
makedepends="$depends_dev m4"
14
subpackages="$pkgname-dev $pkgname-utils"
15
source="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz
Fabian Affolter's avatar
Fabian Affolter committed
16
	nettle-2.4-makefile.patch"
Jakub Jirutka's avatar
Jakub Jirutka committed
17
builddir="$srcdir/$pkgname-$pkgver"
Fabian Affolter's avatar
Fabian Affolter committed
18 19

build() {
Jakub Jirutka's avatar
Jakub Jirutka committed
20
	cd "$builddir"
Fabian Affolter's avatar
Fabian Affolter committed
21
	./configure \
22 23
		--build=$CBUILD \
		--host=$CHOST \
Fabian Affolter's avatar
Fabian Affolter committed
24 25
		--prefix=/usr \
		--sysconfdir=/etc \
26
		--libdir=/usr/lib \
Fabian Affolter's avatar
Fabian Affolter committed
27 28 29 30
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-shared \
31 32
		--disable-openssl
	make
Natanael Copa's avatar
Natanael Copa committed
33
	# strip comments in fields from .pc as it confuses pkgconf
34 35 36 37 38 39 40
	sed -i -e 's/ \#.*//' *.pc
}

check() {
	cd "$builddir"
	make -C examples  # required for rsa-encrypt
	make check
Fabian Affolter's avatar
Fabian Affolter committed
41 42 43
}

package() {
Jakub Jirutka's avatar
Jakub Jirutka committed
44
	cd "$builddir"
45
	make DESTDIR="$pkgdir" install
Fabian Affolter's avatar
Fabian Affolter committed
46 47
}

48 49 50 51 52 53
utils() {
	pkgdesc="Utils for nettle"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

A. Klitzing's avatar
A. Klitzing committed
54
sha512sums="271981d89766f151af3cdc4e5fc43c438222f0f6f44475bad114f4209955b5235fced6526c7abca001cca223e8cfcd2a6bf389b160b305a499e7acf52425ec70  nettle-3.3.tar.gz
55
c7d9741a7a37d225f3f0db16d355e13b04cc0f1ac56882a6ff31ef15c1a1a0aee7a70cf1ec8bbf2c46b9b0dcec153da7a7aa6b8909a72d76dd4d669cbbaceaa4  nettle-2.4-makefile.patch"