xstow snippets

Installing git without getting screwed over when it's time to uninstall, upgrade or install package maintainer's version

Tagged git, xstow, stow  Languages bash

Although Git is one of the better source code managers it has a major drawback if you need to install it from the sources - it's makefile doesn't have an uninstall target as defined in the GNU coding standards. Therefore you might find your system screwed over when you want to uninstall or upgrade after installing from sources. This is a workaround that is sufficient enough to make me break my rule of not installing software outside of package management.

Also see the snippet for an alias for the make command first.


sudo apt-get install asciidoc xsltproc xmlto xstow bzip2 build-essential zlib1g-dev tcl8.4


cd /tmp
wget http://kernel.org/pub/software/scm/git/git-
tar xjvf git-
sudo mv git- /usr/src
sudo ln -s /usr/src/git- /usr/src/git
cd /usr/src/git
./configure --prefix=/usr/local/stow/git
make all doc
sudo make install install-doc
cd /usr/local/stow
cat << EOF > /tmp/xstow.ini
# this is the xtow configuration file
# see xstow.ini(5) for details

# list of links that will be handled as normal directories
keep-targets = true      # add targets of the links to the keep-dirs section
link = /usr/local/tmp
link = /usr/local/var
link = /usr/local/man
link = /usr/local/share
link = /usr/local/share/man
link = /usr/local/doc
link = /usr/local/info
add-if-target = /*       # automatic add all absolute links

# directories that never should be removed
dir = /usr/local/bin
dir = /usr/local/sbin
dir = /usr/local/lib
dir = /usr/local/include
dir = /usr/local/share

ignore = *~      # emacs
ignore = core    # core file
ignore = core.*  # new style
ignore = CVS     # CVS directories
ignore-regex = [0]+README.*

# make other stow dirs public
dir = /usr/local/local/stow
dir = /usr/local/local/stow2

module = ALL
level  = 0

in-home = yes
in-stow-dir = yes
in-other-stow-dirs = yes
file = /etc/xstow.ini
file = /usr/local/local/etc/xstow.ini

absolute-paths = false
sudo mv -i /tmp/xstow.ini .
sudo xstow git


cd /usr/local/xstow
xstow -D git
sudo rm -rf /usr/local/stow/git

Kind of makes one appreciate the work done by package maintainers, doesn't it?

Compiling xvidcap for making screencasts in wmii

Tagged linux, xvidcap, xstow, screencasts in wmii  Languages bash

I was unable to make screencasts in wmii using Istanbul. So here's how I installed xvidcap. Unfortunately I cannot come up with a way for wget retrieval of the sourceball, so some manual labour is needed. Retrieve the sourceball and put it in /tmp. Then follow the instructions below. Also see the snippet for an alias for the make command first.

Note that I put the binaries in /usr/local/stow/xvidcap because the package comes from outside package management. I then use xstow to manage the symlinks in /usr/local/bin.

sudo apt-get install libxml-parser-perl libxmu-dev libglade2-dev libgtk2.0-dev
cd /tmp
tar zxvf xvidcap*.tar.gz
cd xvidcap*
./configure --prefix /usr/local/stow/xvidcap
sudo make install
cd /usr/local/stow
sudo xstow xvidcap

To remove xvidcap follow these steps

cd /usr/local/xstow
xstow -D xvidcap
sudo rm -rf /usr/local/stow/xvidcap

Installing ImageMagick from sources and using xstow to handle the installation.

Tagged xstow, imagemagick  Languages bash

I really hate installing software outside of the package manager, because that is not the way of a stable system. Xstow helps the agony those times that sourceball installations are necessary (e.g for new features). Here's how to install imagemagick with xstow. If you haven't installed xstow yet, then follow the relevant instructions in this snippet

sudo apt-get install libmagick9-dev # needed for sane image support
cd /tmp
wget ftp://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/ImageMagick-6.4.2-7.tar.bz2
tar xjvf ImageMagick-6.4.2-7.tar.bz2
sudo mv ImageMagick-6.4.2 /usr/src
cd /usr/src
sudo ln -s ImageMagick-6.4.2 imagemagick
cd imagemagick
./configure --prefix=/usr/local/stow/imagemagick
sudo make install
cd /usr/local/stow
sudo xstow imagemagick