1 ## Contributor: shahid <helllamer@gmail.com>
2 ## Originally based on following PKGBUILDs:
3 ## - Thomas Dziedzic's: cassandra
5 ## More info about this PKGBUILD:
6 ## - https://bitbucket.org/helllamer/archlinux-pkgbuild/wiki/pkgbuild/solandra-git
12 pkgdesc="NoSQL database (Cassandra with Apache Solr)"
14 url="https://github.com/tjake/Solandra"
15 license=('Apache 2.0')
16 conflicts=('cassandra')
17 depends=('java-runtime')
18 makedepends=('apache-ant' 'git')
19 provides=('cassandra')
24 gitdir=$srcdir/$_gitname
25 builddir=$srcdir/$_gitname-build
27 SOLANDRA_HOME=usr/share/$name
29 ## install directories
31 share_d=$SOLANDRA_HOME
33 var_lib_d=var/lib/$name
34 var_log_d=var/log/$name
39 msg "Connecting to the git server..."
41 if [[ -d $srcdir/$_gitname ]] ; then
43 git remote set-url origin $_gitroot
45 msg "The local files are updated."
47 git clone --depth 1 $_gitroot $_gitname || echo skipping
49 msg "Git checkout done"
51 msg "Starting make..."
53 cp -r $gitdir $builddir
55 ## recently installed apache-ant may not be seen shell
56 which ant || . /etc/profile.d/apache-ant.sh
71 mkdir -p $pkgdir/$var_lib_d
72 mkdir -p $pkgdir/$var_log_d
73 mkdir -p $pkgdir/$bin_d
74 mkdir -p $pkgdir/$etc_d
75 mkdir -p $pkgdir/$share_d/lib
77 chown http:http $pkgdir/$var_lib_d $pkgdir/$var_log_d
80 cd $builddir/solandra-app
81 install -D -m755 bin/{solandra,nodetool,cassandra-cli} $pkgdir/$bin_d
83 ## install bash-include with fixed paths
84 install -D -m755 bin/$name.in.sh $pkgdir/$share_d
85 sed -e "s@\`dirname \$0\`/..@/$share_d@" \
86 -e 's@\(for jar in \)\(lib\)@\1$SOLANDRA_HOME/\2@' \
87 -i $pkgdir/$share_d/$name.in.sh
89 ## fix path for storing data: from /tmp to /var/lib
90 sed -e "s@/tmp/cassandra-data@/$var_lib_d@g" -i conf/cassandra.yaml
91 sed -e "s@/var/log/cassandra@/$var_log_d@g" -i conf/log4j-server.properties
92 ## move configs to /etc with symlink
93 install -m644 conf/* $pkgdir/$etc_d
94 ln -s /$etc_d $pkgdir/$share_d/conf
97 install -D -m644 lib/* $pkgdir/$share_d/lib/