summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcr/memlockd/PKGBUILD28
-rw-r--r--pcr/memlockd/memlockd.install22
2 files changed, 50 insertions, 0 deletions
diff --git a/pcr/memlockd/PKGBUILD b/pcr/memlockd/PKGBUILD
new file mode 100644
index 000000000..a24d1b597
--- /dev/null
+++ b/pcr/memlockd/PKGBUILD
@@ -0,0 +1,28 @@
+# Contributor: fauno <fauno@parabola.nu>
+pkgname=memlockd
+pkgver=1.1.1
+pkgrel=1
+pkgdesc="daemon that locks files into memory"
+arch=('i686' 'x86_64')
+url="http://doc.coker.com.au/projects/memlockd/"
+license=('GPL3')
+depends=('glibc')
+# main site doesn't announce 1.1.1
+source=(http://ftp.de.debian.org/debian/pool/main/${pkgname:0:1}/${pkgname}/${pkgname}_${pkgver}.tar.gz)
+install=${pkgname}.install
+backup=(etc/memlockd.cfg)
+md5sums=('5e7a895b032eaa55f8cf15104e43364d')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ install -d -m 750 "${pkgdir}/usr/lib/memlockd" "${pkgdir}/etc/memlockd.d"
+ install -D -m 644 memlockd.8 "${pkgdir}/usr/share/man/man8/memlockd.8"
+ install -D -m 755 memlockd "${pkgdir}/usr/bin/memlockd"
+ install -D -m 640 memlockd.cfg "${pkgdir}/etc/memlockd.cfg"
+ install -D -m 644 memlockd.service "${pkgdir}/usr/lib/systemd/system/memlockd.service"
+}
diff --git a/pcr/memlockd/memlockd.install b/pcr/memlockd/memlockd.install
new file mode 100644
index 000000000..a744f441a
--- /dev/null
+++ b/pcr/memlockd/memlockd.install
@@ -0,0 +1,22 @@
+#!/bin/sh
+# arg 1: the new package version
+post_install() {
+ getent group memlockd >/dev/null ||
+ groupadd --system memlockd
+
+ getent passwd memlockd >/dev/null ||
+ useradd --system \
+ --gid memlockd \
+ --shell /bin/false \
+ --no-create-home \
+ --home /usr/lib/memlockd \
+ memlockd
+
+ chown memlockd:memlockd /usr/lib/memlockd /etc/memlockd.d
+}
+
+# arg 1: the old package version
+pre_remove() {
+ userdel memlockd &>/dev/null
+ groupdel memlockd &>/dev/null
+}