aboutsummaryrefslogtreecommitdiffstats
path: root/community/lldpd/APKBUILD
blob: 7814cc67492c20009f4d9cb9577fb3ac04ae9cc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lldpd
pkgver=1.0.18
pkgrel=0
pkgdesc="Implementation of IEEE 802.1ab"
url="https://lldpd.github.io/"
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-openrc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	"
pkgusers="lldpd"
pkggroups="lldpd"
source="$pkgname-$pkgver.tar.gz::https://github.com/vincentbernat/lldpd/archive/$pkgver.tar.gz
	$pkgname.confd
	$pkgname.initd"

# secfixes:
#   1.0.13-r0:
#     - CVE-2021-43612
#   1.0.8-r0:
#     - CVE-2020-27827

prepare() {
	# this should be shipped with the release tarball
	echo $pkgver > .dist-version
	./autogen.sh
	default_prepare
}

build() {
	./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() {
	make check
}

package() {
	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
}

sha512sums="
d468479796a01c5bc6da78b3dfe9d062d7c84de4176647909b9b0e72b7da10d628f4fc934ebf78026f5103bce2d0c21e325612bc5f2110c57860fb609822ca37  lldpd-1.0.18.tar.gz
a2a4c85068a6b8b80c92fe56af7799a8b8cb2516e5a65b3ae4cb28f278e5acc72402da2a35f0c48a6048fd4a8536061142cafaa49a4bae8e52ca0a5d9ed38b4c  lldpd.confd
8d88e2a21efee6389d4de4f1ce2fcc9da8bd8ab3cb5a2bf2d322bde577e255662d027688065282146b389b3b8076fb883897e600fd931bcdc30d757fc7191e34  lldpd.initd
"