summaryrefslogtreecommitdiff
path: root/community/mfs/PKGBUILD
blob: d27bbe9b214c25c2573e6d8b585d0abe817d8578 (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
99
100
101
102
# $Id: PKGBUILD 68131 2012-03-18 14:31:17Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Thomas S Hatch <thatch45@gmail.com>

pkgbase=mfs
pkgname=('mfs-client' 'mfs-chunkserver' 'mfs-master')
pkgver=1.6.24
pkgrel=1
pkgdesc="MooseFS, fault tolerant, network distributed file system"
license=("GPL3")
arch=('x86_64' 'i686' 'mips64el')
options=('!libtool')
depends=('zlib' 'fuse' 'python2' 'bash')
url="http://www.moosefs.com/"
source=("http://www.moosefs.org/tl_files/mfscode/mfs-$pkgver.tar.gz"
        "mfsmaster"
        "mfschunkserver"
        "mfsmetalogger"
        "mfscgiserv")
sha256sums=('823c2c63d66dc8ba9d409e8af0f6c452cebc3a073f1d89b034e65320104eaa25'
            '6e75a33996120cb5d240075bcc92522d490892fae5f9f5c4f2d1b020db54c9c1'
            '48dc7a4e2ba23668456a2593154a850cebca649412f8c11e8f1a94038831638e'
            'aae5fdf39469eb47bb4962b51bbdb3c51772930f574010c29bb5a36f1820d0ee'
            '357304173688536ab70b9978ae44317b07de1fdcf3736b31a94b2a6186e8e9fa')

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' 'bash')
  cd "$srcdir/$pkgbase-client"
  make DESTDIR="$pkgdir" install
  rm -rf $pkgdir/usr/share/man/man7
}

package_mfs-chunkserver() {
  depends=('zlib' 'bash')
  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,'
}

# vim:set ts=2 sw=2 et: