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

_srcdir="${srcdir}"/libwebsockets-$pkgver
_builddir="${srcdir}/build"
prepare() {
        cd "$_srcdir"
        for i in $source; do
                case $i in
                *.patch)
                        msg "Applying $i"
                        patch -p1 -i "$srcdir"/$i || return 1
                        ;;
                esac
        done
}


build() {
	mkdir "$_builddir"
	cd "$_builddir"
	cmake -DCMAKE_INSTALL_PREFIX=/usr \
		"$_srcdir" || return 1
	make
}

package() {
	cd "$_srcdir"
	install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE || return 1
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm -f "$pkgdir"/usr/lib/*.a
}

_test() {
	pkgname="$pkgdesc - test server"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/share "$pkgdir"/usr/bin "$subpkgdir"/usr/
}


md5sums="ad6d3926dee9ed6a86786d5048913258  libwebsockets-1.7.5.tar.gz"
sha256sums="e91f59fb6238462b4ffdfef2482239558b8a02198c9c6076eb3f86eb1c4e935d  libwebsockets-1.7.5.tar.gz"
sha512sums="2e056d94526d8c613ffb6e5e1aeca83a185a231af7e48994e94502346f558442eef3a247cd1bef32c6bcdf8e386ff281fe86307478dd2f9809e4ac4bafeccb79  libwebsockets-1.7.5.tar.gz"