summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Christensen2021-02-13 17:05:09 +0100
committerLars Christensen2021-02-13 17:05:09 +0100
commite1c6b08ebc79c1fc967a6568b0cab381e8b50e41 (patch)
tree99cf8e96a253b31827981f4753f173c5ff1faaac
parent0eea2839699e9c9458ad996055a1825b16b9bb06 (diff)
downloadaur-e1c6b08ebc79c1fc967a6568b0cab381e8b50e41.tar.gz
Add .service files, default configuration, tmpfiles, sysusers
-rw-r--r--PKGBUILD39
-rw-r--r--datadir.patch24
-rw-r--r--owamp.install14
-rw-r--r--owamp.sysusers2
-rw-r--r--owamp.tmpfiles11
-rw-r--r--pidfile.patch26
6 files changed, 112 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 3804a73f126..1c5d4dcf1df 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,15 +2,32 @@
# Maintainer: Baptiste Jonglez <baptiste--aur at jonglez dot org>
pkgname=owamp
pkgver=4.3.3
-pkgrel=1
-pkgdesc="A tool for performing one-way or two-way active network measurements."
+pkgrel=2
+pkgdesc="A tool for performing one-way or two-way active network measurements"
arch=("x86_64")
url="http://software.internet2.edu/owamp/"
+install="owamp.install"
license=('Apache')
depends=("glibc" "libcap")
makedepends=("i2util")
-source=("https://github.com/perfsonar/${pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
-sha256sums=('18b396749647c849b99013b15b27c0cb0e57ce369556cbb19987dfae4090be6f')
+source=("https://github.com/perfsonar/${pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
+ "owamp.install"
+ "owamp.sysusers"
+ "owamp.tmpfiles"
+ "datadir.patch"
+ "pidfile.patch")
+sha256sums=('18b396749647c849b99013b15b27c0cb0e57ce369556cbb19987dfae4090be6f'
+ '708169332bd057747b566f77acf6c3cff7beac59ea0e0aa98901a8060d48f216'
+ '47ee8cf49956726db26c2386a6c81adc8d2f00ae68abfb2c7d36522a829bbffa'
+ '0df00db45d06f01e2f2938f36b54ee2f2a9c70e4b94ac819695c0bb9922810cb'
+ '9ea0c30873a0b631477f82619d4a31e609a40531cfb3894418682a1592d50817'
+ '07ba6e00bc7a727a12d2853c0bc43bde152c5b4048cc3d7b6770096067cdcf61')
+
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver"
+ patch -p2 <"$srcdir/datadir.patch"
+ patch -p2 <"$srcdir/pidfile.patch"
+}
build() {
cd "$srcdir/$pkgname-$pkgver"
@@ -23,6 +40,20 @@ build() {
package() {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR="$pkgdir/" install
+
+ install -Dm644 $srcdir/owamp.sysusers "$pkgdir/usr/lib/sysusers.d/owamp.conf"
+ install -Dm644 $srcdir/owamp.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/owamp.conf"
+
+ install -o root -g root -d "$pkgdir/usr/lib/systemd/system"
+ install -o root -g root -m 0644 conf/owampd.service "$pkgdir/usr/lib/systemd/system/owampd.service"
+ install -o root -g root -m 0644 conf/twampd.service "$pkgdir/usr/lib/systemd/system/twampd.service"
+
+ install -o root -g root -d "$pkgdir/etc/owamp-server"
+ install -o root -g root -m 0644 conf/owampd.conf "$pkgdir/etc/owamp-server/owamp-server.conf"
+ install -o root -g root -m 0644 conf/owampd.limits "$pkgdir/etc/owamp-server/owamp-server.limits"
+ install -o root -g root -d "$pkgdir/etc/twamp-server"
+ install -o root -g root -m 0644 conf/twampd.conf "$pkgdir/etc/twamp-server/twamp-server.conf"
+ install -o root -g root -m 0644 conf/twampd.limits "$pkgdir/etc/twamp-server/twamp-server.limits"
}
# vim:set ts=2 sw=2 et:
diff --git a/datadir.patch b/datadir.patch
new file mode 100644
index 00000000000..fa7b39c056d
--- /dev/null
+++ b/datadir.patch
@@ -0,0 +1,24 @@
+diff -r -u src.orig/owamp-4.3.3/conf/owampd.conf src/owamp-4.3.3/conf/owampd.conf
+--- src.orig/owamp-4.3.3/conf/owampd.conf 2021-02-02 17:37:00.000000000 +0100
++++ src/owamp-4.3.3/conf/owampd.conf 2021-02-13 15:54:06.628604068 +0100
+@@ -55,7 +55,7 @@
+ # The "catalog" subdirectory is completely cleaned and recreated each time
+ # owampd is restarted. DONT PUT ANYTHING IN THERE!
+ # (defaults to $cwd)
+-#datadir /big/enough
++datadir /var/lib/owamp
+
+ # authmode - uncomment to make only Open.
+ # (defaults to OAE)
+diff -r -u src.orig/owamp-4.3.3/conf/twampd.conf src/owamp-4.3.3/conf/twampd.conf
+--- src.orig/owamp-4.3.3/conf/twampd.conf 2021-02-02 17:37:00.000000000 +0100
++++ src/owamp-4.3.3/conf/twampd.conf 2021-02-13 15:54:23.318572974 +0100
+@@ -45,7 +45,7 @@
+ # The "catalog" subdirectory is completely cleaned and recreated each time
+ # twampd is restarted. DONT PUT ANYTHING IN THERE!
+ # (defaults to $cwd)
+-#datadir /big/enough
++datadir /var/lib/twamp
+
+ # authmode - uncomment to make only Open.
+ # (defaults to OAEM)
diff --git a/owamp.install b/owamp.install
new file mode 100644
index 00000000000..37ca2ba463f
--- /dev/null
+++ b/owamp.install
@@ -0,0 +1,14 @@
+#/bin/sh
+
+# arg 1: the new package version
+post_install() {
+ systemd-sysusers /usr/lib/sysusers.d/owamp.conf
+ systemd-tmpfiles --create /usr/lib/tmpfiles.d/owamp.conf
+ systemctl daemon-reload
+}
+
+post_upgrade() {
+ systemctl daemon-reload
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/owamp.sysusers b/owamp.sysusers
new file mode 100644
index 00000000000..c75e40ebb70
--- /dev/null
+++ b/owamp.sysusers
@@ -0,0 +1,2 @@
+u owamp - - /var/lib/owamp
+u twamp - - /var/lib/twamp
diff --git a/owamp.tmpfiles b/owamp.tmpfiles
new file mode 100644
index 00000000000..5eb06ce1eb6
--- /dev/null
+++ b/owamp.tmpfiles
@@ -0,0 +1,11 @@
+d /etc/owamp-server 0755 owamp owamp
+x /etc/owamp-server/*
+
+d /var/lib/owamp 0755 owamp owamp
+x /var/lib/owamp/*
+
+d /etc/twamp-server 0755 twamp twamp
+x /etc/twamp-server/*
+
+d /var/lib/twamp 0755 twamp twamp
+x /var/lib/twamp/*
diff --git a/pidfile.patch b/pidfile.patch
new file mode 100644
index 00000000000..3c05c783379
--- /dev/null
+++ b/pidfile.patch
@@ -0,0 +1,26 @@
+--- src.orig/owamp-4.3.3/conf/owampd.service 2021-02-02 17:37:00.000000000 +0100
++++ src/owamp-4.3.3/conf/owampd.service 2021-02-13 16:03:57.987260927 +0100
+@@ -4,8 +4,8 @@
+
+ [Service]
+ Type=forking
+-PIDFile=/var/run/owamp-server.pid
+-ExecStart=/usr/bin/owampd -c /etc/owamp-server -R /var/run
++PIDFile=/run/owamp-server.pid
++ExecStart=/usr/bin/owampd -c /etc/owamp-server -R /run
+ LimitNOFILE=4096
+
+ [Install]
+--- src.orig/owamp-4.3.3/conf/twampd.service 2021-02-02 17:37:00.000000000 +0100
++++ src/owamp-4.3.3/conf/twampd.service 2021-02-13 16:00:37.184389996 +0100
+@@ -4,8 +4,8 @@
+
+ [Service]
+ Type=forking
+-PIDFile=/var/run/twamp-server.pid
+-ExecStart=/usr/bin/twampd -c /etc/twamp-server -R /var/run
++PIDFile=/run/twamp-server.pid
++ExecStart=/usr/bin/twampd -c /etc/twamp-server -R /run
+ LimitNOFILE=4096
+
+ [Install]