summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD44
-rw-r--r--lrun.install14
3 files changed, 77 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c7a1e0ad4e19
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = lrun
+ pkgdesc = Run command on Linux with resources limited.
+ pkgver = 1.1.4
+ pkgrel = 1
+ url = https://github.com/quark-zju/lrun
+ install = lrun.install
+ arch = i686
+ arch = x86_64
+ license = MIT
+ makedepends = gcc>=4.4
+ makedepends = pkg-config
+ makedepends = ruby
+ depends = linux>=2.6.26
+ optdepends = libseccomp>=2.0
+ source = lrun-1.1.4.tar.gz::https://github.com/quark-zju/lrun/archive/v1.1.4.tar.gz
+ sha256sums = 5365af8fffa0eba0155ef0b6e9467a8c8aa26c5e1737b47d959396eb8b96deb8
+
+pkgname = lrun
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..97dc4edb4349
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Contributor: Jun Wu <quark@zju.edu.cn>
+
+set -u
+pkgname='lrun'
+pkgver='1.1.4'
+pkgrel='1'
+pkgdesc='Run command on Linux with resources limited.'
+url="https://github.com/quark-zju/${pkgname}"
+arch=('i686' 'x86_64')
+license=('MIT')
+depends=('linux>=2.6.26')
+optdepends=('libseccomp>=2.0')
+makedepends=('gcc>=4.4' 'pkg-config' 'ruby')
+_verwatch=("${url}/releases" "${url#*github.com}/archive/v\(.*\)\.tar\.gz" 'l')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/quark-zju/${pkgname}/archive/v${pkgver}.tar.gz")
+sha256sums=('5365af8fffa0eba0155ef0b6e9467a8c8aa26c5e1737b47d959396eb8b96deb8')
+install="${pkgname}.install"
+
+prepare() {
+ set -u
+ pkg-config --max-version 2.9 libseccomp || echo 'libseccomp 1.x or 2.x not found, syscall filter will not work'
+ set +u
+}
+
+build() {
+ set -u
+ cd "${pkgname}-${pkgver}/src/"
+ #rake
+ PREFIX="${pkgdir}/usr" rake
+ set +u
+}
+
+package() {
+ set -u
+ cd "${pkgname}-${pkgver}/src/"
+ install -Dpm4550 -oroot -g 593 -s 'lrun' -t "${pkgdir}/usr/bin/"
+
+ install -Dpm644 '../LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}/"
+ set +u
+}
+set +u
+
+# vim:set ts=2 sw=2 et:
diff --git a/lrun.install b/lrun.install
new file mode 100644
index 000000000000..55c6a58c1c57
--- /dev/null
+++ b/lrun.install
@@ -0,0 +1,14 @@
+post_upgrade() {
+ /usr/bin/getent group 'lrun' >/dev/null 2>&1 || usr/bin/groupadd -g '593' 'lrun' &>/dev/null
+}
+
+post_install() {
+ post_upgrade
+ echo 'NOTE: To run lrun as normal user you have to add yourself into lrun group'
+}
+
+post_remove() {
+ if /usr/bin/getent group 'lrun' >/dev/null 2>&1; then
+ /usr/bin/groupdel 'lrun'
+ fi
+}