# Get it
cd
test -f installed/gamin-0.1.10.tar.gz &&
mv -f installed/gamin-0.1.10.tar.gz .
test ! -f gamin-0.1.10.tar.gz &&
wget http://people.gnome.org/~veillard/gamin/sources/gamin-0.1.10.tar.gz
# Extract it
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "gamin-*" -exec rm -r {} \;
tar xzvf ~/gamin-0.1.10.tar.gz
cd gamin-0.1.10
test $UID = 0 && chown -R root:root .
# Apply this patch from Ubuntu
wget -nc https://launchpad.net/ubuntu/+archive/primary/+files/\
gamin_0.1.10-2ubuntu2.diff.gz &&
zcat gamin_0.1.10-2ubuntu2.diff.gz | patch -p1
# And apply this patch which the previous patch created
patch -p0 < debian/patches/21_no_g_const_return.patch
# Configure the build
# Pass --libdir=/usr/lib64 if 64-bit, if not use default
# Add --with-python if you want to build the Python bindings
test ($uname -m) = "x86_64" &&
CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/usr --libdir=/usr/lib64
test ($uname -m) != "x86_64" &&
CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/usr
# Compile it
make
# Become root to install it
su
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/gamin-*.tar.*
mv gamin-0.1.10.tar.gz installed/
# If you ever want to uninstall Gamin, this should do it:
cd
su
test -d src/gamin-* && ( cd src/gamin-* ; make uninstall )
rm -f /usr/include/fam.h \
/usr/lib*/pkgconfig/gamin.pc \
/usr/lib/python*/site-packages/_gamin.* \
/usr/libexec/gam_server
( cd /usr/lib ; rm -f libgamin_shared.* libgamin-1.* libfam.* )
test -d /usr/lib64 &&
( cd /usr/lib64 ; rm -f libgamin_shared.* libgamin-1.* libfam.* )
find /usr/lib*/python*/site-packages/*gamin.* -type f -exec rm {} \;
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "gamin-*" -exec rm -r {} \;
rm -f ~/installed/gamin-*.tar.*