aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libcorkipset/APKBUILD
blob: bc239666d50a947bea72ed44d1f8fd4cc428d3b0 (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
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=libcorkipset
pkgver=1.1.1
_debver=20150311-8
pkgrel=0
pkgdesc="Small C helper library for storing sets of IPv4 and IPv6 addresses"
url="https://github.com/rogers0/libcorkipset"
arch="all"
license="BSD-3-Clause"
makedepends="cmake check-dev libcork-dev"
checkdepends="python3"
subpackages="$pkgname-dev"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/rogers0/$pkgname/archive/debian/$pkgver+$_debver.tar.gz
	"

builddir="$srcdir/$pkgname-debian-$pkgver-$_debver"

prepare() {
	default_prepare
	mkdir build

	for p in debian/patches/*.patch; do
		patch -p1 -i "$p"
	done

	sed -e 's%#include <ipset%#include <libcorkipset%' \
		-e 's%#include "ipset%#include "libcorkipset%' \
		-i include/ipset/*.h */*/*/*.c */*/*/*.c.in */*/*.c */*.c
	mv include/ipset include/libcorkipset
}

build() {
	cd build
	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_STYLE=Release
	make
}

check() {
	cd build
	make test
}

package() {
	cd build
	make DESTDIR="$pkgdir" install
}

sha512sums="5bbce2727da1665e734981959ecb253b4052d8cc6c426fded7e1678b6e2505bc9f4c0ab3cd3b6a03f834f5e20bd1d670cc19f7491fe0ad5b7cb772e7309f5009  libcorkipset-1.1.1.tar.gz"