updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / cassandra / PKGBUILD
blob9fbe38ff43c2216c522c5f6bd89f6d63e036fbf7
1 # Contributor: Thomas Dziedzic < gostrc at gmail >
2 # Maintainer: <helllamer@gmail.com> 
3 # Thanks to Alper Kanat <alperkanat@raptiye.org> for cassandra rc.d script. 
5 # check() function is used to verify GPG signature. check() imports 3 keys into your GPG keyring at first build.
6 # See http://scarybeastsecurity.blogspot.com/2011/07/alert-vsftpd-download-backdoored.html for reason of this step.
7 # If you have problems with gpg, you can remove check() function, and all will be ok.
9 pkgname=cassandra
10 pkgver=1.0.6
11 pkgrel=1
12 pkgdesc="NoSQL database (precompiled official version)"
13 arch=('any')
14 url="http://cassandra.apache.org/"
15 license=('APACHE')
16 depends=('java-runtime')
17 makedepends=('gnupg')
18 url_tgz="http://apache.mirror.anlx.net/cassandra/$pkgver/apache-$pkgname-$pkgver-bin.tar.gz"
19 source=($url_tgz cassandra)
20 md5sums=('1bd6be313368df878c67e9b9cdf19d27'
21          '19d01c3e8c967fa4fc4456f53b36f9fd')
23 ## to check gpg signature
24 check() {
25         msg "Checking GPG signature..."
26         msg2 "(To disable gpg-check: remove/rename check() function from/in PKGBUILD code.)"
27         gpg --list-keys | grep 'sylvain@datastax.com' || {
28                 url_keys='https://www.apache.org/dist/cassandra/KEYS'
29                 msg "No maintainers' GPG keys found. Importing from $url_keys (2,7 KiB)..."
30                 wget --quiet -O - $url_keys | gpg --import -
31         }
32         # no need to add signature to package dependences
33         wget --quiet -O - "$url_tgz.asc" | gpg --verify - "apache-$pkgname-$pkgver-bin.tar.gz"
34         msg2 "Detached GPG signature is valid."
37 package() {
38     install -D -m755 cassandra $pkgdir/etc/rc.d/cassandra
40         cd $srcdir/apache-cassandra-${pkgver}
42         mkdir -p ${pkgdir}/var/{lib,log}/cassandra
43         mkdir -p ${pkgdir}/usr/bin
44         mkdir -p ${pkgdir}/usr/share/cassandra
46         sed -i 's_`dirname $0`/.._/usr/share/cassandra_' bin/cassandra.in.sh
48         chown http:http ${pkgdir}/var/{lib,log}/cassandra
50         cp -a {lib,conf,interface} ${pkgdir}/usr/share/cassandra/
52         cd bin
54         install \
55                 cassandra \
56                 cassandra-cli \
57                 json2sstable \
58                 nodetool \
59                 sstable2json \
60                 sstablekeys \
61                 stop-server \
62                 ${pkgdir}/usr/bin/
64         install \
65                 cassandra.in.sh \
66                 ${pkgdir}/usr/share/cassandra/