aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lldpd
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2017-08-25 07:50:33 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2017-08-25 07:50:41 +0000
commit13a6f233405d5a40e64140b1fb1deb96071f9cc6 (patch)
tree5c00805d4564f9ec06de76d7eaebf4923e39b48d /testing/lldpd
parentc8f1eda1d4c58fe93cc08f1354344814cba98a91 (diff)
downloadaports-13a6f233405d5a40e64140b1fb1deb96071f9cc6.tar.bz2
aports-13a6f233405d5a40e64140b1fb1deb96071f9cc6.tar.xz
testing/lldpd: new aport
Diffstat (limited to 'testing/lldpd')
-rw-r--r--testing/lldpd/APKBUILD85
-rw-r--r--testing/lldpd/lldpd.confd5
-rw-r--r--testing/lldpd/lldpd.initd19
-rw-r--r--testing/lldpd/lldpd.post-install4
4 files changed, 113 insertions, 0 deletions
diff --git a/testing/lldpd/APKBUILD b/testing/lldpd/APKBUILD
new file mode 100644
index 0000000000..bad35af936
--- /dev/null
+++ b/testing/lldpd/APKBUILD
@@ -0,0 +1,85 @@
+# Contributor: Francesco Colista <fcolista@alpinelinux.org>
+# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
+pkgname=lldpd
+pkgver=0.9.8
+pkgrel=0
+pkgdesc="Implementation of IEEE 802.1ab (LLDP) "
+url="http://vincentbernat.github.com/lldpd/"
+arch="all"
+license="ISC"
+makedepends="autoconf automake libtool linux-headers bsd-compat-headers
+ libevent-dev libxml2-dev net-snmp-dev libbsd-dev jansson-dev
+ doxygen perl-dev readline-dev"
+install="$pkgname.post-install"
+subpackages="$pkgname-dev $pkgname-doc
+ $pkgname-bash-completion:bashcomp:noarch
+ $pkgname-zsh-completion:zshcomp:noarch"
+pkgusers="lldpd"
+pkggroups="lldpd"
+source="$pkgname-$pkgver.tar.gz::https://github.com/vincentbernat/$pkgname/archive/$pkgver.tar.gz
+ $pkgname.confd
+ $pkgname.initd"
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+ cd "$builddir"
+ ./autogen.sh
+ default_prepare
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --prefix=/usr \
+ --localstatedir=/var \
+ --sysconfdir=/etc \
+ --enable-static=no \
+ --enable-pie \
+ --enable-hardening \
+ --without-embedded-libevent \
+ --with-snmp \
+ --with-xml \
+ --with-privsep-user=$pkgusers \
+ --with-privsep-group=$pkggroups \
+ --with-privsep-chroot=/run/$pkgname \
+ --with-lldpd-ctl-socket=/run/$pkgname/$pkgname.socket \
+ --with-lldpd-pid-file=/run/$pkgname/$pkgname.pid
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ install -Dm644 /dev/null "$pkgdir/etc/lldpd.conf"
+ install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir/etc/conf.d/$pkgname"
+ install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir/etc/init.d/$pkgname"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ make DESTDIR="$pkgdir" install
+}
+
+bashcomp() {
+ pkgdesc="Bash completions for $pkgname"
+ install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+
+ mkdir -p "$subpkgdir"/usr/share/
+ mv "$pkgdir"/usr/share/bash-completion \
+ "$subpkgdir"/usr/share
+ rmdir -p "$pkgdir"/usr/share 2>/dev/null || true
+}
+
+zshcomp() {
+ pkgdesc="Zsh completion for $pkgname"
+ install_if="$pkgname=$pkgver-r$pkgrel zsh"
+
+ install -Dm644 "$builddir"/src/client/completion/_lldpcli \
+ "$subpkgdir"/usr/share/zsh/site-functions/_lldpcli
+}
+
+
+sha512sums="fb5ed83949fe1a3fc1f36dbb710975564286bb0f143c74e3a155e14c1258ae46867cc4738e42f8b892893a421d10c274012b37aad9f48fc2c9bdc45d7a37cf05 lldpd-0.9.8.tar.gz
+a2a4c85068a6b8b80c92fe56af7799a8b8cb2516e5a65b3ae4cb28f278e5acc72402da2a35f0c48a6048fd4a8536061142cafaa49a4bae8e52ca0a5d9ed38b4c lldpd.confd
+8d88e2a21efee6389d4de4f1ce2fcc9da8bd8ab3cb5a2bf2d322bde577e255662d027688065282146b389b3b8076fb883897e600fd931bcdc30d757fc7191e34 lldpd.initd"
diff --git a/testing/lldpd/lldpd.confd b/testing/lldpd/lldpd.confd
new file mode 100644
index 0000000000..f719a1381d
--- /dev/null
+++ b/testing/lldpd/lldpd.confd
@@ -0,0 +1,5 @@
+# /etc/conf.d/lldpd: config file for /etc/init.d/lldpd
+
+# see man page for lldpd or run `lldpd -h`
+# for valid cmdline options
+#LLDPD_OPTS=""
diff --git a/testing/lldpd/lldpd.initd b/testing/lldpd/lldpd.initd
new file mode 100644
index 0000000000..9cebc81cc0
--- /dev/null
+++ b/testing/lldpd/lldpd.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+name=lldpd
+pidfile=/run/lldpd/lldpd.pid
+command=/usr/sbin/lldpd
+retry="TERM/10/KILL/5"
+command_args="${LLDPD_OPTS}"
+start_stop_daemon_args="--wait 300"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ checkpath --directory /run/lldpd -o lldpd -m 0700
+}
+
diff --git a/testing/lldpd/lldpd.post-install b/testing/lldpd/lldpd.post-install
new file mode 100644
index 0000000000..06c2abb04e
--- /dev/null
+++ b/testing/lldpd/lldpd.post-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+addgroup -S lldpd 2>/dev/null
+adduser -S -D -h /run/lldpd -s /bin/false -G lldpd -g lldpd lldpd 2>/dev/null
+exit 0