aboutsummaryrefslogtreecommitdiffstats
path: root/main/libwebsockets/APKBUILD
blob: 4946fda0f49b0f9745cbb406180686d04ead74b2 (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
58
59
60
61
# Contributor: V.Krishn <vkrishn4@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libwebsockets
pkgver=1.7.1
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
	0001-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
	"

_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="d67da5a39503bf49ae42cedc84e0e1f4  libwebsockets-1.7.1.tar.gz
b8d335dbe62cc38b58e593a3d2cd6eaf  0001-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch"
sha256sums="9a0c562413e727e12d199ff68b036c2984725293ee26874626340adc59df2354  libwebsockets-1.7.1.tar.gz
7dc31117023e27bc3cd6fb15135dd866c7c7e0d80627c78ee57598d103929f51  0001-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch"
sha512sums="b4027d8191af8463a72eeec36c4527737ca166bcd85c048906fc7dfa82f29fbee6b76b8fd4f7f4c1f2851f542336535c24eb35af692f6eafc036abcd93125620  libwebsockets-1.7.1.tar.gz
b56ef2a08cdc0d08d8b229d6675379eff46fb54ee5a3a12538e80ce6d88dd0a2959565eea7622a6bd8aabf92a26d0b0f4a53425b567e600b5be097537db4c22f  0001-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch"