# there are tests but they don't run in mock # as they require the ability to create and act # inside a network namespace %bcond_with tests %global gh_owner vincentbernat Name: lldpd Version: 0.9.7 Release: 3%{?dist} Summary: ISC-licensed implementation of LLDP License: ISC URL: https://%{gh_owner}.github.io/%{name}/ Source0: https://media.luffy.cx/files/lldpd/lldpd-%{version}.tar.gz Source1: %{name}-fedora.service Source2: %{name}-tmpfiles Source3: %{name}-fedora.sysconfig BuildRequires: libevent-devel BuildRequires: readline-devel BuildRequires: check-devel BuildRequires: net-snmp-devel BuildRequires: libxml2-devel # For systemd stuff BuildRequires: systemd %{?systemd_requires} Requires(pre): shadow-utils %description LLDP is an industry standard protocol designed to supplant proprietary Link-Layer protocols such as EDP or CDP. The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver Link-Layer notifications to adjacent network devices. %package devel Requires: %{name}%{?_isa} = %{version}-%{release} Summary: %{summary} %description devel %{name} development libraries and headers %prep %autosetup %build %configure --disable-static --with-snmp --disable-silent-rules \ --with-systemdsystemunitdir=%{_unitdir} --with-sysusersdir=no \ --with-privsep-user=%{name} --with-privsep-group=%{name} \ --with-privsep-chroot=/run/%{name}/chroot \ --with-lldpd-ctl-socket=/run/%{name}/%{name}.socket make %{?_smp_mflags} %install %make_install install -p -D -m644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install -p -D -m644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf install -p -D -m644 %{SOURCE3} %{buildroot}/etc/sysconfig/%{name} install -d -D -m 0755 %{buildroot}/run/%{name}/chroot install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} # remove the docs from buildroot rm -rf %{buildroot}/usr/share/doc/%{name} # don't include completion conf yet rm -f %{buildroot}/usr/share/bash-completion/completions/lldpcli rm -f %{buildroot}/usr/share/zsh/vendor-completions/_lldpcli # remove static libtool archive rm -f %{buildroot}%{_libdir}/liblldpctl.la %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || \ useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \ -c "Used by the %{name} daemon" %{name} exit 0 %post /sbin/ldconfig %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun /sbin/ldconfig %systemd_postun_with_restart %{name}.service %files %doc NEWS README.md %license LICENSE %{_sbindir}/lldpcli %{_sbindir}/lldpctl %{_sbindir}/%{name} %config %{_sysconfdir}/%{name}.d %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %{_mandir}/man8/lldpcli.8* %{_mandir}/man8/lldpctl.8* %{_mandir}/man8/%{name}.8* %{_libdir}/liblldpctl.so.4 %{_libdir}/liblldpctl.so.4.8.0 %dir /run/%{name} %dir /run/%{name}/chroot %{_unitdir}/%{name}.service %{_tmpfilesdir}/%{name}.conf %dir %attr(-,lldpd,lldpd) %{_sharedstatedir}/%{name} %files devel %{_includedir}/lldp-const.h %{_includedir}/lldpctl.h %{_libdir}/liblldpctl.so %{_libdir}/pkgconfig/lldpctl.pc %changelog * Wed Apr 05 2017 James Hogarth - 0.9.7-3 - Use the official release tarball rather than the github snapshot * Wed Apr 05 2017 James Hogarth - 0.9.7-2 - Tweaks to spec requested in review * Tue Apr 04 2017 James Hogarth - 0.9.7-1 - Initial package