summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Giniewicz2015-07-07 21:33:23 +0200
committerAndrzej Giniewicz2015-07-07 21:33:23 +0200
commite4edee30940af0f9d95442adf1fa027b5fbbb983 (patch)
tree1c9e2421370380cf497dab08ddaeebf19f6b45e5
downloadaur-e4edee30940af0f9d95442adf1fa027b5fbbb983.tar.gz
Initial import
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD41
-rw-r--r--domjudge-judgehostd.service14
-rw-r--r--domjudge-submitd.service13
-rw-r--r--domjudge.install58
-rw-r--r--genpass.patch11
6 files changed, 169 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..47f0128b2fe
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = domjudge
+ pkgdesc = programming contest jury system
+ pkgver = 3.4.2
+ pkgrel = 1
+ url = http://domjudge.sourceforge.net/
+ install = domjudge.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ license = LGPL
+ license = MIT
+ license = BSD
+ makedepends = boost
+ makedepends = sharutils
+ depends = sudo
+ depends = apache
+ depends = php
+ depends = php-apache
+ depends = mysql
+ depends = curl
+ depends = libxslt
+ source = http://www.domjudge.org/releases/domjudge-3.4.2.tar.gz
+ source = domjudge-submitd.service
+ source = domjudge-judgehostd.service
+ source = genpass.patch
+ md5sums = 0685323b0067280d9ad6b51396a7d7ec
+ md5sums = 669e8f1b19875fae04cb0d6077d4fba2
+ md5sums = 93cd5b10fc2636b664f2c17b4f34436f
+ md5sums = b5367f9669746ec3804aa4da9ae988ba
+
+pkgname = domjudge
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..65ef769c9fc
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,41 @@
+# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>
+
+pkgname=domjudge
+pkgver=3.4.2
+pkgrel=1
+pkgdesc="programming contest jury system"
+arch=('i686' 'x86_64')
+url="http://domjudge.sourceforge.net/"
+license=('GPL' 'LGPL' 'MIT' 'BSD')
+depends=('sudo' 'apache' 'php' 'php-apache' 'mysql' 'curl' 'libxslt')
+makedepends=('boost' 'sharutils')
+install='domjudge.install'
+
+source=(http://www.domjudge.org/releases/domjudge-$pkgver.tar.gz
+ domjudge-submitd.service domjudge-judgehostd.service genpass.patch)
+md5sums=('0685323b0067280d9ad6b51396a7d7ec'
+ '669e8f1b19875fae04cb0d6077d4fba2'
+ '93cd5b10fc2636b664f2c17b4f34436f'
+ 'b5367f9669746ec3804aa4da9ae988ba')
+
+build() {
+ cd "$srcdir"/domjudge-$pkgver
+ patch -p0 < ../genpass.patch
+ ./configure --enable-fhs --prefix=/usr \
+ --sysconfdir=/etc --localstatedir=/var \
+ --enable-submitclient=http,dolstra \
+ --with-domjudge-user=root --with-webserver-group=http
+ make domserver judgehost
+}
+
+package() {
+ cd "$srcdir"/domjudge-$pkgver
+ make install-domserver install-judgehost DESTDIR="$pkgdir"/
+ rm -rf "$pkgdir"/tmp
+ install -D -m 750 "$pkgdir"/etc/domjudge/sudoers-domjudge "$pkgdir"/etc/sudoers.d/domjudge
+ sed -s "s/^root/domjudge/g" -i "$pkgdir"/etc/sudoers.d/domjudge
+ rm "$pkgdir"/etc/domjudge/{htpasswd-jury,sudoers-domjudge,dbpasswords.secret}
+ install -D "$srcdir"/domjudge-submitd.service "$pkgdir"/etc/systemd/system/domjudge-submitd.service
+ install -D "$srcdir"/domjudge-judgehostd.service "$pkgdir"/etc/systemd/system/domjudge-judgehostd.service
+}
+
diff --git a/domjudge-judgehostd.service b/domjudge-judgehostd.service
new file mode 100644
index 00000000000..db08f6cfbe6
--- /dev/null
+++ b/domjudge-judgehostd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Domjudge judgehost daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/judgedaemon
+Restart=on-failure
+User=domjudge
+KillSignal=SIGINT
+SendSIGKILL=no
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/domjudge-submitd.service b/domjudge-submitd.service
new file mode 100644
index 00000000000..b73969dbae1
--- /dev/null
+++ b/domjudge-submitd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Domjudge submit daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/submitdaemon
+Restart=on-failure
+KillSignal=SIGINT
+SendSIGKILL=no
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/domjudge.install b/domjudge.install
new file mode 100644
index 00000000000..a8bff8e7e67
--- /dev/null
+++ b/domjudge.install
@@ -0,0 +1,58 @@
+post_install() {
+ if ! getent group domjudge >/dev/null; then
+ groupadd --system domjudge
+ fi
+ if ! getent passwd domjudge >/dev/null; then
+ useradd --system -c 'judgehost daemon user' -g domjudge -s /bin/false domjudge
+ fi
+ if ! getent passwd domjudge-run >/dev/null; then
+ useradd -d /fail -c 'judgehost run user' -g nobody -s /bin/false domjudge-run
+ fi
+
+ if [ ! -f /etc/domjudge/dbpasswords.secret ];
+ then
+ /etc/domjudge/gendbpasswords > /etc/domjudge/dbpasswords.secret
+ fi
+ if [ ! -f /etc/domjudge/htpasswd-jury ];
+ then
+ htpasswd -b -c /etc/domjudge/htpasswd-jury domjudge_jury `grep '^dummy:' /etc/domjudge/dbpasswords.secret | cut -d : -f 5`
+ fi
+
+ chown domjudge /var/lib/domjudge/judgings
+ chmod 0711 /var/lib/domjudge/judgings
+
+ chown domjudge /var/{log,run}/domjudge
+ chmod 0700 /var/{log,run}/domjudge
+
+ chown domjudge:http /var/lib/domjudge/submissions
+ chmod 0770 /var/lib/domjudge/submissions
+
+ chown domjudge:http /etc/domjudge/{dbpasswords.secret,htpasswd-jury}
+ chmod 0640 /etc/domjudge/{dbpasswords.secret,htpasswd-jury}
+
+ chown domjudge /etc/domjudge/{domserver-config.php,judgehost-config.php,common-config.php}
+
+ echo "To finish installation procedure, run:"
+ echo " dj-setup-database -u root -r install"
+ echo "and add"
+ echo " :/etc/domjudge:/usr/lib/domjudge:/usr/share/domjudge:/var/lib/domjudge"
+ echo "into open_basedir in /etc/php/php.ini"
+}
+
+post_upgrade() {
+ echo "To finish update procedure, run:"
+ echo " dj-setup-database -u root -r upgrade"
+}
+
+post_remove() {
+ if getent passwd domjudge >/dev/null; then
+ userdel domjudge
+ fi
+ if getent passwd domjudge-run >/dev/null; then
+ userdel domjudge-run
+ fi
+ if getent group domjudge-run >/dev/null; then
+ groupdel domjudge-run
+ fi
+}
+
diff --git a/genpass.patch b/genpass.patch
new file mode 100644
index 00000000000..cac2e718e88
--- /dev/null
+++ b/genpass.patch
@@ -0,0 +1,11 @@
+--- etc/gendbpasswordsorig 2014-02-14 19:41:50.000000000 +0100
++++ etc/gendbpasswords 2014-02-14 19:42:16.000000000 +0100
+@@ -6,8 +6,6 @@
+ # Exit on any error:
+ set -e
+
+-echo "# Format: 'dummy:<db_host>:<db_name>:<user>:<password>'"
+-
+ printf "dummy:localhost:domjudge:domjudge:"
+ head -c12 /dev/urandom | base64 | head -c16 | tr '/+' 'Aa'
+ echo