updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / mdadm-git / PKGBUILD
blobbda330dc316ea730f446d0cdfbdd1331d0fca997
1 # Contributor: Mathias Buren <mathias.buren@gmail.com>
2 pkgname=mdadm-git
3 pkgver=20110701
4 pkgrel=3
5 pkgdesc="A tool for managing/monitoring Linux md device arrays, also known as Software RAID. -git version"
6 arch=(i686 x86_64)
7 license=('GPL')
8 url="http://neil.brown.name/blog/mdadm/"
9 conflicts=('mkinitcpio<0.5.99' 'mdadm')
10 makedepends=('git')
11 depends=('glibc')
12 backup=('etc/mdadm.conf')
13 source=(mdadm-git
14         mdadm.conf
15         mdadm_install
16         mdadm_hook)
17 install=mdadm.install
18 replaces=('raidtools')
20 _gitroot="git://neil.brown.name/mdadm"
21 _gitname="mdadm"
23 build() {
24   cd "$srcdir"
25   msg "Connecting to GIT server...."
27   if [ -d $_gitname ] ; then
28     cd $_gitname && git pull origin
29     msg "The local files are updated."
30   else
31     git clone $_gitroot $_gitname --depth=1
32   fi
34   msg "GIT checkout done or server timeout"
35   msg "Starting make..."
37   rm -rf "$srcdir/$_gitname-build"
38   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
39   cd "$srcdir/$_gitname-build"
41   #
42   # BUILD HERE
43   #
45   make || return 1
46   # build static mdassemble for Arch's initramfs
47   make MDASSEMBLE_AUTO=1 mdassemble
51 package() {
52    cd "$srcdir/$_gitname-build"
53    make INSTALL=/bin/install DESTDIR=$pkgdir install
54    install -D -m644 $srcdir/mdadm.conf $pkgdir/etc/mdadm.conf
55    install -D -m755 $srcdir/mdadm-git $pkgdir/etc/rc.d/mdadm
56    install -D -m644 $srcdir/mdadm_install $pkgdir/lib/initcpio/install/mdadm
57    install -D -m644 $srcdir/mdadm_hook $pkgdir/lib/initcpio/hooks/mdadm
58    # symlink for backward compatibility
59    ln -sf /lib/initcpio/hooks/mdadm  $pkgdir/lib/initcpio/hooks/raid
60    install -D -m755 mdassemble $pkgdir/sbin/mdassemble
62 md5sums=('6df172c8f77b280018cf87eb3d313f29'
63          '00cbed931db4f15b6ce49e3e7d433966'
64          '865c3d39e5f5dae58388160b563981f1'
65          '1a3eb63832cecd6550f5b0a21d58cfdb')