summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hesse2015-06-30 14:09:51 +0200
committerChristian Hesse2015-06-30 14:09:51 +0200
commit1b0c2ca49f5c345ebc680ad5f150bed50467af15 (patch)
tree6da4bbb738399e7c1f4e4fb976fee7e771100a1d
downloadaur-1b0c2ca49f5c345ebc680ad5f150bed50467af15.tar.gz
initial import of ladvd 1.1.0-1
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD43
-rw-r--r--ladvd.conf1
-rw-r--r--ladvd.install21
-rw-r--r--ladvd.service13
5 files changed, 96 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9011caface66
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = ladvd
+ pkgdesc = LLDP daemon for Unix
+ pkgver = 1.1.0
+ pkgrel = 1
+ url = http://ladvd.googlecode.com/
+ install = ladvd.install
+ arch = i686
+ arch = x86_64
+ license = BSD
+ depends = pciutils
+ depends = libcap-ng
+ depends = libpcap
+ depends = libevent
+ source = ladvd-1.1.0.tar.gz::https://github.com/sspans/ladvd/archive/v1.1.0.tar.gz
+ sha256sums = 6db4b3270d90469e7081695f62ed13b88ac15bd41b8467c81eec5d035742ae57
+
+pkgname = ladvd
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..0f0fac24d8f8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Christian Hesse <mail@eworm.de>
+# Contributor: sh0 <mee@sh0.org>
+
+pkgname=ladvd
+pkgver=1.1.0
+pkgrel=1
+pkgdesc='LLDP daemon for Unix'
+arch=('i686' 'x86_64')
+url='http://ladvd.googlecode.com/'
+license=('BSD')
+install='ladvd.install'
+depends=('pciutils' 'libcap-ng' 'libpcap' 'libevent')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/sspans/ladvd/archive/v1.1.0.tar.gz")
+sha256sums=('6db4b3270d90469e7081695f62ed13b88ac15bd41b8467c81eec5d035742ae57')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ sed -i 's/-Werror//' configure.ac
+
+ autoreconf -fi
+ ./configure --prefix=/usr \
+ --sbindir=/usr/bin \
+ --mandir=/usr/share/man \
+ --with-user=ladvd \
+ --with-pid-dir=/run \
+ --with-chroot-dir=/var/run/ladvd
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}/" install
+
+ install -D -m0644 doc/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ rm -f "${pkgdir}/usr/share/doc/${pkgname}/LICENSE"
+
+ install -D -m0644 "systemd/ladvd.conf" "${pkgdir}/usr/lib/tmpfiles.d/ladvd.conf"
+
+ install -d -m0755 "${pkgdir}/run/ladvd"
+}
+
diff --git a/ladvd.conf b/ladvd.conf
new file mode 100644
index 000000000000..b10a488ac5d4
--- /dev/null
+++ b/ladvd.conf
@@ -0,0 +1 @@
+d /run/ladvd 0755 root root
diff --git a/ladvd.install b/ladvd.install
new file mode 100644
index 000000000000..33d09038450c
--- /dev/null
+++ b/ladvd.install
@@ -0,0 +1,21 @@
+post_update() {
+ if getent group ladvd &>/dev/null; then
+ usermod -R ladvd ladvd >/dev/null
+ groupdel ladvd >/dev/null
+ fi
+}
+
+post_install() {
+ if ! getent passwd ladvd &>/dev/null; then
+ useradd -r -u 142 -d /run/ladvd -s /bin/false ladvd >/dev/null
+ fi
+}
+
+post_remove() {
+ if getent passwd ladvd &>/dev/null; then
+ userdel ladvd >/dev/null
+ fi
+ if getent group ladvd &>/dev/null; then
+ groupdel ladvd >/dev/null
+ fi
+}
diff --git a/ladvd.service b/ladvd.service
new file mode 100644
index 000000000000..c40c23ff49c5
--- /dev/null
+++ b/ladvd.service
@@ -0,0 +1,13 @@
+# To modify this unit, copy it to /etc/systemd/system and edit there
+# This way a list of interfaces which ladvd should utilize can be supplied.
+
+[Unit]
+Description=uses CDP / LLDP frames to inform switches about connected hosts
+Documentation=man:ladvd(8) man:ladvdc(8)
+Requires=network.target
+
+[Service]
+ExecStart=/usr/sbin/ladvd -f -a -z
+
+[Install]
+WantedBy=multi-user.target