# Contributor: V.Krishn # Maintainer: Natanael Copa 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"