zookeeper36/PKGBUILD

82 lines
3.4 KiB
Bash
Raw Normal View History

2020-06-17 04:16:01 +09:00
# Maintainer: Thor77 <thor77 at thor77 dot org>
# Contributor: Cody Ramaker <cramaker@linux.com>
2018-11-01 04:59:13 +09:00
# Contributor: Andreas Nüßlein <nutz@noova.de>
# Contributor: Ben Edwards <ben@artfuldodge.io>
2015-07-04 19:12:45 +09:00
# Contributor: Ben Alex <ben.alex@acegi.com.au>
# Contributor: Scott Lawrence <bytbox@gmail.com>
# Contributor: Guillaume ALAUX <guillaume at alaux dot net>
2021-07-29 18:18:35 +09:00
pkgname=zookeeper36
_pkgname=zookeeper
pkgver=3.6.3
2019-04-17 12:25:28 +09:00
pkgrel=1
2021-07-29 18:18:35 +09:00
pkgdesc='Open-source server which enables highly reliable distributed coordination -- Version 3.6'
2015-07-04 19:12:45 +09:00
arch=('any')
url='https://zookeeper.apache.org/'
license=('Apache')
depends=('java-runtime')
2021-07-29 18:18:35 +09:00
provides=('zookeeper')
conflicts=('zookeeper')
2015-07-04 19:12:45 +09:00
backup=(etc/zookeeper/configuration.xsl
etc/zookeeper/log4j.properties
etc/zookeeper/zoo.cfg)
_apache_cgi="http://www.apache.org/dyn/closer.cgi"
_closest=$(curl "${_apache_cgi}?asjson=1" | tr -d '\n ' | sed -r 's/.*"preferred":"(.+)".*/\1/')
2021-07-29 18:18:35 +09:00
_app_path="/${_pkgname}/${_pkgname}-${pkgver}/apache-${_pkgname}-${pkgver}-bin.tar.gz"
2016-10-04 00:19:43 +09:00
source=(${_closest}/${_app_path}
2015-07-04 19:12:45 +09:00
systemd_zookeeper.service
systemd_zookeeper@.service
systemd_sysusers.d_zookeeper.conf
systemd_tmpfiles.d_zookeeper.conf)
2021-07-29 18:18:35 +09:00
sha256sums=('fed19a8e8daa3cd49e721d61929b90613dc0b19faa8ccb7d0b3a85db46b0c922'
2015-12-05 23:53:40 +09:00
'b59e0641de1951ad149ca39df5b5ec37dc6229f1aa987b0ed9d7e82e570be9ed'
'a3fd2566648f57c0cdd75cd48b7b60fa55eb59ee67dd716de1e1aa6a57823b88'
2015-07-04 19:12:45 +09:00
'e863b63650c15a8823cfb2b507c375c999a71cda24805062de36af0250de5daa'
'99fff5b04623889b0010c74c2dc3a4be29e7770fe2c7e15da51f7442a28c6580')
package() {
2021-07-29 18:18:35 +09:00
cd "${srcdir}/apache-${_pkgname}-${pkgver}-bin"
2015-07-04 19:12:45 +09:00
2021-07-29 18:18:35 +09:00
_app_home=/usr/share/${_pkgname}
2015-07-04 19:12:45 +09:00
install -d "${pkgdir}"{${_app_home}/bin,/etc,/usr/bin,/usr/share/{doc,java}}
2021-07-29 18:18:35 +09:00
cp -r conf ${pkgdir}/etc/${_pkgname}/
ln -s /etc/${_pkgname} "${pkgdir}${_app_home}/conf"
2015-07-04 19:12:45 +09:00
cp -r bin/*.sh "${pkgdir}${_app_home}/bin/"
sed -i "s|^ZOOBIN=\"\$(dirname \"\${ZOOBIN}\")\"|ZOOBIN=\"${_app_home}/bin\"|" \
"${pkgdir}"${_app_home}/bin/*
for b in zkCleanup.sh zkCli.sh zkServer.sh; do
bname=$(basename $b)
ln -s ${_app_home}/bin/${bname} "${pkgdir}/usr/bin/${bname}"
done
2021-07-29 18:18:35 +09:00
cp -r lib "${pkgdir}/usr/share/java/${_pkgname}"
rm -rf "${pkgdir}"/usr/share/java/${_pkgname}/{jdiff,cobertura}
ln -s ../java/${_pkgname} "${pkgdir}${_app_home}/lib"
2015-07-04 19:12:45 +09:00
2019-04-17 12:25:28 +09:00
### As of 3.4.14, recipes are no longer held in a separate directory
# cp -r recipes "${pkgdir}/usr/share/${pkgname}"
2021-07-29 18:18:35 +09:00
install -m 644 "${srcdir}/apache-${_pkgname}-${pkgver}-bin/lib/${_pkgname}-${pkgver}.jar" \
"${pkgdir}/usr/share/java/${_pkgname}/${_pkgname}-${pkgver}.jar"
ln -s ${_pkgname}-${pkgver}.jar \
"${pkgdir}/usr/share/java/${_pkgname}/${_pkgname}.jar"
ln -s lib/${_pkgname}-${pkgver}.jar \
"${pkgdir}/usr/share/${_pkgname}/${_pkgname}-${pkgver}.jar"
2015-07-04 19:12:45 +09:00
install -D -m 644 "${srcdir}/systemd_zookeeper.service" \
"${pkgdir}/usr/lib/systemd/system/zookeeper.service"
install -D -m 644 "${srcdir}/systemd_zookeeper@.service" \
"${pkgdir}/usr/lib/systemd/system/zookeeper@.service"
install -D -m 644 "${srcdir}/systemd_sysusers.d_zookeeper.conf" \
2021-07-29 18:18:35 +09:00
"${pkgdir}/usr/lib/sysusers.d/${_pkgname}.conf"
sed "s|^dataDir=/tmp/zookeeper$|dataDir=/var/lib/${_pkgname}|" \
"${pkgdir}/etc/${_pkgname}/zoo_sample.cfg" \
> "${pkgdir}/etc/${_pkgname}/zoo.cfg"
2015-07-04 19:12:45 +09:00
install -D -m 644 "${srcdir}/systemd_tmpfiles.d_zookeeper.conf" \
"${pkgdir}/usr/lib/tmpfiles.d/zookeeper.conf"
}