summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Nagy2015-06-08 19:41:52 +0200
committerDaniel Nagy2015-06-08 19:41:52 +0200
commit99f4ed1439ea0fb6f38b7324e5e066c714c551eb (patch)
treefeb53113227c6bb0e5ee42555dfa0ff0d7cc1638
downloadaur-99f4ed1439ea0fb6f38b7324e5e066c714c551eb.tar.gz
import to aur4
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD42
-rw-r--r--changelog54
-rw-r--r--gerrit.conf4
-rw-r--r--gerrit.install127
-rw-r--r--gerrit.systemd24
6 files changed, 275 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..4232f294e69
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = gerrit
+ pkgdesc = A web-based code review tool built on top of the git version control system
+ pkgver = 2.11
+ pkgrel = 1
+ url = http://code.google.com/p/gerrit/
+ install = gerrit.install
+ changelog = changelog
+ arch = any
+ license = Apache
+ depends = java-runtime
+ depends = ttf-dejavu
+ depends = libcups
+ optdepends = bcprov: Java cryptography APIs (Bouncy Castle)
+ noextract = gerrit.war
+ backup = etc/default/gerritcodereview
+ source = http://gerrit-releases.storage.googleapis.com/gerrit-2.11.war
+ source = gerrit.conf
+ source = gerrit.systemd
+ sha256sums = 05c155c454f06c324e89863e6c6a9c814833c7caea7b38f6c9b360336b30b96d
+ sha256sums = 35becf2754e3779c750b2889909349160c2b0584ec201f6cfb5cf2c42e6fc598
+ sha256sums = be1d205c6a0f3b24aad3c385f8188c64bfa3a9799ecf8ce5e089149af991a645
+
+pkgname = gerrit
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..ab4b78a9e6d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Daniel Nagy <danielnagy at gmx de>
+# Contributor: Thanh Ha <thanh.ha at alumni.carleton dot ca>
+# Contributor: Marcel Huber <marcelhuberfoo at gmail dot com>
+#
+# Repository: https://github.com/zxiiro/arch-gerrit
+
+pkgname=gerrit
+pkgver=2.11
+pkgrel=1
+#epoch=
+pkgdesc="A web-based code review tool built on top of the git version control system"
+arch=(any)
+url="http://code.google.com/p/gerrit/"
+license=('Apache')
+groups=()
+depends=(java-runtime ttf-dejavu libcups)
+makedepends=()
+checkdepends=()
+optdepends=('bcprov: Java cryptography APIs (Bouncy Castle)')
+provides=()
+conflicts=()
+replaces=()
+backup=(etc/default/gerritcodereview)
+options=()
+install=gerrit.install
+changelog=changelog
+source=(http://gerrit-releases.storage.googleapis.com/gerrit-$pkgver.war
+ gerrit.conf
+ gerrit.systemd)
+noextract=(gerrit.war)
+sha256sums=('05c155c454f06c324e89863e6c6a9c814833c7caea7b38f6c9b360336b30b96d'
+ '35becf2754e3779c750b2889909349160c2b0584ec201f6cfb5cf2c42e6fc598'
+ 'be1d205c6a0f3b24aad3c385f8188c64bfa3a9799ecf8ce5e089149af991a645')
+package() {
+ install -D -m 444 "$srcdir/gerrit-$pkgver.war" "$pkgdir/usr/share/java/gerrit/gerrit.war"
+ install -D -m 644 "$srcdir/gerrit.systemd" "$pkgdir/usr/lib/systemd/system/gerrit.service"
+ install -D -m 644 "$srcdir/gerrit.conf" "$pkgdir/etc/default/gerritcodereview"
+ install -m 755 -d "$pkgdir/var/lib/gerrit"
+}
+
+# vim:set ts=2 sw=2 et:
+
diff --git a/changelog b/changelog
new file mode 100644
index 00000000000..734ac639389
--- /dev/null
+++ b/changelog
@@ -0,0 +1,54 @@
+2014-01-06 Thanh Ha <thanh.ha@alumni.carleton.ca>
+
+ - Update to Gerrit 2.8
+
+2013-06-24 Thanh Ha <thanh.ha@alumni.carleton.ca>
+
+ - Update to Gerrit 2.7
+
+2013-06-24 Thanh Ha <thanh.ha@alumni.carleton.ca>
+
+ - Update to Gerrit 2.6.1
+
+2013-06-22 Thanh Ha <thanh.ha@alumni.carleton.ca>
+
+ - Update to Gerrit 2.6.0
+
+2013-05-20 Thanh Ha <thanh.ha@alumni.carleton.ca>
+
+ - Update to Gerrit 2.5.4
+
+2013-05-09 Marcel Huber <marcelhuberfoo@gmail.com>
+
+ - correcting install location of systemd file, removing rc service file
+
+2013-05-06 Thanh Ha <thanh.ha@alumni.carleton.ca>
+
+ - Update to Gerrit 2.5.2
+
+
+2012-08-23 Marcel Huber <marcelhuberfoo@gmail.com>
+
+ - gerrit-2.4.2-1
+ - not using /srv/gerrit-review anymore
+ - home directory of gerrit should suffice for the installation
+
+
+2012-08-23 Marcel Huber <marcelhuberfoo@gmail.com>
+
+ - added simple rc.d script which delegates to gerrit.sh
+ - corrected systemd start script
+ - corrected typo in default configuration
+
+
+2012-08-23 Marcel Huber <marcelhuberfoo@gmail.com>
+
+ - adjusted java command line to start gerrit
+ - adjusted default configuration file
+ - adjusted install file
+
+
+2012-08-17 Marcel Huber <marcelhuberfoo@gmail.com>
+
+ - initial copy of jenkins-ci files with some adaption
+ - needs still a lot of adaption
diff --git a/gerrit.conf b/gerrit.conf
new file mode 100644
index 00000000000..2c95ca9e5bc
--- /dev/null
+++ b/gerrit.conf
@@ -0,0 +1,4 @@
+JAVA=/usr/bin/java
+JAVA_OPTIONS=-Xmx512m
+GERRIT_SITE=/var/lib/gerrit
+GERRIT_WAR=/usr/share/java/gerrit/gerrit.war
diff --git a/gerrit.install b/gerrit.install
new file mode 100644
index 00000000000..31a93ce5618
--- /dev/null
+++ b/gerrit.install
@@ -0,0 +1,127 @@
+#!/bin/sh
+# vim:set ts=2 sw=2 et:
+
+## CHANGE the following two variables according to your preference
+## /bin/true: start/enable systemd service during installation
+## /bin/false: do not touch systemd services, manually enable/start the service
+_service_start=/bin/false
+_service_enable=/bin/true
+
+_service_name=gerrit.service
+_service_username=gerrit
+_service_groupname=${_service_username}
+_service_install_dir=/var/lib/${_service_username}
+_service_cache_dir=
+_service_log_dir=/var/log/${_service_username}
+
+_set_dir_permissions() {
+ for d in "${_service_install_dir}" "${_service_cache_dir}"; do
+ [ -n "${d}" -a -d "${d}" ] && chown -R ${_service_username}:${_service_groupname} ${d}
+ done
+}
+
+# Test whether the system is running with systemd.
+_is_running_systemd() {
+ ps -p 1 | grep -q "systemd"
+}
+
+# Test whether the systemd service is enabled (presuming that systemd is running).
+_is_systemd_service_enabled() {
+ /usr/bin/systemctl is-enabled --quiet ${_service_name} 2>/dev/null
+}
+
+_stop_systemd_service() {
+ if `eval ${_service_start}`; then
+ /usr/bin/systemctl stop ${_service_name} 2>/dev/null
+ fi;
+ return 0;
+}
+
+_start_systemd_service() {
+ _is_running_systemd || return 0;
+ _is_systemd_service_enabled || return 0;
+ if `eval ${_service_start}`; then
+ /usr/bin/systemctl start ${_service_name};
+ fi;
+ return 0;
+}
+
+_disable_systemd_service() {
+ if `eval ${_service_enable}`; then
+ _is_systemd_service_enabled && /usr/bin/systemctl disable ${_service_name} 2>/dev/null
+ fi;
+ return 0;
+}
+
+# Install systemd service.
+_enable_systemd_service() {
+ _is_running_systemd || return 0;
+ _is_systemd_service_enabled && return 0;
+ if `eval ${_service_enable}`; then
+ /usr/bin/systemctl enable ${_service_name} 2>/dev/null
+ fi;
+ return 0;
+}
+
+_reload_systemd_service() {
+ _is_running_systemd || return;
+ /usr/bin/systemctl --system daemon-reload 2>/dev/null
+ return 0;
+}
+
+# arg 1: the new package version
+pre_install() {
+ /bin/true
+}
+
+# arg 1: the new package version
+post_install() {
+ getent passwd ${_service_username} > /dev/null || /usr/sbin/useradd --user-group --home-dir "${_service_install_dir}" --shell "/bin/bash" ${_service_username} &> /dev/null
+ _set_dir_permissions
+ _enable_systemd_service
+ _start_systemd_service
+ echo " To initialize gerrit, see http://gerrit-documentation.googlecode.com/svn/Documentation/2.8/index.html"
+ echo " To setup gerrit do:"
+ echo " sudo su - gerrit"
+ echo " java -jar /usr/share/java/gerrit/gerrit.war init -d /var/lib/gerrit"
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+pre_upgrade() {
+ _stop_systemd_service
+ _disable_systemd_service
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ _set_dir_permissions
+ _enable_systemd_service
+ _reload_systemd_service
+ _start_systemd_service
+ echo " To update gerrit, see http://gerrit-documentation.googlecode.com/svn/ReleaseNotes/ReleaseNotes-2.8.html"
+ echo " To update gerrit do:"
+ echo " sudo su - gerrit"
+ echo " java -jar /usr/share/java/gerrit/gerrit.war init -d /var/lib/gerrit"
+}
+
+# arg 1: the old package version
+pre_remove() {
+ _stop_systemd_service
+ _disable_systemd_service
+ return 0;
+}
+
+# arg 1: the old package version
+post_remove() {
+ getent passwd ${_service_username} > /dev/null && /usr/sbin/userdel ${_service_username} &>/dev/null
+ for d in ${_service_cache_dir}; do
+ [ -n "${d}" -a -d "${d}" ] && rm -rf "${d}"
+ done
+ for d in ${_service_install_dir} ${_service_log_dir}; do
+ [ -n "${d}" -a -d "${d}" ] && echo ">>> directory ${d} needs to be removed manually"
+ done
+ return 0;
+}
+
diff --git a/gerrit.systemd b/gerrit.systemd
new file mode 100644
index 00000000000..c0992cc2829
--- /dev/null
+++ b/gerrit.systemd
@@ -0,0 +1,24 @@
+[Unit]
+Description=Web based code review and project management for Git based projects
+After=network.target
+
+[Service]
+Type=simple
+User=gerrit
+EnvironmentFile=/etc/default/gerritcodereview
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=gerrit
+ExecStart=@/usr/bin/java gerrit -DGerritCodeReview=1 $JAVA_OPTIONS -jar $GERRIT_WAR daemon -d $GERRIT_SITE --console-log
+#MemoryLimit=768M
+OOMScoreAdjust=-1000
+LimitCPU=infinity
+LimitFSIZE=infinity
+LimitDATA=infinity
+LimitCORE=0
+LimitAS=infinity
+LimitLOCKS=infinity
+
+[Install]
+WantedBy=multi-user.target
+