summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormrxx2018-11-04 03:08:02 +0100
committermrxx2018-11-04 03:08:02 +0100
commitc2374abf440e86694171a804eb942fdcb903d2ad (patch)
tree4a5cf926e79ed037b580df458f5905af3fe7cba3
parentabc827a1d8b38dc2331b55cbfe28e74c1534f4ad (diff)
downloadaur-rwhoisd.tar.gz
Add a systemd service and a default configuration
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD52
-rw-r--r--rwhoisd.install12
-rw-r--r--rwhoisd.service13
4 files changed, 76 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index dd86931b229..56ba7b1fd40 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,18 @@
pkgbase = rwhoisd
pkgdesc = RWhois (Referral Whois) is a Directory Services protocol which extends and enhances the Whois concept in a hierarchical and scalable fashion.
pkgver = 1.5.9.6
- pkgrel = 2
+ pkgrel = 3
url = http://projects.arin.net/rwhois/
+ install = rwhoisd.install
arch = x86_64
arch = i686
- license = GPLv2
- source = http://projects.arin.net/rwhois/ftp/rwhoisd-1.5.9.6.tar.gz
- sha256sums = 66793f02bc9370914ca3f579409e8f79b6a394b8a981168ead7b1a6654a83a2a
+ license = GPL2
+ source = https://github.com/arineng/rwhoisd/archive/1.5.9.6.tar.gz
+ source = rwhoisd.service
+ source = rwhoisd.install
+ sha256sums = c1768d2414bca88f10acc2e50a23288a21176416ddfe697ee4326636c0b062f7
+ sha256sums = 7ec1372710e51291d3946fcc637e22a885da75dbcd54274ea2681474e91893bf
+ sha256sums = 5b58420875108a78fef4c47b7463b4a20bb6d443fda5c31ab89e75f87bc65b01
pkgname = rwhoisd
diff --git a/PKGBUILD b/PKGBUILD
index 4a48aec87e0..76202655602 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,61 @@
-# Maintainer: Tianyu Liu <lty1993[at]lty[dot]me>
+# Maintainer: mrxx <mrxx at cyberhome dot at>
+# Contributor: Tianyu Liu <lty1993[at]lty[dot]me>
+
pkgname=rwhoisd
pkgver=1.5.9.6
-pkgrel=2
+pkgrel=3
pkgdesc="RWhois (Referral Whois) is a Directory Services protocol which extends and enhances the Whois concept in a hierarchical and scalable fashion."
url="http://projects.arin.net/rwhois/"
arch=('x86_64' 'i686')
-license=('GPLv2')
+license=('GPL2')
depends=()
optdepends=()
makedepends=()
conflicts=()
-replaces=()
-backup=()
-source=("http://projects.arin.net/rwhois/ftp/${pkgname}-${pkgver}.tar.gz")
-sha256sums=('66793f02bc9370914ca3f579409e8f79b6a394b8a981168ead7b1a6654a83a2a')
+install=rwhoisd.install
+source=("https://github.com/arineng/rwhoisd/archive/${pkgver}.tar.gz" 'rwhoisd.service' 'rwhoisd.install')
+sha256sums=('c1768d2414bca88f10acc2e50a23288a21176416ddfe697ee4326636c0b062f7'
+ '7ec1372710e51291d3946fcc637e22a885da75dbcd54274ea2681474e91893bf'
+ '5b58420875108a78fef4c47b7463b4a20bb6d443fda5c31ab89e75f87bc65b01')
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
- ./configure --prefix=/opt/rwhoisd
+ cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}"
+ sed -i 's/\/usr\/local\/bin\/rwhois/\/usr\/bin\/rwhois/' common/conf.h
+
+ ./configure --prefix=/usr --sysconfdir=/var/lib --sbindir=/usr/bin
make
}
package() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}"
make DESTDIR="${pkgdir}" install
+ install -Dm644 tools/scripts/rwhois.pl ${pkgdir}/usr/bin/rwhois
+ mv ${pkgdir}/var/lib/${pkgname}/samples/* ${pkgdir}/var/lib/${pkgname}/
+ rmdir ${pkgdir}/var/lib/${pkgname}/samples
+
+ install -d ${pkgdir}/etc/${pkgname}
+ mv "${pkgdir}/var/lib/${pkgname}/${pkgname}.conf" "${pkgdir}/etc/${pkgname}/"
+
+ patch -p0 ${pkgdir}/etc/${pkgname}/${pkgname}.conf <<EOF
+15c15
+< root-dir: /var/lib/rwhoisd/samples
+---
+> root-dir: /var/lib/rwhoisd
+141c141
+< # default-log-file: rwhoisd.log
+---
+> default-log-file: /var/log/rwhoisd/rwhoisd.log
+EOF
+
+ install -d ${pkgdir}/usr/share/doc/${pkgname}/
+ install -Dm644 doc/* INSTALL ${pkgdir}/usr/share/doc/${pkgname}/
+ install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+
+ install -Dm644 ${srcdir}/${pkgname}.service "${pkgdir}"/usr/lib/systemd/system/${pkgname}.service
+
+ install -d ${pkgdir}/usr/share/man/man8
+ gzip -c "${pkgdir}/usr/share/doc/${pkgname}/rwhoisd.8" >"${pkgdir}/usr/share/man/man8/rwhoisd.8.gz"
+ gzip -c "${pkgdir}/usr/share/doc/${pkgname}/rwhois_indexer.8" >"${pkgdir}/usr/share/man/man8/rwhois_indexer.8.gz"
}
# vim:set ts=2 sw=2 et:
diff --git a/rwhoisd.install b/rwhoisd.install
new file mode 100644
index 00000000000..72e579a2938
--- /dev/null
+++ b/rwhoisd.install
@@ -0,0 +1,12 @@
+post_install() {
+ echo "Adding unprivileged system user and group..."
+ useradd -r rwhoisd -c "RWhois Daemon" -d /var/lib/rwhoisd -s /usr/bin/nologin
+ mkdir -p -m 750 /var/log/rwhoisd /var/lib/rwhoisd
+ chown rwhoisd.rwhoisd /var/log/rwhoisd /var/lib/rwhoisd
+}
+
+post_remove() {
+ echo "Removing unprivileged system user and group..."
+ userdel -r rwhoisd &>/dev/null
+}
+
diff --git a/rwhoisd.service b/rwhoisd.service
new file mode 100644
index 00000000000..c67a962d72f
--- /dev/null
+++ b/rwhoisd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=RWhois Daemon
+Documentation=man:rwhoisd(8)
+Documentation=https://github.com/arineng/rwhoisd/blob/master/rwhoisd/INSTALL
+After=syslog.target network.target
+
+[Service]
+PIDFile=/var/lib/rwhoisd/rwhoisd.pid
+ExecStart=/usr/bin/rwhoisd -c /etc/rwhoisd/rwhoisd.conf
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target