2016-02-24 19:29:19 +00:00
|
|
|
# Copyright 2016 Julian Ospald <hasufell@posteo.de>
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EDITION="collect_edition"
|
2016-04-22 14:10:55 +00:00
|
|
|
|
2016-05-26 12:41:44 +00:00
|
|
|
require desktop-utils gtk-icon-cache \
|
2016-04-22 14:10:55 +00:00
|
|
|
sourceforge [ pnv=sauerbraten_${PV//./_}_${EDITION}_linux ]
|
2016-05-23 13:20:25 +00:00
|
|
|
require openrc-service [ openrc_confd_files=[ "${FILES}"/openrc/confd ] ]
|
2016-04-22 14:10:55 +00:00
|
|
|
|
2016-02-24 19:29:19 +00:00
|
|
|
SUMMARY="Cube 2: Sauerbraten is an open source game engine (Cube 2) with freeware game data (Sauerbraten)"
|
|
|
|
HOMEPAGE="http://sauerbraten.org/"
|
|
|
|
|
|
|
|
LICENCES="ZLIB freedist"
|
|
|
|
SLOT="0"
|
|
|
|
PLATFORMS="~amd64 ~x86"
|
|
|
|
MYOPTIONS=""
|
|
|
|
|
|
|
|
DEPENDENCIES="
|
|
|
|
build+run:
|
2016-02-28 23:05:15 +00:00
|
|
|
media-libs/SDL:0[X]
|
|
|
|
media-libs/SDL_image:1
|
|
|
|
media-libs/SDL_mixer:0[ogg]
|
|
|
|
x11-libs/libX11
|
2016-02-24 19:29:19 +00:00
|
|
|
sys-libs/zlib
|
|
|
|
x11-dri/glu
|
|
|
|
x11-dri/mesa
|
|
|
|
run:
|
|
|
|
group/sauerbraten [[ note = [ for server ] ]]
|
|
|
|
user/sauerbraten [[ note = [ for server ] ]]
|
|
|
|
"
|
|
|
|
|
|
|
|
WORK=${WORKBASE}/${PN}
|
|
|
|
|
|
|
|
src_prepare() {
|
2016-02-28 23:05:15 +00:00
|
|
|
edo rm -r sauerbraten_unix bin_unix src/{include,lib,vcpp}
|
2016-02-24 19:29:19 +00:00
|
|
|
|
|
|
|
default
|
|
|
|
|
2016-02-28 23:05:15 +00:00
|
|
|
# Fix links so they point to the correct directory
|
|
|
|
edo sed -i -e 's:docs/::' README.html
|
2016-02-24 19:29:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
emake -C src master server client
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
local LIBEXECDIR="/usr/$(exhost --target)/libexec/${PN}"
|
2016-02-28 23:05:15 +00:00
|
|
|
local DATADIR="/usr/share/${PN}"
|
|
|
|
local STATEDIR="/var/lib/${PN}"
|
2016-02-24 19:29:19 +00:00
|
|
|
|
|
|
|
# Install the game data
|
|
|
|
insinto "${DATADIR}"
|
|
|
|
doins -r data packages
|
|
|
|
|
|
|
|
# Install the client executable
|
|
|
|
exeinto "${LIBEXECDIR}"
|
|
|
|
doexe src/sauer_client
|
|
|
|
|
|
|
|
# Install the client wrapper
|
|
|
|
herebin ${PN}-client <<EOF
|
|
|
|
#!/bin/sh
|
|
|
|
cd ${DATADIR}
|
|
|
|
exec "${LIBEXECDIR}/sauer_client" -q \$HOME/.${PN} -r "\$@"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Create menu entry
|
|
|
|
insinto /usr/share/icons/hicolor/256x256/apps
|
|
|
|
newins data/cube.png ${PN}.png
|
2016-05-26 12:41:44 +00:00
|
|
|
install_desktop_entry "Name=Cube 2: Sauerbraten" "Exec=${PN}-client"
|
2016-02-24 19:29:19 +00:00
|
|
|
|
2016-02-28 23:05:15 +00:00
|
|
|
# Install the server config files
|
|
|
|
insinto "${STATEDIR}"
|
|
|
|
doins "server-init.cfg"
|
2016-02-24 19:29:19 +00:00
|
|
|
|
2016-02-28 23:05:15 +00:00
|
|
|
# Install the server executables
|
|
|
|
exeinto "${LIBEXECDIR}"
|
|
|
|
doexe src/sauer_master
|
|
|
|
doexe src/sauer_server
|
2016-02-24 19:29:19 +00:00
|
|
|
|
|
|
|
herebin ${PN}-server <<EOF
|
|
|
|
#!/bin/sh
|
|
|
|
exec "${LIBEXECDIR}/sauer_server" -k${DATADIR} -q${STATEDIR} "\$@"
|
|
|
|
EOF
|
|
|
|
herebin ${PN}-master <<EOF
|
|
|
|
#!/bin/sh
|
|
|
|
exec "${LIBEXECDIR}/sauer_master" ${STATEDIR} "\$@"
|
|
|
|
EOF
|
|
|
|
|
2016-02-28 23:05:15 +00:00
|
|
|
dodoc src/*.txt docs/dev/*.txt
|
2016-02-24 19:29:19 +00:00
|
|
|
|
|
|
|
insinto /usr/share/doc/${PNVR}/html
|
|
|
|
doins -r README.html docs/*
|
|
|
|
|
2016-02-28 23:05:15 +00:00
|
|
|
edo chown sauerbraten:sauerbraten "${IMAGE%/}/${STATEDIR}"
|
2016-05-23 13:20:25 +00:00
|
|
|
|
|
|
|
install_openrc_files
|
2016-02-24 19:29:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
2016-02-28 23:05:15 +00:00
|
|
|
elog "If you plan to use map editor feature copy all map data from ${DATADIR}"
|
|
|
|
elog "to corresponding folder in your HOME/.${PN}"
|
2016-02-24 19:29:19 +00:00
|
|
|
|
|
|
|
gtk-icon-cache_pkg_postinst
|
|
|
|
}
|
|
|
|
|