mycabal Simple script for installing Haskell-packages under Debian GNU/Linux with help of cabal and GNU Stow. http://iki.fi/juhtolv/hacks/sh/cabal/ Author: Juhapekka Tolvanen http://iki.fi/juhtolv/ juhtolv (at) iki (dot) fi This script is public domain. There is no warranty. This script probably works just fine also under other GNU/Linux-distributions; you just need to find those corresponding packages in native package format of your distribution, but under Debian-derived distributions (for example Ubuntu Linux) this procedure I have explained below should work without modifications. Home page of GNU Stow is here: http://www.gnu.org/software/stow/ First you need to install at least these Debian-packages: cabal-install stow ghc6 Also some libraries of ghc may be needed. If some needed Haskell-package is available as a Debian-package, install it, first. Generally naming convention of those Debian-packages goes like in this example: Installation or running of some Haskell-software or -package complains, that a Haskell package called “digest” is missing. In that case you must install these Debian-packages and their dependencies: libghc-digest-dev libghc-digest-prof You may also need this: libghc-digest-doc But if some Haskell-softare or -package is not available as a Debian-package, you can install it with this script called mycabal. As a root create directory for using GNU stow: mkdir -p /usr/local/stow/cabal chown root: /usr/local/stow/cabal chmod ugo+rx,go-w /usr/local/stow/cabal Create settings- and cache-directory for cabal and put that file called config there: mkdir /root/.cabal mv (some path)/config /root/.cabal/config chmod -R go-rwx /root/.cabal Edit that file called config, if needed. At least you may want to add or comment mirrors of hackage. Put that script itself to some directory that is in your $PATH , but not in in other (l)users $PATH : mv (some path)/mycabal /root/bin/mycabal chmod go-rwx,u+rwx /root/bin/mycabal First you must update package list of cabal: nice -n 19 cabal update Run that command sometimes. Now you are ready to install Haskell-software with mycabal. If you already have some stuff in /usr/local/stow/cabal , de-stow its directopry, first: cd /usr/local/stow stow -D cabal Now install some Haskell-package with mycabal: mycabal install wikipedia4epub If that installation complains, that some Haskell-package is missing, try to find its Debian-package and install it. If it is not available as Debian-package, just install it with mycabal with that Haskell-package you were originally trying to install. mycabal install epub wikipedia4epub After that original Haskell-package and all its needed dependencies have been compiled and installed, you must stow: cd /usr/local/stow stow cabal /usr/local/bin must be in every users’ $PATH . If your shell has a builtin command called ”rehash”, run it. Now your new Haskell-package is installed and ready to run. Here is an example: cd ${HOME)/Documents/Wikipedia wiki4e-mkepub-subtree http://en.wikipedia.org/wiki/Trent_Reznor mount /media/CybookOpus/ && cd /media/CybookOpus/eBooks/Wikipedia cp ${HOME)/Documents/Wikipedia/*.epub ./ cd umount /media/CybookOpus/ That’s all, folks!