updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / aufs2 / PKGBUILD
blob080734821fd2f578e36f0906c6705b4ac3eb2bc5
1 # Contributor: Paul Mattal <pjmattal@elys.com>
2 # Maintainer: Calimero <calimeroteknik@free.fr>
4 pkgname=aufs2
5 pkgver=3.0_20110801
6 pkgrel=1
7 #_kernver=${pkgver%_*}-ARCH
9 # Set to whatever the tree of your aufs-friendly kernel is, and set the right dependency.
10 #_kernver=3.0-ARCH
11 #depends=('aufs_friendly')
13 _kernver=3.0-aufs_friendly
14 depends=('linux-aufs_friendly')
16 pkgdesc="Another Unionfs Implementation"
17 arch=('i686' 'x86_64')
18 url="http://aufs.sourceforge.net/"
19 license=('GPL2')
20 replaces=('aufs')
21 install=aufs2.install
22 source=("http://calimeroteknik.free.fr/src/aufs2-${pkgver}.tar.gz")
23 options=('!makeflags' '!strip')
24 md5sums=('c270ef00d60f9b8ff92dfc4be0d2e143')
26 build() {
27   cd ${srcdir}/aufs2-${pkgver}
28   sed -i 's|CONFIG_AUFS_HNOTIFY =.*|CONFIG_AUFS_HNOTIFY = y|' \
29      config.mk
30   sed -i 's|CONFIG_AUFS_HFSNOTIFY =.*|CONFIG_AUFS_HFSNOTIFY = y|' \
31      config.mk
32   sed -i 's|CONFIG_AUFS_EXPORT =.*|CONFIG_AUFS_EXPORT = y|' \
33      config.mk
34   sed -i 's|CONFIG_AUFS_SHWH =.*|CONFIG_AUFS_SHWH = y|' \
35      config.mk
36   sed -i 's|CONFIG_AUFS_BDEV_LOOP =.*|CONFIG_AUFS_BDEV_LOOP = y|' \
37      config.mk
38   sed -i 's|CONFIG_AUFS_BR_RAMFS =.*|CONFIG_AUFS_BR_RAMFS = y|' \
39      config.mk
40   sed -i 's|CONFIG_AUFS_DEBUG =.*|CONFIG_AUFS_DEBUG =|' \
41      config.mk
42   if [ "${CARCH}" = "x86_64" ]; then
43     inot64=" y"
44   else
45     inot64=""
46   fi
47   sed -i "s|CONFIG_AUFS_INO_T_64 =.*|CONFIG_AUFS_INO_T_64 =${inot64}|" \
48      config.mk 
49   # build, sed fixes are from gentoo portage build
50   sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile
51   sed -i "s:__user::g" include/linux/aufs_type.h
52   make KDIR=/usr/src/linux-${_kernver}
55 package() {
56   cd ${srcdir}/aufs2-${pkgver}
57   install -D -m644 fs/aufs/aufs.ko \
58     $pkgdir/lib/modules/${_kernver}/kernel/fs/aufs/aufs.ko 
59   # tweak the install script for the right kernel version
60   sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
61     $startdir/aufs2.install
62   # install include files
63   install -D -m 644 include/linux/aufs_type.h $pkgdir/usr/include/linux/aufs_type.h
64   # gzip -9 all modules to safe 100MB
65   find "$pkgdir" -name '*.ko' -exec gzip -9 {} \;