#Author Alexander Gretencord S=${WORKDIR}/hlds DESCRIPTION="Halflife Linux Server" SRC_URI="ftp://ftp.splatterworld.de/games/hl/server/hlds_l_3108_full.tar.gz" DEPEND="" RDEPEND="virtual/glibc" export DEBUG="yes" src_install () { insinto /etc/env.d newins ${FILESDIR}/halflife.envd 90halflife insinto /etc/init.d newins ${FILESDIR}/halflife.rc halflife chmod u+x ${D}/etc/init.d/halflife dodir /opt mv ${WORKDIR}/hlds_l ${D}/opt/halflife insinto /opt/halflife doins ${FILESDIR}/starthl chmod 744 ${D}/opt/halflife/starthl } pkg_postinst() { if [ -z `awk -F":" '/^halflife:/ { print }' /etc/passwd` ]; then useradd -g games -d /opt/halflife -c "Halflife dedicated server" -s /bin/bash halflife fi chown -R halflife.games /opt/halflife echo -e "\t#########################################" echo -e "\t# Use the halflife file in init.d to #" echo -e "\t# start the dedicated server. It uses #" echo -e "\t# screen so you can get to the console #" echo -e "\t# whenever you want with: #" echo -e "\t# #" echo -e "\t# screen -r halflife #" echo -e "\t# #" echo -e "\t# Have a look at "starthl" in the #" echo -e "\t# halflife dir to set other options #" echo -e "\t# when starting the server. #" echo -e "\t# #" echo -e "\t# The Server is started by the user #" echo -e "\t# halflife. #" echo -e "\t#########################################" } pkg_postrm() { userdel halflife }