summaryrefslogtreecommitdiff
path: root/community/mfs/PKGBUILD
blob: 857563518a575c9dbe77820feb631c3616dd3d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Maintainer: Thomas S Hatch <thatch45@gmail.com>
pkgbase=mfs
pkgname=('mfs-client' 'mfs-chunkserver' 'mfs-master')
pkgver=1.6.20
pkgrel=8
pkgdesc="MooseFS, fault tolerant, network distributed file system"
license=("GPL3")
arch=('i686' 'x86_64' 'mips64el')
options=('!libtool')
depends=('zlib' 'fuse' 'python2')
url="http://www.moosefs.com/"
source=("http://www.moosefs.org/tl_files/mfscode/mfs-$pkgver.tar.gz"
        "mfsmaster"
        "mfschunkserver"
        "mfsmetalogger"
        "mfscgiserv")
md5sums=('c57bdb9d7d41eec57c2bee9a1ff872c2'
         '5504cab151a1658489e5ece7ea9204c7'
         '69c7e2d2bcaba94fecb4120272e7caf4'
         '7e3da2f8015d54a202de99e52c88358c'
         'babe045a94bf8bfaea602fe515a860b0')

build() {
  cd "$srcdir"

  # Build the client
  cp -r $pkgbase-$pkgver $pkgbase-client
  cd $pkgbase-client
  ./configure \
      --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var/lib \
      --disable-mfschunkserver \
      --disable-mfsmaster \
      --disable-mfscgi \
      --disable-mfscgiserv
  make
  
  cd ..
  
  # Build the chunkserver
  cp -r $pkgbase-$pkgver $pkgbase-chunk
  cd $pkgbase-chunk
  ./configure \
      --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var/lib \
      --disable-mfsmaster \
      --disable-mfsmount \
      --disable-mfscgi \
      --disable-mfscgiserv
  make

  cd ..
  
  # Build the Master
  cp -r $pkgbase-$pkgver $pkgbase-master
  cd $pkgbase-master
  ./configure \
      --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var/lib \
      --disable-mfschunkserver \
      --disable-mfsmount
  make
}

package_mfs-client() {
  depends=('zlib' 'fuse')
  cd "$srcdir/$pkgbase-client"
  make DESTDIR="$pkgdir" install
  rm -rf $pkgdir/usr/share/man/man7
}

package_mfs-chunkserver() {
  depends=('zlib')
  cd "$srcdir/$pkgbase-chunk"
  make DESTDIR="$pkgdir" install
  rm -rf $pkgdir/usr/share/man/man7
  install -m 755 -D $srcdir/mfschunkserver $pkgdir/etc/rc.d/mfschunkserver
}

package_mfs-master() {
  depends=('zlib' 'python2')
  cd "$srcdir/$pkgbase-master"
  make DESTDIR="$pkgdir" install
  install -D -m0644 README $pkgdir/usr/share/doc/$pkgbase/README
  install -D -m0644 INSTALL $pkgdir/usr/share/doc/$pkgbase/INSTALL
  install -D -m0644 NEWS $pkgdir/usr/share/doc/$pkgbase/NEWS
  install -D -m0644 UPGRADE $pkgdir/usr/share/doc/$pkgbase/UPGRADE
  install -m 755 -D $srcdir/mfsmaster $pkgdir/etc/rc.d/mfsmaster
  install -m 755 -D $srcdir/mfsmetalogger $pkgdir/etc/rc.d/mfsmetalogger
  install -m 755 -D $srcdir/mfscgiserv $pkgdir/etc/rc.d/mfscgiserv
  find "$pkgdir" -name 'mfscgiserv' -print0 |xargs -0 \
    sed -i -e 's,^#!/usr/bin/env python$,#!/usr/bin/env python2,' \
    -e 's,^#!/usr/bin/python$,#!/usr/bin/python2,'
}