commit 7db7d80a9869bc51bf4a698bbc842f93253a009b Author: Guillaume ALAUX Date: Sat Jul 4 12:12:45 2015 +0200 Initial files 3.4.6 diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..c251ce9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = zookeeper + pkgdesc = Open-source server which enables highly reliable distributed coordination + pkgver = 3.4.6 + pkgrel = 7 + url = https://zookeeper.apache.org/ + install = install_zookeeper.sh + arch = any + license = Apache + depends = java-runtime + backup = etc/zookeeper/configuration.xsl + backup = etc/zookeeper/log4j.properties + backup = etc/zookeeper/zoo.cfg + source = http://mirrors.advancedhosters.com/apache///zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz + source = systemd_zookeeper.service + source = systemd_zookeeper@.service + source = systemd_sysusers.d_zookeeper.conf + source = systemd_tmpfiles.d_zookeeper.conf + sha256sums = 01b3938547cd620dc4c93efe07c0360411f4a66962a70500b163b59014046994 + sha256sums = 0235413122567a4810ce4aeb8b4b41a749ca69b1ee79e1d225b811febd92dfed + sha256sums = 6727641f542b3a483c31cdbda30101ac41397b725c6b3e706932f04bc51af907 + sha256sums = e863b63650c15a8823cfb2b507c375c999a71cda24805062de36af0250de5daa + sha256sums = 99fff5b04623889b0010c74c2dc3a4be29e7770fe2c7e15da51f7442a28c6580 + +pkgname = zookeeper + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3536839 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.pkg.tar.xz +*.src.tar.gz +*.src.tar.xz +pkg +src diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..f3261f6 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,78 @@ +# Maintainer: Ben Edwards +# Contributor: Ben Alex +# Contributor: Scott Lawrence +# Contributor: Guillaume ALAUX +pkgname=zookeeper +pkgver=3.4.6 +pkgrel=7 +pkgdesc='Open-source server which enables highly reliable distributed coordination' +arch=('any') +url='https://zookeeper.apache.org/' +license=('Apache') +depends=('java-runtime') +backup=(etc/zookeeper/configuration.xsl + etc/zookeeper/log4j.properties + etc/zookeeper/zoo.cfg) +install=install_zookeeper.sh + +_apache_cgi="http://www.apache.org/dyn/closer.cgi" +_closest=$(curl "${_apache_cgi}?asjson=1" | tr -d '\n ' | sed -r 's/.*"preferred":"(.+)".*/\1/') +_app_path="/${pkgname}/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz" +source=(${_closest}/${_app_path} + systemd_zookeeper.service + systemd_zookeeper@.service + systemd_sysusers.d_zookeeper.conf + systemd_tmpfiles.d_zookeeper.conf) + +sha256sums=('01b3938547cd620dc4c93efe07c0360411f4a66962a70500b163b59014046994' + '0235413122567a4810ce4aeb8b4b41a749ca69b1ee79e1d225b811febd92dfed' + '6727641f542b3a483c31cdbda30101ac41397b725c6b3e706932f04bc51af907' + 'e863b63650c15a8823cfb2b507c375c999a71cda24805062de36af0250de5daa' + '99fff5b04623889b0010c74c2dc3a4be29e7770fe2c7e15da51f7442a28c6580') + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + _app_home=/usr/share/${pkgname} + + install -d "${pkgdir}"{${_app_home}/bin,/etc,/usr/bin,/usr/share/{doc,java}} + + cp -r conf ${pkgdir}/etc/${pkgname}/ + ln -s /etc/${pkgname} "${pkgdir}${_app_home}/conf" + + 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 + + #cp -r docs "${pkgdir}/usr/share/doc/${pkgname}/" + #ln -s /usr/share/doc/${pkgname} "${pkgdir}${_app_home}/docs" + #cp -r src "${pkgdir}/usr/share/${pkgname}" + + 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" + + cp -r recipes "${pkgdir}/usr/share/${pkgname}" + install -m 644 ${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" + + 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" \ + "${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" + install -D -m 644 "${srcdir}/systemd_tmpfiles.d_zookeeper.conf" \ + "${pkgdir}/usr/lib/tmpfiles.d/zookeeper.conf" +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b698a9c --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Arch Linux source package for [Zookeeper](https://zookeeper.apache.org/). This is **not** the sources of [the package available in AUR](https://aur.archlinux.org/packages/zookeeper). diff --git a/install_zookeeper.sh b/install_zookeeper.sh new file mode 100644 index 0000000..d3e45bf --- /dev/null +++ b/install_zookeeper.sh @@ -0,0 +1,18 @@ +post_install() { + systemd-sysusers zookeeper.conf + systemd-tmpfiles --create zookeeper.conf +} + +post_upgrade(){ + systemd-sysusers zookeeper.conf + systemd-tmpfiles --create zookeeper.conf +} + +post_remove() { + if getent passwd zookeeper >/dev/null 2>&1; then + userdel -f zookeeper + fi + if getent group zookeeper >/dev/null 2>&1; then + groupdelf zookeeper + fi +} diff --git a/systemd_sysusers.d_zookeeper.conf b/systemd_sysusers.d_zookeeper.conf new file mode 100644 index 0000000..17a3bca --- /dev/null +++ b/systemd_sysusers.d_zookeeper.conf @@ -0,0 +1 @@ +u zookeeper - "Zookeeper user" /usr/share/zookeeper diff --git a/systemd_tmpfiles.d_zookeeper.conf b/systemd_tmpfiles.d_zookeeper.conf new file mode 100644 index 0000000..91105f5 --- /dev/null +++ b/systemd_tmpfiles.d_zookeeper.conf @@ -0,0 +1,2 @@ +d /var/log/zookeeper 0755 zookeeper log +d /var/lib/zookeeper 0755 zookeeper zookeeper diff --git a/systemd_zookeeper.service b/systemd_zookeeper.service new file mode 100644 index 0000000..4ca462d --- /dev/null +++ b/systemd_zookeeper.service @@ -0,0 +1,20 @@ +[Unit] +Description=Zookeeper distributed coordination server +After=network.target + +[Service] +User=zookeeper +Group=zookeeper +SyslogIdentifier=zookeeper +ExecStart=/usr/bin/java \ + -Dzookeeper.log.dir=/var/log/zookeeper \ + -Dzookeeper.root.logger=INFO,ROLLINGFILE \ + -cp /usr/share/java/zookeeper/* \ + -Dlog4j.configuration=file:/etc/zookeeper/log4j.properties \ + -Dcom.sun.management.jmxremote \ + -Dcom.sun.management.jmxremote.local.only=false \ + org.apache.zookeeper.server.quorum.QuorumPeerMain \ + /etc/zookeeper/zoo.cfg + +[Install] +WantedBy=multi-user.target diff --git a/systemd_zookeeper@.service b/systemd_zookeeper@.service new file mode 100644 index 0000000..0f7881d --- /dev/null +++ b/systemd_zookeeper@.service @@ -0,0 +1,20 @@ +[Unit] +Description=Zookeeper distributed coordination server (%i) +After=network.target + +[Service] +User=zookeeper +Group=zookeeper +SyslogIdentifier=zookeeper-%i +ExecStart=/usr/bin/java \ + -Dzookeeper.log.dir=/var/log/zookeeper/zookeeper-%i \ + -Dzookeeper.root.logger=INFO,ROLLINGFILE \ + -cp /usr/share/java/zookeeper/* \ + -Dlog4j.configuration=file:/etc/zookeeper/zookeeper-%i/log4j.properties \ + -Dcom.sun.management.jmxremote \ + -Dcom.sun.management.jmxremote.local.only=false \ + org.apache.zookeeper.server.quorum.QuorumPeerMain \ + /etc/zookeeper/zookeeper-%i/zoo.cfg + +[Install] +WantedBy=multi-user.target