summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJianqiu Zhang2018-08-11 10:04:47 +0800
committerJianqiu Zhang2018-08-11 10:13:46 +0800
commit0980302979182c673641b9f7ac80f3ade10ed6fe (patch)
treee1a96dd689481c840c51bd0bfec0683c3a8d479e
downloadaur-0980302979182c673641b9f7ac80f3ade10ed6fe.tar.gz
package for oomd-git
Signed-off-by: Jianqiu Zhang <zhangjianqiu13@gmail.com>
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD38
-rw-r--r--fix-meson-no-install.patch35
3 files changed, 92 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..920d1e014a2
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = oomd-git
+ pkgdesc = A userspace out-of-memory killer
+ pkgver = 20180811
+ pkgrel = 1
+ url = https://github.com/facebookincubator/oomd
+ arch = x86_64
+ license = GPL2
+ makedepends = meson
+ makedepends = ninja
+ makedepends = git
+ makedepends = jsoncpp
+ depends = jsoncpp
+ source = oomd::git+https://github.com/facebookincubator/oomd.git
+ source = fix-meson-no-install.patch
+ md5sums = SKIP
+ md5sums = 9b65f349870dd3e9052da6e94212bd4e
+
+pkgname = oomd-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..ecb6def8b8e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Jianqiu Zhang <void001@archlinuxcn.org>
+
+
+pkgname=oomd-git
+pkgver=20180811
+pkgrel=1
+pkgdesc='A userspace out-of-memory killer'
+arch=('x86_64')
+url="https://github.com/facebookincubator/oomd"
+license=('GPL2')
+depends=('jsoncpp')
+makedepends=('meson' 'ninja' 'git' 'jsoncpp')
+md5sums=('SKIP'
+ '9b65f349870dd3e9052da6e94212bd4e')
+
+source=(
+ "oomd::git+https://github.com/facebookincubator/oomd.git"
+ "fix-meson-no-install.patch"
+)
+
+
+prepare() {
+ echo "Fix the install patch error"
+ cp fix-meson-no-install.patch $srcdir/oomd/
+ cd $srcdir/oomd/
+ patch -p1 < fix-meson-no-install.patch
+}
+
+build() {
+ cd $srcdir/oomd
+ meson --prefix "$pkgdir/usr" build && ninja -C build
+}
+
+package() {
+ cd $srcdir/oomd
+ ninja -C build install
+ install -Dm644 $srcdir/oomd/example/oomd.json $pkgdir/etc/oomd.json.example
+}
diff --git a/fix-meson-no-install.patch b/fix-meson-no-install.patch
new file mode 100644
index 00000000000..2e67682b4e6
--- /dev/null
+++ b/fix-meson-no-install.patch
@@ -0,0 +1,35 @@
+diff --git a/example/oomd.json b/example/oomd.json
+index 664aed5..859f4ba 100644
+--- a/example/oomd.json
++++ b/example/oomd.json
+@@ -7,7 +7,7 @@
+ {"sshd.service": { "max_usage": "inf" } }
+ ],
+ "oomdetector": "default",
+- "oomkiller": "fbje"
++ "oomkiller": "default"
+ },
+ {
+ "target": "workload.slice",
+diff --git a/meson.build b/meson.build
+index f12f067..2842453 100644
+--- a/meson.build
++++ b/meson.build
+@@ -39,14 +39,16 @@ srcs = files('''
+
+ deps = [dependency('jsoncpp'),
+ dependency('threads')]
+-oomd_lib = library('oomd',
++oomd_lib = shared_library('oomd',
+ srcs,
+ include_directories : inc,
++ install: true,
+ dependencies : deps)
+ executable('oomd_bin',
+ files('Main.cpp'),
+ include_directories : inc,
+ dependencies : deps,
++ install: true,
+ link_with : oomd_lib)
+
+ gtest_dep = dependency('gtest', main : true, required : false)