Run in $HOME/.dwarffortress, user data no longer in /opt. --- dwarffortress +++ dwarffortress @@ -1,7 +1,14 @@ #!/bin/sh -cd /opt/df_linux export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch. #export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing. -umask 0002 # Make sure that any saves created get 775/664 +pkgname=dwarffortress #To be set by PKGBUILD + +if mkdir "$HOME/.$pkgname" 2>/dev/null; then + cp -rn /opt/"$pkgname"/data "$HOME/.$pkgname/" + cp -rsn /opt/"$pkgname"/* "$HOME/.$pkgname/" +fi + +cd "$HOME/.$pkgname" exec ./libs/Dwarf_Fortress "$@" + --- PKGBUILD +++ PKGBUILD @@ -10,7 +10,6 @@ arch=(i686 x86_64) # WIP Thread: http://www.bay12forums.com/smf/index.php?topic=66142.0 url="http://www.bay12games.com/dwarves/" -install="$pkgname.install" license=('custom:dwarffortress') depends=(gtk2 glu sdl_image libsndfile openal sdl_ttf glew gcc-libs) makedepends=(git cmake) @@ -23,10 +22,6 @@ 'lib32-alsa-lib: for alsa sound' 'lib32-libpulse: for pulse sound') fi -backup=('opt/df_linux/data/init/colors.txt' - 'opt/df_linux/data/init/init.txt' - 'opt/df_linux/data/init/d_init.txt' - 'opt/df_linux/data/init/interface.txt') # I made a fucking github repo with the sole purpose of unfucking df a bit # We try to compile whatever little bit of df is open source source=(http://www.bay12games.com/dwarves/df_${_pkgver}_linux.tar.bz2 @@ -34,11 +29,11 @@ dwarffortress dwarffortress.desktop dwarffortress.png) -md5sums=('33e26a93e5914f7545fa1aaa53706eeb' - 'SKIP' - 'c19aacc31e8df354827db352fecfd200' - 'c8984d1eea6e409ecf339d6ee9e91e42' - 'b1d51f82400073af9bb179e34a9209d0') +sha256sums=('720eda6c83e72fb1212a8eead0c39989ab5387bcf42dc4028a14e8df5bdd69e2' + 'SKIP' + '2c9f5dd67330b8b0e1409b1ecc1d56d726f866970a7d2fa2ff24775266a80e88' + 'e79e3d945c6cc0da58f4ca30a210c7bf1bc3149fd10406d1262a6214eb40445a' + '83183abc70b11944720b0d86f4efd07468f786b03fa52fe429ca8e371f708e0f') build() { cd $srcdir/dwarf_fortress_unfuck @@ -48,35 +43,25 @@ } package() { - cd $srcdir/df_linux install -dm755 $pkgdir/opt/ - cp -r $srcdir/df_linux/ $pkgdir/opt/ - - # Yay for precompiled stuff with junk permissions! :D - find $pkgdir/opt/df_linux -type d -exec chmod 755 {} + - find $pkgdir/opt/df_linux -type f -exec chmod 644 {} + - - install -Dm755 $srcdir/dwarffortress $pkgdir/usr/bin/dwarffortress + cp -r $srcdir/df_linux $pkgdir/opt/$pkgname + rm -r $pkgdir/opt/$pkgname/df $pkgdir/opt/$pkgname/libs/* $pkgdir/opt/$pkgname/g_src - chmod 755 $pkgdir/opt/df_linux/libs/Dwarf_Fortress - install -Dm755 $srcdir/dwarf_fortress_unfuck/libgraphics.so $pkgdir/opt/df_linux/libs/libgraphics.so - ln -s /usr/lib32/libpng.so $pkgdir/opt/df_linux/libs/libpng.so.3 - rm $pkgdir/opt/df_linux/libs/{libgcc_s.so.1,libstdc++.so.6} + find $pkgdir/opt/$pkgname -type d -exec chmod 755 {} + + find $pkgdir/opt/$pkgname -type f -exec chmod 644 {} + - install -d -m775 -o root -g games $pkgdir/opt/df_linux/data/save + install -Dm755 $srcdir/df_linux/libs/Dwarf_Fortress $pkgdir/opt/$pkgname/libs/Dwarf_Fortress + install -Dm755 $srcdir/dwarf_fortress_unfuck/libgraphics.so $pkgdir/opt/$pkgname/libs/libgraphics.so + install -Dm755 $srcdir/dwarffortress $pkgdir/usr/bin/$pkgname - # This probably is overkill, but I don't know what specific files df needs permission for in here. - chmod 775 $pkgdir/opt/df_linux - chown root:games $pkgdir/opt/df_linux - chown -R root:games $pkgdir/opt/df_linux/data - find $pkgdir/opt/df_linux/data -type d -exec chmod 775 {} + - find $pkgdir/opt/df_linux/data -type f -exec chmod 664 {} + + # Set pkgname in runscript + sed "s/^pkgname=.*/pkgname=$pkgname/" $pkgdir/usr/bin/$pkgname # Desktop launcher with icon - install -Dm644 $srcdir/dwarffortress.desktop $pkgdir/usr/share/applications/dwarffortress.desktop - install -Dm644 $srcdir/dwarffortress.png $pkgdir/usr/share/pixmaps/dwarffortress.png + install -Dm644 $srcdir/dwarffortress.desktop $pkgdir/usr/share/applications/"$pkgname".desktop + install -Dm644 $srcdir/dwarffortress.png $pkgdir/usr/share/pixmaps/"$pkgname".png - install -Dm644 $srcdir/df_linux/readme.txt $pkgdir/usr/share/licenses/dwarffortress/readme.txt + install -Dm644 $srcdir/df_linux/readme.txt $pkgdir/usr/share/licenses/$pkgname/readme.txt } # vim:set ts=2 sw=2 et: