Compare commits

..

No commits in common. "c8s" and "c9-beta" have entirely different histories.
c8s ... c9-beta

11 changed files with 122 additions and 226 deletions

5
.gitignore vendored
View File

@ -1,4 +1 @@
SOURCES/lldpd-1.0.1.tar.gz SOURCES/lldpd-1.0.18-free.tar.gz
/lldpd-1.0.1.tar.gz
/lldpd-1.0.17.tar.gz
/lldpd-1.0.17-free.tar.gz

1
.lldpd.metadata Normal file
View File

@ -0,0 +1 @@
3552b6c8bea1077345bb29e75feb4646c847efad SOURCES/lldpd-1.0.18-free.tar.gz

31
SOURCES/lldpd-cleanup.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh
# Process a lldpd tarball to remove proprietary source code.
#
# Yaakov Selkowitz <yselkowi@redhat.com> - 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
echo
popd > /dev/null
tar czf $NEW_SOURCE $DIRECTORY
echo "$NEW_SOURCE is ready to use"

View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u lldpd - "Used by the lldpd daemon" /var/lib/lldpd /sbin/nologin

View File

@ -1,48 +1,29 @@
%if 0%{?el6}
%bcond_with systemd
%global rundir /var/run/
%else
%bcond_without systemd
%global rundir /run/
%endif
%global gh_owner vincentbernat
Name: lldpd Name: lldpd
Version: 1.0.17 Version: 1.0.18
Release: 2%{?dist} Release: 4%{?dist}
Summary: ISC-licensed implementation of LLDP Summary: ISC-licensed implementation of LLDP
License: ISC License: ISC
URL: https://%{gh_owner}.github.io/%{name}/ URL: https://github.com/lldpd/
Source0: https://media.luffy.cx/files/lldpd/lldpd-%{version}.tar.gz # Upstream https://github.com/lldpd/lldpd/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-fedora.service Source0: lldpd-%{version}-free.tar.gz
Source1: %{name}.service
Source2: %{name}-tmpfiles Source2: %{name}-tmpfiles
Source3: %{name}-fedora.sysconfig Source3: %{name}.sysconfig
Source4: %{name}-el6.init Source4: %{name}-systemd-sysusers.conf
Source5: %{name}-el7.service
Source100: lldpd-cleanup.sh
BuildRequires: readline-devel
BuildRequires: check-devel BuildRequires: check-devel
BuildRequires: net-snmp-devel BuildRequires: gcc
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
# EL6 needs libevent2 as the package
%if 0%{?el6}
BuildRequires: libevent2-devel
%else
BuildRequires: libevent-devel BuildRequires: libevent-devel
%endif BuildRequires: make
BuildRequires: net-snmp-devel
%if 0%{?with_systemd} BuildRequires: readline-devel
# For systemd stuff BuildRequires: systemd-rpm-macros
BuildRequires: systemd
%{?systemd_requires} %{?systemd_requires}
%else %{?sysusers_requires_compat}
Requires(post): chkconfig
Requires(preun): chkconfig
# This is for /sbin/service
Requires(preun): initscripts
%endif
Requires(pre): shadow-utils Requires(pre): shadow-utils
@ -60,106 +41,69 @@ Summary: %{summary}
%{name} development libraries and headers %{name} development libraries and headers
%prep %prep
%autosetup %autosetup -p1
%build %build
%configure --disable-static --with-snmp --disable-silent-rules \ %configure --disable-static --with-snmp --disable-silent-rules \
--with-privsep-user=%{name} --with-privsep-group=%{name} \ --with-privsep-user=%{name} --with-privsep-group=%{name} \
--with-privsep-chroot=%{rundir}%{name}/chroot \ --with-privsep-chroot=%{_rundir}/%{name}/chroot \
--with-lldpd-ctl-socket=%{rundir}%{name}/%{name}.socket \ --with-lldpd-ctl-socket=%{_rundir}/%{name}/%{name}.socket \
%if 0%{?with_systemd}
--with-systemdsystemunitdir=%{_unitdir} --with-sysusersdir=no --with-systemdsystemunitdir=%{_unitdir} --with-sysusersdir=no
%endif
make %{?_smp_mflags}
%make_build
%install %install
%make_install %make_install
%if 0%{?with_systemd}
%if 0%{?fedora} >= 26
install -p -D -m644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install -p -D -m644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
%else
install -p -D -m644 %{SOURCE5} %{buildroot}%{_unitdir}/%{name}.service
%endif
install -p -D -m644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf install -p -D -m644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf
%else
install -p -D -m755 %{SOURCE4} %{buildroot}%{_initddir}/%{name}
%endif
install -p -D -m644 %{SOURCE3} %{buildroot}/etc/sysconfig/%{name} 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 -D -m 0755 %{buildroot}%{_rundir}/%{name}/chroot
install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name}
# remove the docs from buildroot # remove the docs from buildroot
rm -rf %{buildroot}/usr/share/doc/%{name} rm -rf %{buildroot}/usr/share/doc/%{name}
# don't include completion conf yet # don't include completion conf yet
rm -f %{buildroot}/usr/share/bash-completion/completions/lldpcli rm -f %{buildroot}/usr/share/bash-completion/completions/lldpcli
rm -f %{buildroot}/usr/share/zsh/vendor-completions/_lldpcli rm -f %{buildroot}/usr/share/zsh/vendor-completions/_lldpcli
rm -f %{buildroot}/usr/share/zsh/site-functions/_lldpcli rm -f %{buildroot}/usr/share/zsh/site-functions/_lldpcli
# remove static libtool archive # remove static libtool archive
rm -f %{buildroot}%{_libdir}/liblldpctl.la find %{buildroot} -type f -name "*.la" -delete
%ldconfig_scriptlets
%pre %pre
getent group %{name} >/dev/null || groupadd -r %{name} %sysusers_create_compat %{SOURCE4}
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 %post
/sbin/ldconfig
%if 0%{?with_systemd}
%systemd_post %{name}.service %systemd_post %{name}.service
%else
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{name}
%endif
%preun %preun
%if 0%{?with_systemd}
%systemd_preun %{name}.service %systemd_preun %{name}.service
%else
if [ $1 -eq 0 ] ; then
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
%endif
%postun %postun
/sbin/ldconfig
%if 0%{?with_systemd}
%systemd_postun_with_restart %{name}.service %systemd_postun_with_restart %{name}.service
%else
if [ "$1" -ge "1" ] ; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
%endif
%files %files
%doc NEWS README.md
%license LICENSE %license LICENSE
%doc NEWS README.md
%config %{_sysconfdir}/%{name}.d
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_sbindir}/lldpcli %{_sbindir}/lldpcli
%{_sbindir}/lldpctl %{_sbindir}/lldpctl
%{_sbindir}/%{name} %{_sbindir}/%{name}
%config %{_sysconfdir}/%{name}.d
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_mandir}/man8/lldpcli.8* %{_mandir}/man8/lldpcli.8*
%{_mandir}/man8/lldpctl.8* %{_mandir}/man8/lldpctl.8*
%{_mandir}/man8/%{name}.8* %{_mandir}/man8/%{name}.8*
%{_libdir}/liblldpctl.so.4* %{_libdir}/liblldpctl.so.4*
%dir %{rundir}%{name} %dir %{_rundir}/%{name}
%dir %{rundir}%{name}/chroot %dir %{_rundir}/%{name}/chroot
%if 0%{?with_systemd}
%{_unitdir}/%{name}.service %{_unitdir}/%{name}.service
%{_tmpfilesdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf
%else %{_sysusersdir}/%{name}.conf
%{_initddir}/%{name}
%endif
%dir %attr(-,lldpd,lldpd) %{_sharedstatedir}/%{name} %dir %attr(-,lldpd,lldpd) %{_sharedstatedir}/%{name}
%files devel %files devel
@ -168,16 +112,65 @@ fi
%{_libdir}/liblldpctl.so %{_libdir}/liblldpctl.so
%{_libdir}/pkgconfig/lldpctl.pc %{_libdir}/pkgconfig/lldpctl.pc
%changelog %changelog
* Mon Nov 06 2023 Hangbin Liu <haliu@redhat.com> - 1.0.17-2 * Mon May 20 2024 Hangbin Liu <haliu@redhat.com> - 1.0.18-3
- Fix liblldpctl version [RHEL-2211] - Add lldpd-devel package [RHEL-22127]
* Sun Feb 18 2024 Hangbin Liu <haliu@redhat.com> - 1.0.18-2
- Remove networkd gating test [RHEL-25990]
* Wed Jan 31 2024 Hangbin Liu <haliu@redhat.com> - 1.0.18-1
- Rebased to 1.0.18 [RHEL-2211]
* Mon Nov 06 2023 Hangbin Liu <haliu@redhat.com> - 1.0.17-1 * Mon Nov 06 2023 Hangbin Liu <haliu@redhat.com> - 1.0.17-1
- Rebased to 1.0.17 [RHEL-2211] - Rebased to 1.0.17 [RHEL-2211, RHEL-5791, RHEL-5796]
* Thu Aug 09 2018 Josef Ridky <jridky@redhat.com> - 1.0.1-2 * Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.0.4-10
- Rebuild for Net-SNMP - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Mon Jul 12 2021 Aaron Conole <aconole@redhat.com> - 1.0.4-9
- Strip ASL components (#1982259)
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com> - 1.0.4-8
- Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.0.4-7
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 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 <zbyszek@in.waw.pl> - 1.0.4-5
- Rebuilt for libevent 2.1.12
* Wed Sep 02 2020 Josef Ridky <jridky@redhat.com> - 1.0.4-4
- Rebuilt for new net-snmp release
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Aug 13 2019 James Hogarth <james.hogarth@gmail.com> - 1.0.4-1
- Updated to new upstream release 1.0.4
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.1-5
- Rebuild for readline 8.0
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jul 24 2018 Adam Williamson <awilliam@redhat.com> - 1.0.1-3
- Rebuild for new net-snmp
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Apr 17 2018 James Hogarth <james.hogarth@gmail.com> - 1.0.1-1 * Tue Apr 17 2018 James Hogarth <james.hogarth@gmail.com> - 1.0.1-1
- Update to 1.0.1 - Update to 1.0.1

View File

@ -1,104 +0,0 @@
#!/bin/bash
# lldpd init file
#
# chkconfig: - 60 20
# description: 802.1ab (LLDP) daemon
#
# processname: lldpd
# pidfile: /var/run/lldpd.pid
### BEGIN INIT INFO
# Provides: lldpd
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $syslog $network $net-snmp
# Should-Stop: $syslog $network $net-snmp
# Default-Stop: 0 1 6
# Short-Description: LLDP daemon
# Description: 802.1ab (LLDP) daemon
### END INIT INFO
# source function library
. /etc/rc.d/init.d/functions
exec="/usr/sbin/lldpd"
prog="lldpd"
config="/etc/lldpd.d"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 4
[ -d $config ] || exit 6
echo -n $"Starting $prog: "
daemon $exec $LLDPD_OPTIONS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $exec
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $RETVAL
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -1,23 +0,0 @@
[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=/var/run/lldpd
ProtectSystem=strict
ProtectKernelTunables=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
[Install]
WantedBy=multi-user.target

View File

@ -1 +0,0 @@
SHA512 (lldpd-1.0.17.tar.gz) = 8f6d6ea6a32cc0f238158a2d1f08224224bca250cf61f80e4d8b633c0471e4ff9a17a7a7d7f313f10d557a256c7419f54cbb3b78903b7bba3619f9c5b6c114c8