desktop/warsow/PKGBUILD
2016-03-28 08:23:08 +01:00

82 lines
2.8 KiB
Bash

pkgbase=warsow
pkgname=('warsow' 'warsow-data')
pkgver=2.1.0
_pkgver=21 # Warsow-data version
pkgrel=1
arch=('x86_64')
url="http://www.warsow.gg/"
makedepends=('mesa' 'openal' 'imagemagick' 'gendesk' 'curl' 'libjpeg' 'libpng' 'libtheora' 'libvorbis'
'libxxf86dga' 'sdl2' 'libxinerama' 'libxrandr' 'libxxf86vm' 'libxi' 'cmake')
categories=('games')
source=("http://mirror.null.one/${pkgname}_${_pkgver}_sdk.tar.gz"
"http://mirror.null.one/${pkgname}_${_pkgver}_unified.tar.gz")
sha256sums=('d99708925203193b65943116f8dc7dee23d932ebdcd14618950e54307d63fd50'
'7f509ef5da77d150ee7f30a560e366795a23b67ad2037ad9fd547cf5cb432a9b')
prepare() {
gendesk -n -f --pkgname 'warsow' --pkgdesc "${pkgdesc}" --name 'Warsow' --categories 'Game;ActionGame'
}
build() {
cd "${srcdir}/source/source"
cmake -DQFUSION_GAME=Warsow .
make
}
generateAndInstall() {
echo "#!/bin/bash" > "${pkgdir}"/usr/bin/$1
echo "cd /usr/share/$pkgname" >> "${pkgdir}"/usr/bin/$1
echo "./$1 \$*" >> "${pkgdir}"/usr/bin/$1
echo "exit \$?" >> "${pkgdir}"/usr/bin/$1
chmod +x "${pkgdir}"/usr/bin/$1
}
package_warsow-data() {
_pkgname=warsow
pkgdesc="A free online multiplayer competitive FPS based on the Qfusion engine (data files)"
arch=('any')
license=('custom:Warsow Content License')
# Create the destination directories.
install -d "${pkgdir}/usr/share/${_pkgname}"
# Move Data to destination directory.
cp -r ${_pkgname}_${_pkgver}/basewsw "${pkgdir}/usr/share/${_pkgname}"
chmod -R g+rx,o+rx "${pkgdir}/usr/share/${_pkgname}/basewsw"
# Install custom license: Warsow Content License.
install -Dm0644 ${_pkgname}_${_pkgver}/docs/license.txt "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
}
package_warsow() {
pkgdesc="A free online multiplayer competitive FPS based on the Qfusion engine"
arch=('x86_64')
license=('GPL')
depends=('curl' 'libjpeg' 'libpng' 'libtheora' 'libvorbis' 'libxinerama' 'libxrandr' 'libxxf86dga'
'libxxf86vm' 'sdl2' 'warsow-data')
optdepends=('openal: for openal audio support')
cd source/source
local builddir="${srcdir}/source/source/build"
# Create Destination Directories
install -d "${pkgdir}/usr/share/${pkgname}/"
# Move Compiled Data to Destination Directory except basewsw.
# NOTE: We don't need cgame library because it's a pure lib provided by
# modules_16.pk3 from warsow-data package.
cp -r "${builddir}/libs" "${pkgdir}/usr/share"
# Execution scripts:
install -d "${pkgdir}/usr/bin"
for script in ${pkgname} wsw_server wswtv_server
do
generateAndInstall ${script}
done
# Desktop integration:
install -Dm0644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
install -Dm0644 "${srcdir}/source/icons/warsow256x256.xpm" "${pkgdir}/usr/share/pixmaps/warsow.xpm"
}