1 # Contributor: Thomas Mudrunka <harvie@@email..cz>
2 # Maintainer: Thomas Mudrunka <harvie@@email..cz>
3 # You can also contact me on http://blog.harvie.cz/
8 pkgdesc="NOSQL database engine providing decentralized key-value store, flexible map/reduce engine and HTTP/JSON query interface"
11 url='http://riak.basho.com/'
12 makedepends=(erlang make gcc pacman)
13 pkgbigver=$( echo $pkgver | grep -o ^[0-9]*.[0-9]* ) #get x.x version from x.x.x version
14 backup=('opt/riak/etc/app.config' 'opt/riak/etc/vm.args')
15 install="${pkgname}.install"
16 source=("http://downloads.basho.com/riak/${pkgname}-${pkgbigver}/${pkgname}-${pkgver}.tar.gz" 'riak.rc')
17 md5sums=('5792ac2b91ad71ccaee91d1ef9632348'
18 '942e198d5dfa52ac36360e3f79b65930')
19 prefixpath="/opt/${pkgname}"
20 #prefixpath="/usr/lib/erlang"
21 #prefixpath="/usr/lib/erlang/lib/${pkgname}-${pkgver}"
24 cd ${srcdir}/riak-${pkgver} || return 1
28 LDFLAGS='' make rel || return 1
30 cd rel/riak || return 1
31 #cd rel/overlay || return 1
32 mkdir -p ${pkgdir}${prefixpath}
35 cp -r ./* ${pkgdir}${prefixpath} || return 1
37 [ -d "${pkgdir}/usr/lib/erlang" ] && {
38 msg 'Removing files already shipped with erlang package...';
39 pacman -Ql erlang | cut -d ' ' -f 2- | while read i; do
47 chmod -R 755 ${pkgdir}${prefixpath}/bin
49 msg 'ArchLinux integration...';
51 mkdir -p ${pkgdir}/var/log
52 ln -s ${prefixpath}/log ${pkgdir}/var/log/riak
53 mkdir -p ${pkgdir}/etc/rc.d
54 ln -s ${prefixpath}/etc ${pkgdir}/etc/riak
55 mkdir -p ${pkgdir}/usr/share/doc/
56 cp -r ${srcdir}/riak-${pkgver}/doc/man ${pkgdir}/usr/share/
57 cp -r ${srcdir}/riak-${pkgver}/doc ${pkgdir}/usr/share/doc/riak
58 rm -r ${pkgdir}/usr/share/doc/riak/man
60 mkdir -p ${pkgdir}/usr/bin/
61 for i in riak riak-admin; do
62 cat > ${pkgdir}/usr/bin/$i <<EOF
64 su riak -c "${prefixpath}/bin/$i \$@"
68 cp ${srcdir}/riak.rc ${pkgdir}/etc/rc.d/riak
70 chmod -R 755 ${pkgdir}/usr/bin/ ${pkgdir}/etc/rc.d/