aboutsummaryrefslogtreecommitdiffstats
path: root/main/libwebsockets/APKBUILD
blob: 725268d66c826614fd80d0c2942df6ab95621112 (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.3
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="http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/snapshot/$pkgname-$pkgver-chrome37-firefox30.tar.gz
	0001-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
	"

_srcdir="${srcdir}/${pkgname}-${pkgver}-chrome37-firefox30"
_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="63117f35174a5fe4ec062f6baa411638  libwebsockets-1.3-chrome37-firefox30.tar.gz
b8d335dbe62cc38b58e593a3d2cd6eaf  0001-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch"
sha256sums="022c91f821014c50b9db5fb93404df475dc081a7c23b57fca9529e3ddcc5d821  libwebsockets-1.3-chrome37-firefox30.tar.gz
7dc31117023e27bc3cd6fb15135dd866c7c7e0d80627c78ee57598d103929f51  0001-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch"
sha512sums="c179c6f64fb7082eea2df7e3ef24fd91db96dde62bea0c193d258e2cf417c0f1c3dff5ace7e49f32c15d330d339d6e3f767f38a60fbb33f825ff7071384d329c  libwebsockets-1.3-chrome37-firefox30.tar.gz
b56ef2a08cdc0d08d8b229d6675379eff46fb54ee5a3a12538e80ce6d88dd0a2959565eea7622a6bd8aabf92a26d0b0f4a53425b567e600b5be097537db4c22f  0001-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch"