updated on Fri Jan 20 08:04:04 UTC 2012
[aur-mirror.git] / cassandra / PKGBUILD
blob0959b261be6b2b6836fe25d701e3200d5f616a5f
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.7
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=('84eb69022080f6ffdfd5c8e9d9e286d6'
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/