diff options
author | Eric Hameleers <alien@slackware.com> | 2012-12-16 00:41:01 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2012-12-16 00:41:01 +0000 |
commit | 1f410269957f25cfc7155cc8f98e3d070552d819 (patch) | |
tree | eca89d9c4d3adfcb8f4251f26d6fbf1044b248ee /steamclient | |
parent | 664f207ea1b5985da978b88cd94e0f47cef2bb43 (diff) | |
download | asb-1f410269957f25cfc7155cc8f98e3d070552d819.tar.gz asb-1f410269957f25cfc7155cc8f98e3d070552d819.tar.xz |
Initial revision
Diffstat (limited to 'steamclient')
-rw-r--r-- | steamclient/build/README.Slackware | 43 | ||||
-rwxr-xr-x | steamclient/build/steamclient.SlackBuild | 225 |
2 files changed, 268 insertions, 0 deletions
diff --git a/steamclient/build/README.Slackware b/steamclient/build/README.Slackware new file mode 100644 index 00000000..f2de6913 --- /dev/null +++ b/steamclient/build/README.Slackware @@ -0,0 +1,43 @@ +Slackware package for Valve's Steam Client for Linux. +------------------------------------------------------------------------------- + +The Steam client is primarily targeting Ubuntu, so in order to make it work +on Slackware, the package ships with a slightly modified steam startup script. + +You will also have to install several dependencies: + - pulseaudio + - speex + - json-c + - OpenAL + - flashplayer-plugin +These are all available as SlackBuild scripts on http://slackbuilds.org, +while OpenAL and flashplayer-plugin packages can be found in my own repository +at http://slackware.com/~alien/slackbuilds/ too. + +Note that the Steam client currently is 32-bit only. If you are running a +64-bit Slackware you must add multilib capability to it first. +Then, you need to add several more 'compat32' packages. In addition to +'compat32' versions of the aforementioned dependencies, you also need to +install 'compat32' packages for: + - flac + - libogg + - libvorbis + - oxygen-gtk2 + +Note that before building pulseaudio, its README instructs you to create +a "pulse" user and group: + # groupadd -g 216 pulse + # useradd -u 216 -g pulse -d /var/lib/pulse -m pulse +However, there is no need to actually _start_ the pulseaudio server. You can +prevent this by running: + # chmod -x /etc/rc.d/rc.pulseaudio +The Steam client is dynamically linked against pulseaudio libraries, but my +modification to the steam startup script will actually force it to use +Slackware's ALSA for audio output. Pulseaudio will not be used. + +In order to run the Steam client you will probably need a Nvidia or Ati card +with proprietary drivers. I would like to hear from people who are able to +start Steam and play a game using open source drivers. + +------------------------------------------------------------------------------- +Eric Hameleers <alien@slackware.com> 16-dec-2012 diff --git a/steamclient/build/steamclient.SlackBuild b/steamclient/build/steamclient.SlackBuild new file mode 100755 index 00000000..6044075a --- /dev/null +++ b/steamclient/build/steamclient.SlackBuild @@ -0,0 +1,225 @@ +#!/bin/sh +# $Id$ +# Copyright 2012 Eric Hameleers, Eindhoven, NL +# All rights reserved. +# +# Permission to use, copy, modify, and distribute this software for +# any purpose with or without fee is hereby granted, provided that +# the above copyright notice and this permission notice appear in all +# copies. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# ----------------------------------------------------------------------------- +# +# Slackware SlackBuild script +# =========================== +# By: Eric Hameleers <alien@slackware.com> +# For: steamclient +# Descr: Linux client for the Steam gaming platform +# URL: http://valvesoftware.com/ +# Needs: +# Changelog: +# 20121216-1: 16/Dec/2012 by Eric Hameleers <alien@slackware.com> +# * Initial build. +# +# Run 'sh steamclient.SlackBuild' to build a Slackware package. +# The package (.tgz) and .txt file as well as build logs are created in /tmp . +# Install it using 'installpkg'. +# +# ----------------------------------------------------------------------------- + +# Set initial variables: + +PRGNAM=steamclient +VERSION=${VERSION:-20121216} +ARCH=i486 +BUILD=${BUILD:-1} +TAG=${TAG:-alien} + +# Where do we look for sources? +SRCDIR=$(cd $(dirname $0); pwd) + +# Place to build (TMP) package (PKG) and output (OUTPUT) the program: +TMP=${TMP:-/tmp/build} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +# Input URL: http://media.steampowered.com/client/installer/steam.deb +SOURCE="$SRCDIR/steam-${VERSION}.deb" +SRCURL="http://media.steampowered.com/client/installer/steam.deb" + +## +## --- with a little luck, you won't have to edit below this point --- ## +## + +# Exit the script on errors: +set -e +trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR +# Catch unitialized variables: +set -u +P1=${1:-1} + +# Save old umask and set to 0022: +_UMASK_=$(umask) +umask 0022 + +# Create working directories: +mkdir -p $OUTPUT # place for the package to be saved +mkdir -p $TMP/tmp-$PRGNAM # location to build the source +mkdir -p $PKG # place for the package to be built +rm -rf $PKG/* # always erase old package's contents +rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build +rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log + # remove old log files + +# Source file availability: +if ! [ -f ${SOURCE} ]; then + echo "Source '$(basename ${SOURCE})' not available yet..." + # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT + [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)" + if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi + if ! [ "x${SRCURL}" == "x" ]; then + echo "Will download file to $(dirname $SOURCE)" + wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true + if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then + echo "Downloading '$(basename ${SOURCE})' failed... aborting the build." + mv -f "${SOURCE}" "${SOURCE}".FAIL + exit 1 + fi + else + echo "File '$(basename ${SOURCE})' not available... aborting the build." + exit 1 + fi +fi + +if [ "$P1" == "--download" ]; then + echo "Download complete." + exit 0 +fi + +# --- PACKAGE BUILDING --- + +echo "++" +echo "|| $PRGNAM-$VERSION" +echo "++" + +cd $TMP/tmp-$PRGNAM +echo "Extracting the source archive(s) for $PRGNAM..." +ar x ${SOURCE} +# Move the binaries into place: +tar -C $PKG -xvf data.tar.gz +rm -r $PKG/etc/apt +# Take care of the post-install commands: +mkdir $PKG/install +tar -C $PKG/install -xvf control.tar.gz +rm -f $PKG/install/{conffiles,md5sums} +mv $PKG/install/{postinst,doinst.sh} +mkdir -p $PKG/usr/doc/$PRGNAM +mv $PKG/install/control $PKG/usr/doc/$PRGNAM/ +# Take care of the man page: +mv $PKG/usr/share/man $PKG/usr/ + +cd ${PKG} +# Apply changes to the steam script which we need on Slackware: +sed -i -e '/bin\/bash/ a\ +# --- Start Slackware mod ---\ +export LD_LIBRARY_PATH=/usr/lib/seamonkey\ +# Audio output goes to first "hw" device of ALSA\ +export SDL_AUDIODRIVER=alsa\ +#export AUDIODEV=hw\ +# Add any custom variable exports here\ +[ -f ${HOME}/.steam4slackware ] \&\& . ${HOME}/.steam4slackware\ +# --- End Slackware mod ---' $PKG/usr/bin/steam +sed -i -e "s/install_extra_packages /#@/" $PKG/usr/bin/steam +sed -i -e 's/xterm/${TERM}/' $PKG/usr/bin/steam +# We need to add a symlink to /sbin/pidof in order to make it be found: +sed -i -e '/bin\/bash/{N;s#$#\nexport PATH="/usr/lib/steam/local:$PATH"#}' $PKG/usr/bin/steam +mkdir $PKG/usr/lib/steam/local +ln -sf /sbin/pidof $PKG/usr/lib/steam/local/pidof + +chown -R root:root . +chmod -R u+w,go+r-w,a+X-s . + +# Add this to the doinst.sh: +mkdir -p $PKG/install +cat <<EOINS >> $PKG/install/doinst.sh +# Handle the incoming configuration files: +config() { + for infile in \$1; do + NEW="\$infile" + OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... + done +} + +# An example of how you handle your '.new' config files: +#config etc/steamclient.conf.new + +# Update the desktop database: +if [ -x usr/bin/update-desktop-database ]; then + chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null 2>&1 +fi + +# Update hicolor theme cache: +if [ -d usr/share/icons/hicolor ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null + fi +fi + +# Update the mime database: +if [ -x usr/bin/update-mime-database ]; then + chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 +fi + +EOINS + +# Add documentation: +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $SRCDIR/README.Slackware $PKG/usr/doc/$PRGNAM-$VERSION || true +cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION +find $PKG/usr/doc -type f -exec chmod 644 {} \; + +# Add a package description: +mkdir -p $PKG/install +cat $SRCDIR/slack-desc > $PKG/install/slack-desc +if [ -f $SRCDIR/doinst.sh ]; then + cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh +fi +if [ -f $SRCDIR/slack-required ]; then + cat $SRCDIR/slack-required > $PKG/install/slack-required +fi + +# Build the package: +cd $PKG +makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log +cd $OUTPUT +md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz} > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz}.md5 +cd - +cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt +if [ -f $PKG/install/slack-required ]; then + cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.dep +fi + +# Restore the original umask: +umask ${_UMASK_} + |