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.
12 pkgdesc="NoSQL database (precompiled official version)"
14 url="http://cassandra.apache.org/"
16 depends=('java-runtime')
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
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 -
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."
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/
66 ${pkgdir}/usr/share/cassandra/