update README for 43.05
[rofl0r-df-mayday.git] / get_debian_32bit_libs.sh
blobbfdac91da652ea342c87e6c849da06a8c337819d
1 #!/bin/sh
2 # Get 32-bit libs required for Dwarf Fortress on 64-bit Linux.
3 # requires debian's dpkg program.
5 check_program() {
6 if ! which "$1" >/dev/null 2>&1 ; then
7 echo "required program $1 not installed. aborting."
8 exit 1
9 fi
12 check_program wget
13 check_program dpkg
15 mkdir -p temp
17 # Save the file from $1 as $2 using wget.
18 fetchextract() {
19 url="$1"
20 file="$2"
21 wget -O "temp/$file" "$url"/"$file"
22 dpkg -x "temp/$file" temp
25 # abort on error
26 set -e
28 # Get the required libs:
29 fetchextract "http://ftp.us.debian.org/debian/pool/main/s/sdl-image1.2" "libsdl-image1.2_1.2.10-2+b2_i386.deb"
30 fetchextract "http://ftp.us.debian.org/debian/pool/main/s/sdl-ttf2.0" "libsdl-ttf2.0-0_2.0.9-1_i386.deb"
31 fetchextract "http://ftp.us.debian.org/debian/pool/main/o/openal-soft" "libopenal1_1.12.854-2_i386.deb"
33 # Put them to df's libs directory:
34 mkdir -p libs
36 mv temp/usr/lib/libopenal.so.1.12.854 libs/libopenal.so
37 mv temp/usr/lib/libSDL_image-1.2.so.0.8.2 libs/libSDL_image-1.2.so.0
38 mv temp/usr/lib/libSDL_ttf-2.0.so.0.6.3 libs/libSDL_ttf-2.0.so.0
40 # Clean up
41 rm -rf temp