# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=lldpd pkgver=1.0.3 pkgrel=1 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 fix-ppc64le-pathmax.patch $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="b2b69bb4447552bbf35364eb19cb7e01ea81a49913678b50ca56b7e331eb9fb0007049f0b7d01f910a9d6be433deac1ae3e2fffc97d69b1a4bc2176ebdb38b41 lldpd-1.0.3.tar.gz a3a3972ce4cfa98d0de9d958adf18eebb19a442023b321477b3bb8ff3f8297a8708d5c8d70dae06165aac9369d09492d57ffa62e1527968d0c778a7f6fd9678b fix-ppc64le-pathmax.patch a2a4c85068a6b8b80c92fe56af7799a8b8cb2516e5a65b3ae4cb28f278e5acc72402da2a35f0c48a6048fd4a8536061142cafaa49a4bae8e52ca0a5d9ed38b4c lldpd.confd 8d88e2a21efee6389d4de4f1ce2fcc9da8bd8ab3cb5a2bf2d322bde577e255662d027688065282146b389b3b8076fb883897e600fd931bcdc30d757fc7191e34 lldpd.initd"