summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Smith2015-06-02 11:30:21 +1000
committerPhillip Smith2015-06-02 11:30:21 +1000
commit795cd57225971a37e63842a8e12774097090ec69 (patch)
tree0a84b5203ac7861ea72abec5c820628a4132bfeb
downloadaur-795cd57225971a37e63842a8e12774097090ec69.tar.gz
initial commit
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD62
-rw-r--r--nsca.install22
-rw-r--r--nsca.service10
5 files changed, 120 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..cc165031d1ca
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = nsca
+ pkgdesc = Integrate passive alerts and checks from remote machines and applications with Nagios. Useful for processing security alerts, as well as redundant and distributed Nagios setups.
+ pkgver = 2.9.1
+ pkgrel = 1
+ url = http://www.nagios.org/
+ install = nsca.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = openssl
+ depends = libmcrypt
+ replaces = nagios-nsca
+ options = !libtool
+ backup = etc/nsca/nsca.cfg
+ backup = etc/nsca/send_nsca.cfg
+ source = http://downloads.sourceforge.net/nagios/nsca-2.9.1.tar.gz
+ source = nsca.service
+ md5sums = 3fe2576a8cc5b252110a93f4c8d978c6
+ md5sums = 6f11d8d79c5f1b4d65b82e46ef26f554
+
+pkgname = nsca
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..86290598b0fd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/nsca-*.pkg.tar.xz
+/nsca-*.tar.gz
+/pkg/
+/src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e00d18822517
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Phillip Smith <fukawi2@NO-SPAM.gmail.com>
+# http://github.com/fukawi2/aur-packages
+
+### I AM ONLY THE PACKAGER, NOT THE DEVELOPER
+### Please ask support questions about this software in one of:
+### 1) The AUR comments; OR
+### 2) Upstream forums/maillist etc; OR
+### 3) The ArchLinux forums
+### I do not always know enough about the software itself, or don't have the
+### time to promptly respond to direct emails.
+### If you have found a problem with the package/PKGBUILD (as opposed to
+### the software) then please do email me or post an AUR comment.
+
+pkgname=nsca
+pkgver=2.9.1
+pkgrel=1
+pkgdesc="Integrate passive alerts and checks from remote machines and applications with Nagios. Useful for processing security alerts, as well as redundant and distributed Nagios setups."
+arch=('i686' 'x86_64')
+replaces=('nagios-nsca')
+license=('GPL')
+depends=('openssl' 'libmcrypt')
+options=(!libtool)
+install="$pkgname.install"
+backup=('etc/nsca/nsca.cfg' 'etc/nsca/send_nsca.cfg')
+url="http://www.nagios.org/"
+source=("http://downloads.sourceforge.net/nagios/nsca-$pkgver.tar.gz"
+ 'nsca.service')
+md5sums=('3fe2576a8cc5b252110a93f4c8d978c6'
+ '6f11d8d79c5f1b4d65b82e46ef26f554')
+
+build() {
+ cd "$srcdir"/nsca-$pkgver
+
+ # on my system at least, the values set by makepkg.conf for these 2 env vars
+ # causes the build to fail. unset them and let the configure script figure
+ # out how it would like them.
+ unset CFLAGS LDFLAGS
+
+ ./configure \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc/nsca \
+ --with-nsca-user=nsca \
+ --with-nsca-grp=nsca
+
+ # make will fail with parallel jobs, so need to use -j1
+ make all
+}
+
+package() {
+ cd "$srcdir"/nsca-$pkgver
+
+ install -D -m640 sample-config/nsca.cfg "$pkgdir"/etc/nsca/nsca.cfg
+ install -D -m640 sample-config/send_nsca.cfg "$pkgdir"/etc/nsca/send_nsca.cfg
+ install -D -m755 src/nsca "$pkgdir"/usr/bin/nsca
+ install -D -m755 src/send_nsca "$pkgdir"/usr/bin/send_nsca
+
+ # install systemd unit file
+ install -D -m755 "$srcdir"/nsca.service "$pkgdir"/usr/lib/systemd/system/nsca.service
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/nsca.install b/nsca.install
new file mode 100644
index 000000000000..02533b57972a
--- /dev/null
+++ b/nsca.install
@@ -0,0 +1,22 @@
+post_install() {
+ if [ -z "$(getent group nsca)" ]; then
+ groupadd -g 32 nsca
+ fi
+ if [ -z "$(getent passwd nsca)" ]; then
+ useradd -u 32 -g nsca -c "Nagios NSCA" -d /dev/null -s /bin/false nsca
+ fi
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ userdel nsca &> /dev/null
+ groupdel nsca &> /dev/null
+}
+
+op=$1
+shift
+
+$op $*
diff --git a/nsca.service b/nsca.service
new file mode 100644
index 000000000000..2e92a264ac2e
--- /dev/null
+++ b/nsca.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Daemon to accept passive Nagios data from remote hosts
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/nsca -c /etc/nsca/nsca.cfg --daemon
+
+[Install]
+WantedBy=multi-user.target