aboutsummaryrefslogtreecommitdiffstats
path: root/main/libwebsockets/APKBUILD
blob: 02cd46a93c4f27bd55b81604fdf4f5ecdef5323c (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
# Contributor: V.Krishn <vkrishn4@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libwebsockets
pkgver=2.1.1
pkgrel=0
pkgdesc="C library for lightweight websocket clients and servers"
url="http://libwebsockets.org"
arch="all"
license="LGPL2.1"
makedepends="cmake zlib-dev libressl-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-test:_test"
source="$pkgname-$pkgver.tar.gz::https://github.com/warmcat/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	mkdir -p "$builddir"/build
	cd "$builddir"/build

	cmake .. \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_VERBOSE_MAKEFILE=TRUE \
		 || return 1
	make
}

package() {
	cd "$builddir"

	install -Dm644 LICENSE \
		"$pkgdir"/usr/share/licenses/$pkgname/LICENSE || return 1
	make -C build DESTDIR="$pkgdir" install || return 1
}

_test() {
	pkgdesc="$pkgdesc (test server)"

	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/share "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="429bca62feb75136d8aff1783a6024468033536356fb3501e4dcf0819d9e9a4457f2a94248fdafe6fdceb7e0ded146ff6c4c04040e069f34a9b27a4e090d2683  libwebsockets-2.1.1.tar.gz"