File PKGBUILD of Package xashds

# Maintainer: robertfoster
# Thanks, robertfoster :)
# -- a1batross 

pkgname=xashds
pkgver=0
pkgrel=1
pkgdesc="Xash3D FWGS Engine Dedicated Server"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
url="http://xash.su/"
license=('GPL3')
makedepends=('make' 'binutils' 'cmake')
makedepends_i686=('gcc')
makedepends_arm=('gcc')
makedepends_armv6h=('gcc')
makedepends_armv7h=('gcc')
makedepends_x86_64=('gcc-multilib' 'lib32-gcc-libs')
install=
source=("xashds-$pkgver.tar.gz")
md5sums=('SKIP')


prepare() {
	cd $srcdir/$pkgname-$pkgver
	mkdir -p build && cd build
    cmake ../. \
       	-DXASH_SDL=no \
        -DXASH_VGUI=no \
        -DXASH_DLL_LOADER=yes \
        -DXASH_DEDICATED=yes \
        -DHL_SDK_DIR=${PWD}/hlsdk/ \
        -DCMAKE_BUILD_TYPE=release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DXASH_RELEASE=yes \
        -DCMAKE_C_FLAGS="-m32" \
		-DCMAKE_CXX_FLAGS="-m32" \
        -DCMAKE_EXE_LINKER_FLAGS="-m32" \
        -DLIB_INSTALL_DIR=lib32
}


build() {
	cd $srcdir/$pkgname-$pkgver
	cd build
	make -j2 V=1
}

package() {
	cd $srcdir/$pkgname-$pkgver
	cd build
	make DESTDIR="$pkgdir" V=1 install
}