Posted August 21, 2013
Hi!
This guide will help you to build packages for your distribution from the GOG installer.
The scripts used in this guide make use of unzip, wine (>= 1.5.9), wget, wrestool and icotool.
1. Making packages
This first script will create a folder named "pharaoh-data" containing all data needed to run Pharaoh. You'll have to change the value of PHARAOH_SETUP to the path to GOG installer :
export PHARAOH_SETUP="/path/to/setup_pharaoh_*.exe"
export WINEARCH=wine32
export WINEDEBUG=-all
mkdir $HOME/pharaoh-data
cd $HOME/pharaoh-data
mkdir install-prefix
export WINEPREFIX=$HOME/pharaoh-data/install-prefix
wineboot --init
mkdir -p usr/local/games
cd install-prefix/dosdevices
rm *
ln -s ../drive_c c\:
ln -s ../../usr/local/games d\:
cd d\:
cp "$PHARAOH_SETUP" .
wine "$(basename "$PHARAOH_SETUP")"
cd pharaoh
wrestool -t 14 -x Pharaoh.exe | icotool -x -
mkdir -p ../../share/icons/hicolor/16x16/apps ../../share/icons/hicolor/32x32/apps
mv *16x16x4.png ../../share/icons/hicolor/16x16/apps/pharaoh.png
mv *32x32x8.png ../../share/icons/hicolor/32x32/apps/pharaoh.png
rm *.png
cd $HOME/pharaoh-data
rm -Rf "usr/local/games/$(basename "$PHARAOH_SETUP")" install-prefix $HOME/.local/share/applications/wine/Programs/GOG.com/Pharaoh\ Gold/
find $HOME/.local/share/applications/ -depth -type d -empty -delete
In the installer, click "Options" and untick anything but "Pharaoh Gold" and EULA and set the path to "D:\pharaoh".
/!\ Don't launch the game at the end of the installation. Click "Exit". /!\
This second script will create the launchers allowing you to play Pharaoh on Linux :
mkdir -p $HOME/pharaoh/usr/local/bin
cd $HOME/pharaoh/usr/local/bin
echo "
#!/bin/sh
export WINEDEBUG=-all
export WINEPREFIX=\$HOME/.pharaoh/.wine-prefix
mkdir -p \$HOME/.pharaoh/.wine-prefix
export WINEARCH=win32
wineboot --init
cd \$HOME/.pharaoh/.wine-prefix/dosdevices/
rm *
ln -s ../drive_c c\:
mkdir \$HOME/.pharaoh/.wine-prefix/dosdevices/d\:
ln -s \$HOME/.pharaoh \$HOME/.pharaoh/.wine-prefix/dosdevices/d\:/pharaoh
cd \$HOME/.pharaoh/
ln -s /usr/local/games/pharaoh/* .
rm Pharaoh.ini
cp /usr/local/games/pharaoh/Pharaoh.ini ." > pharaoh-init
echo "
#!/bin/sh
export WINEDEBUG=-all
export WINEPREFIX=\$HOME/.pharaoh/.wine-prefix
if ! [ -d ~/.pharaoh ]; then
sh /usr/local/bin/pharaoh-init
fi
cd \$HOME/.pharaoh/.wine-prefix/dosdevices/d\:/pharaoh
wine Pharaoh.exe" > pharaoh
chmod a+x *
cd ..
mkdir -p share/applications
echo "[Desktop Entry]
Type=Application
Version=1.0
Name=Pharaoh + Cleopatra
Icon=pharaoh
Exec=pharaoh
Categories=Application;Game;" > share/applications/pharaoh.desktop
2. Building the packages
As for now there are scripts only for .deb packages (Debian, Ubuntu, Linux Mint...).
More may come later as I learn how to do it (or sooner if you know how to package in other formats and post the method here).
.deb packages
cd $HOME/pharaoh-data
mkdir DEBIAN
echo "Package: pharaoh-data
Version: 1
Section: non-free
Priority: extra
Architecture: all
Depends:
Installed-Size: 797572
Maintainer: local build
Description: Pharaoh + Cleopatra - data" > DEBIAN/control
cd $HOME
fakeroot dpkg-deb --build pharaoh-data/
rm -Rf pharaoh-data/
This first build might take a long time, the package is around 470M.
cd $HOME/pharaoh-data
mkdir DEBIAN
echo "Package: pharaoh-data
Version: 1
Section: non-free
Priority: extra
Architecture: all
Depends:
Installed-Size: 797572
Maintainer: local build
Description: Pharaoh + Cleopatra - data" > DEBIAN/control
cd $HOME
fakeroot dpkg-deb --build pharaoh-data/
rm -Rf pharaoh-data/
You can install the resulting packages by launching (as root) :
dpkg -i pharaoh-data.deb
dpkg -i pharaoh.deb
apt-get install -f
Enjoy!
-----
Please tell me if something doesn't work on your distribution.
-----
More guides can be found there :
https://secure.gog.com/mix/guides_to_install_gog_games_on_gnulinux
This guide will help you to build packages for your distribution from the GOG installer.
The scripts used in this guide make use of unzip, wine (>= 1.5.9), wget, wrestool and icotool.
1. Making packages
This first script will create a folder named "pharaoh-data" containing all data needed to run Pharaoh. You'll have to change the value of PHARAOH_SETUP to the path to GOG installer :
export PHARAOH_SETUP="/path/to/setup_pharaoh_*.exe"
export WINEARCH=wine32
export WINEDEBUG=-all
mkdir $HOME/pharaoh-data
cd $HOME/pharaoh-data
mkdir install-prefix
export WINEPREFIX=$HOME/pharaoh-data/install-prefix
wineboot --init
mkdir -p usr/local/games
cd install-prefix/dosdevices
rm *
ln -s ../drive_c c\:
ln -s ../../usr/local/games d\:
cd d\:
cp "$PHARAOH_SETUP" .
wine "$(basename "$PHARAOH_SETUP")"
cd pharaoh
wrestool -t 14 -x Pharaoh.exe | icotool -x -
mkdir -p ../../share/icons/hicolor/16x16/apps ../../share/icons/hicolor/32x32/apps
mv *16x16x4.png ../../share/icons/hicolor/16x16/apps/pharaoh.png
mv *32x32x8.png ../../share/icons/hicolor/32x32/apps/pharaoh.png
rm *.png
cd $HOME/pharaoh-data
rm -Rf "usr/local/games/$(basename "$PHARAOH_SETUP")" install-prefix $HOME/.local/share/applications/wine/Programs/GOG.com/Pharaoh\ Gold/
find $HOME/.local/share/applications/ -depth -type d -empty -delete
/!\ Don't launch the game at the end of the installation. Click "Exit". /!\
This second script will create the launchers allowing you to play Pharaoh on Linux :
mkdir -p $HOME/pharaoh/usr/local/bin
cd $HOME/pharaoh/usr/local/bin
echo "
#!/bin/sh
export WINEDEBUG=-all
export WINEPREFIX=\$HOME/.pharaoh/.wine-prefix
mkdir -p \$HOME/.pharaoh/.wine-prefix
export WINEARCH=win32
wineboot --init
cd \$HOME/.pharaoh/.wine-prefix/dosdevices/
rm *
ln -s ../drive_c c\:
mkdir \$HOME/.pharaoh/.wine-prefix/dosdevices/d\:
ln -s \$HOME/.pharaoh \$HOME/.pharaoh/.wine-prefix/dosdevices/d\:/pharaoh
cd \$HOME/.pharaoh/
ln -s /usr/local/games/pharaoh/* .
rm Pharaoh.ini
cp /usr/local/games/pharaoh/Pharaoh.ini ." > pharaoh-init
echo "
#!/bin/sh
export WINEDEBUG=-all
export WINEPREFIX=\$HOME/.pharaoh/.wine-prefix
if ! [ -d ~/.pharaoh ]; then
sh /usr/local/bin/pharaoh-init
fi
cd \$HOME/.pharaoh/.wine-prefix/dosdevices/d\:/pharaoh
wine Pharaoh.exe" > pharaoh
chmod a+x *
cd ..
mkdir -p share/applications
echo "[Desktop Entry]
Type=Application
Version=1.0
Name=Pharaoh + Cleopatra
Icon=pharaoh
Exec=pharaoh
Categories=Application;Game;" > share/applications/pharaoh.desktop
As for now there are scripts only for .deb packages (Debian, Ubuntu, Linux Mint...).
More may come later as I learn how to do it (or sooner if you know how to package in other formats and post the method here).
.deb packages
cd $HOME/pharaoh-data
mkdir DEBIAN
echo "Package: pharaoh-data
Version: 1
Section: non-free
Priority: extra
Architecture: all
Depends:
Installed-Size: 797572
Maintainer: local build
Description: Pharaoh + Cleopatra - data" > DEBIAN/control
cd $HOME
fakeroot dpkg-deb --build pharaoh-data/
rm -Rf pharaoh-data/
cd $HOME/pharaoh-data
mkdir DEBIAN
echo "Package: pharaoh-data
Version: 1
Section: non-free
Priority: extra
Architecture: all
Depends:
Installed-Size: 797572
Maintainer: local build
Description: Pharaoh + Cleopatra - data" > DEBIAN/control
cd $HOME
fakeroot dpkg-deb --build pharaoh-data/
rm -Rf pharaoh-data/
dpkg -i pharaoh-data.deb
dpkg -i pharaoh.deb
apt-get install -f
-----
Please tell me if something doesn't work on your distribution.
-----
More guides can be found there :
https://secure.gog.com/mix/guides_to_install_gog_games_on_gnulinux
Post edited August 23, 2013 by vv221