commit 200e0133ca954f06001ad40e06581a97bc247580 Author: MSVSphere Packaging Team Date: Fri Oct 25 16:47:57 2024 +0300 import lldpd-1.0.18-2.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8490aae --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/lldpd-1.0.18-free.tar.gz diff --git a/.lldpd.metadata b/.lldpd.metadata new file mode 100644 index 0000000..a4f0e84 --- /dev/null +++ b/.lldpd.metadata @@ -0,0 +1 @@ +3552b6c8bea1077345bb29e75feb4646c847efad SOURCES/lldpd-1.0.18-free.tar.gz diff --git a/SOURCES/lldpd-cleanup.sh b/SOURCES/lldpd-cleanup.sh new file mode 100755 index 0000000..9917c96 --- /dev/null +++ b/SOURCES/lldpd-cleanup.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Process a lldpd tarball to remove proprietary source code. +# +# Yaakov Selkowitz - 2021 +# + +SOURCE="$1" +NEW_SOURCE=`echo $SOURCE | sed 's/\.tar\.gz/-free&/'` +DIRECTORY=`echo $SOURCE | sed 's/\.tar\.gz//'` + +error() +{ + MESSAGE=$1 + echo $MESSAGE + exit 1 +} + +rm -rf $DIRECTORY +tar xzf $SOURCE || error "Cannot unpack $SOURCE" +pushd $DIRECTORY > /dev/null || error "Cannot open directory \"$DIRECTORY\"" + +echo "Remove proprietary source files" +find include/osx -type f -delete +find debian -type f -delete + +echo + +popd > /dev/null + +tar czf $NEW_SOURCE $DIRECTORY +echo "$NEW_SOURCE is ready to use" diff --git a/SOURCES/lldpd-fedora.service b/SOURCES/lldpd-fedora.service new file mode 100644 index 0000000..a5fc8c8 --- /dev/null +++ b/SOURCES/lldpd-fedora.service @@ -0,0 +1,23 @@ +[Unit] +Description=LLDP daemon +Documentation=man:lldpd(8) +After=network.target + +[Service] +Type=notify +NotifyAccess=main +EnvironmentFile=-/etc/sysconfig/lldpd +ExecStart=/usr/sbin/lldpd $DAEMON_ARGS $LLDPD_OPTIONS +Restart=on-failure +PrivateTmp=yes +RestrictAddressFamilies=AF_INET AF_INET6 AF_PACKET AF_NETLINK AF_UNIX +ProtectHome=yes +ReadWritePaths=/run/lldpd +ProtectSystem=strict +ProtectKernelTunables=yes +ProtectControlGroups=yes +ProtectKernelModules=yes + +[Install] +WantedBy=multi-user.target + diff --git a/SOURCES/lldpd-fedora.sysconfig b/SOURCES/lldpd-fedora.sysconfig new file mode 100644 index 0000000..de2adcc --- /dev/null +++ b/SOURCES/lldpd-fedora.sysconfig @@ -0,0 +1,8 @@ +## Path: Network/Discovery +## Description: lldpd configuration +## Type: string(-x,-c,-s,-e,-f) +## Default: "" +## ServiceRestart: lldpd +# Parameters for lldpd. See the manual page for the +# accepted parameters. +LLDPD_OPTIONS="" diff --git a/SOURCES/lldpd-systemd-sysusers.conf b/SOURCES/lldpd-systemd-sysusers.conf new file mode 100644 index 0000000..6058660 --- /dev/null +++ b/SOURCES/lldpd-systemd-sysusers.conf @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u lldpd - "Used by the lldpd daemon" /var/lib/lldpd /sbin/nologin diff --git a/SOURCES/lldpd-tmpfiles b/SOURCES/lldpd-tmpfiles new file mode 100644 index 0000000..875f2a7 --- /dev/null +++ b/SOURCES/lldpd-tmpfiles @@ -0,0 +1,2 @@ +d /run/lldpd 0755 root root - +d /run/lldpd/chroot 0755 root root - diff --git a/SPECS/lldpd.spec b/SPECS/lldpd.spec new file mode 100644 index 0000000..5a32335 --- /dev/null +++ b/SPECS/lldpd.spec @@ -0,0 +1,237 @@ +Name: lldpd +Version: 1.0.18 +Release: 2%{?dist} +Summary: ISC-licensed implementation of LLDP + +License: ISC +URL: https://%{name}.github.io/ +Source0: %{name}-%{version}-free.tar.gz +Source1: %{name}-fedora.service +Source2: %{name}-tmpfiles +Source3: %{name}-fedora.sysconfig +Source4: %{name}-systemd-sysusers.conf + +Source100: %{name}-cleanup.sh + +BuildRequires: check-devel +BuildRequires: gcc +BuildRequires: libxml2-devel +BuildRequires: libevent-devel +BuildRequires: make +BuildRequires: net-snmp-devel +BuildRequires: readline-devel +BuildRequires: systemd-devel +%{?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 -p1 + +%build +%configure --disable-static --with-snmp --disable-silent-rules \ + --with-privsep-user=%{name} --with-privsep-group=%{name} \ + --with-privsep-chroot=%{_rundir}/%{name}/chroot \ + --with-lldpd-ctl-socket=%{_rundir}/%{name}/%{name}.socket \ + --with-systemdsystemunitdir=%{_unitdir} --with-sysusersdir=no + +%make_build + + +%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 -p -D -m644 %{SOURCE4} %{buildroot}%{_sysusersdir}/%{name}.conf + +install -d -D -m 0755 %{buildroot}%{_rundir}/%{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 +rm -f %{buildroot}/usr/share/zsh/site-functions/_lldpcli + +# remove static libtool archive +find %{buildroot} -type f -name "*.la" -delete + +%ldconfig_scriptlets + +%pre +%sysusers_create_compat %{SOURCE4} +exit 0 + +%post +%systemd_post lldpd.service + +%preun +%systemd_preun lldpd.service + +%postun +%systemd_postun_with_restart lldpd.service + +%files +%license LICENSE +%doc NEWS README.md +%config %{_sysconfdir}/%{name}.d +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%{_sbindir}/lldpcli +%{_sbindir}/lldpctl +%{_sbindir}/%{name} +%{_mandir}/man8/lldpcli.8* +%{_mandir}/man8/lldpctl.8* +%{_mandir}/man8/%{name}.8* +%{_libdir}/liblldpctl.so.4* +%dir %{_rundir}/%{name} +%dir %{_rundir}/%{name}/chroot +%{_unitdir}/%{name}.service +%{_tmpfilesdir}/%{name}.conf +%{_sysusersdir}/%{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 +* Fri Oct 25 2024 MSVSphere Packaging Team - 1.0.18-2 +- Rebuilt for MSVSphere 10 + +* Mon Jun 24 2024 Troy Dawson - 1.0.18-2 +- Bump release for June 2024 mass rebuild + +* Wed Arp 24 2024 Hangbin Liu - 1.0.18-1 +- Strip ASL/APSL components (RHELMISC-4345) + +* Thu Jan 25 2024 Fedora Release Engineering - 1.0.16-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 1.0.16-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Nov 28 2023 Florian Weimer - 1.0.16-4 +- Reapply C99 compatibility fix + +* Thu Jul 20 2023 Fedora Release Engineering - 1.0.16-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue May 2 2023 Peter Hjalmarsson - 1.0.16-2 +- Correcting usage of rundir macro +- Fix creation of sysuser + +* Tue Apr 11 2023 Peter Robinson - 1.0.16-1 +- Update to 1.0.16 +- Modernise spec file +- CVEs: CVE-2020-27827, CVE-2020-27827, CVE-2021-43612 + +* Thu Jan 19 2023 Fedora Release Engineering - 1.0.4-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Dec 8 2022 Florian Weimer - 1.0.4-11 +- Port configure script to C99 + +* Thu Jul 21 2022 Fedora Release Engineering - 1.0.4-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 1.0.4-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 1.0.4-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 1.0.4-7 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + +* Tue Jan 26 2021 Fedora Release Engineering - 1.0.4-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Sep 29 20:35:23 CEST 2020 Zbigniew Jędrzejewski-Szmek - 1.0.4-5 +- Rebuilt for libevent 2.1.12 + +* Wed Sep 02 2020 Josef Ridky - 1.0.4-4 +- Rebuilt for new net-snmp release + +* Tue Jul 28 2020 Fedora Release Engineering - 1.0.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 1.0.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Aug 13 2019 James Hogarth - 1.0.4-1 +- Updated to new upstream release 1.0.4 + +* Thu Jul 25 2019 Fedora Release Engineering - 1.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Feb 17 2019 Igor Gnatenko - 1.0.1-5 +- Rebuild for readline 8.0 + +* Fri Feb 01 2019 Fedora Release Engineering - 1.0.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Jul 24 2018 Adam Williamson - 1.0.1-3 +- Rebuild for new net-snmp + +* Fri Jul 13 2018 Fedora Release Engineering - 1.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Apr 17 2018 James Hogarth - 1.0.1-1 +- Update to 1.0.1 + +* Thu Feb 08 2018 Fedora Release Engineering - 0.9.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Aug 21 2017 James Hogarth - 0.9.8-1 +- Update to 0.9.8 + +* Fri Aug 11 2017 Igor Gnatenko - 0.9.7-10 +- Rebuilt after RPM update (№ 3) + +* Thu Aug 10 2017 Igor Gnatenko - 0.9.7-9 +- Rebuilt for RPM soname bump + +* Thu Aug 10 2017 Igor Gnatenko - 0.9.7-8 +- Rebuilt for RPM soname bump + +* Thu Aug 03 2017 Fedora Release Engineering - 0.9.7-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.9.7-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Thu Apr 06 2017 James Hogarth - 0.9.7-5 +- Older fedora needs the older syntax matching EPEL7 + +* Wed Apr 05 2017 James Hogarth - 0.9.7-4 +- EPEL7 systemd needs an older syntax + +* Wed Apr 05 2017 James Hogarth - 0.9.7-3 +- Use the official release tarball rather than the github snapshot +- Add EPEL6 conditionals + +* 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