# unionfs install script - builds module to match running kernel startdir=/usr/share pkgver=1.0.14 kernelver=`uname -r` build() { [ ! -d /usr/src/linux-$kernelver ] && return echo ":: Building unionfs module for your kernel ($kernelver)" cd $startdir/unionfs-$pkgver echo -e \ "EXTRACFLAGS=\"-DUNIONFS_NDEBUG -DUNIONFS_VERSION=\\\"1.0.14\\\"\""\ "\nUNIONFS_DEBUG_CFLAG="\ "\nLINUXSRC=/usr/src/linux-$kernelver\n" \ > fistdev.mk make -s install-mod || return 1 make -s clean rm fistdev.mk depmod -a echo ":: Done" } # arg 1: the new package version post_install() { build } # arg 1: the new package version # arg 2: the old package version pre_upgrade() { /bin/true } # arg 1: the new package version # arg 2: the old package version post_upgrade() { build } # arg 1: the old package version pre_remove() { /bin/true } # arg 1: the old package version post_remove() { rm /lib/modules/$kernelver/kernel/fs/unionfs.ko > /dev/null 2>&1 /bin/true } op=$1 shift $op $*