diff --git a/.cvsignore b/.cvsignore index e69de29..82a5fc6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +lldpad-0.9.26.tar.gz diff --git a/lldpad-0.9.19-init-lsb.patch b/lldpad-0.9.19-init-lsb.patch new file mode 100644 index 0000000..2a35e01 --- /dev/null +++ b/lldpad-0.9.19-init-lsb.patch @@ -0,0 +1,47 @@ +--- lldpad-0.9.26/lldpad.init.orig 2010-02-25 10:32:30.000000000 +0100 ++++ lldpad-0.9.26/lldpad.init 2010-02-25 10:52:52.000000000 +0100 +@@ -151,12 +151,14 @@ + # See how we were called. + case "$1" in + start) ++ [ "$EUID" = "0" ] || exit 4 + echo -n $"Starting $LLDPAD: " + start_daemon $LLDPAD_BIN -d $OPTIONS + rc_status -v + [ $? -eq 0 ] && touch /var/lock/subsys/lldpad + ;; + stop) ++ [ "$EUID" = "0" ] || exit 4 + echo -n $"Shutting down $LLDPAD: " + killproc $LLDPAD + rc_status -v +@@ -177,6 +179,14 @@ + + # NOTE: checkproc returns LSB compliant status values. + checkproc $LLDPAD_BIN ++ RC=$? ++ if [ "$RC" = "3" -a -f /var/lock/subsys/lldpad ]; then ++ rc_failed 2 ++ elif [ "$RC" = "3" ]; then ++ rc_failed 3 ++ elif [ "$RC" = "1" ]; then ++ rc_failed 1 ++ fi + # NOTE: rc_status knows that we called this init script with + # "status" option and adapts its messages accordingly. + rc_status -v +@@ -236,9 +246,13 @@ + rc_failed 3 + rc_status -v + ;; ++ usage) ++ echo $"Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" ++ exit 0 ++ ;; + *) + echo $"Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" +- exit 1 ++ exit 2 + esac + + rc_exit diff --git a/lldpad-0.9.7-init.patch b/lldpad-0.9.7-init.patch new file mode 100644 index 0000000..d1c15d4 --- /dev/null +++ b/lldpad-0.9.7-init.patch @@ -0,0 +1,22 @@ +diff -Nurp dcbd-0.9.7-current/dcbd.init dcbd-0.9.7-corrected/dcbd.init +--- dcbd-0.9.7-current/lldpad.init 2009-03-11 17:51:59.000000000 +0100 ++++ dcbd-0.9.7-corrected/lldpad.init 2009-03-11 18:19:10.000000000 +0100 +@@ -33,15 +33,16 @@ + # lldpad This shell script takes care of starting and stopping + # lldpad (including DCB capabilities exchange protocol) + # +-# chkconfig: 345 20 80 ++# chkconfig: - 20 80 + # description: Data Center Bridging Exchange protocol daemon + # + ### BEGIN INIT INFO + # Provides: lldpad + # Required-Start: network + # Required-Stop: +-# Default-Start: 3 5 ++# Default-Start: + # Default-Stop: ++# Short-Description: Data Center Bridging Exchange protocol daemon + # Description: Data Center Bridging Exchange protocol daemon + ### END INIT INFO + diff --git a/lldpad-0.9.7-make.patch b/lldpad-0.9.7-make.patch new file mode 100644 index 0000000..fea6f14 --- /dev/null +++ b/lldpad-0.9.7-make.patch @@ -0,0 +1,20 @@ +--- lldpad-0.9.26/Makefile.am.orig 2010-02-25 11:11:35.000000000 +0100 ++++ lldpad-0.9.26/Makefile.am 2010-02-25 11:10:19.000000000 +0100 +@@ -28,6 +28,7 @@ + ## system has a shared libconfig, use it + AM_CFLAGS = $(LIBCONFIG_CFLAGS) + AM_LDFLAGS = $(LIBCONFIG_LIBS) ++lldpad_LDFLAGS = $(LIBCONFIG_LIBS) + endif + + ## header files to be installed, for programs using the client interface to lldpad +--- lldpad-0.9.26/Makefile.in.orig 2010-02-25 11:12:19.000000000 +0100 ++++ lldpad-0.9.26/Makefile.in 2010-02-25 11:13:00.000000000 +0100 +@@ -296,6 +296,7 @@ + @BUILTIN_LIBCONFIG_TRUE@lldptool_LDADD = libconfig-1.3.2/libconfig.la + @BUILTIN_LIBCONFIG_FALSE@AM_CFLAGS = $(LIBCONFIG_CFLAGS) + @BUILTIN_LIBCONFIG_FALSE@AM_LDFLAGS = $(LIBCONFIG_LIBS) ++@BUILTIN_LIBCONFIG_FALSE@lldpad_LDFLAGS = $(LIBCONFIG_LIBS) + lldpad_includedir = ${includedir}/lldpad + lldpad_include_HEADERS = include/dcb_types.h include/dcbtool.h \ + include/dcb_osdep.h include/clif.h include/lldp_dcbx_cmds.h include/common.h \ diff --git a/lldpad.spec b/lldpad.spec new file mode 100644 index 0000000..3cda1c9 --- /dev/null +++ b/lldpad.spec @@ -0,0 +1,153 @@ +Name: lldpad +Version: 0.9.26 +Release: 2%{?dist} +Summary: Intel LLDP Agent + +Group: System Environment/Daemons +License: GPLv2 +URL: http://e1000.sourceforge.net +Source0: http://downloads.sourceforge.net/project/e1000/DCB%20Tools/%{name}/%{version}/%{name}-%{version}.tar.gz +# Patch updating Makefile.am and Makefile.in, so the package is compiled with system libconfig +Patch0: lldpad-0.9.7-make.patch +# Update of init script header +Patch1: lldpad-0.9.7-init.patch +# Patch modifying the init script, so the return codes match LSB +Patch2: lldpad-0.9.19-init-lsb.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Requires: kernel >= 2.6.31 +BuildRequires: libconfig-devel >= 1.3.2 kernel-headers >= 2.6.31 +Requires(post): chkconfig +Requires(preun): chkconfig initscripts +Requires(postun): initscripts +Provides: dcbd = %{version}-%{release} +Obsoletes: dcbd < 0.9.26 + +%description +This package contains the Linux user space daemon and configuration tool for +Intel LLDP Agent with Enhanced Ethernet support for the Data Center. + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains header files for developing applications +that use %{name}. + +%prep +%setup -q +%patch0 -p1 -b .make +%patch1 -p1 -b .init +%patch2 -p1 -b .init-lsb + + +%build +%configure +make %{?_smp_mflags} + + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} +mkdir -p %{buildroot}%{_initddir} +mv %{buildroot}/etc/init.d/%{name} %{buildroot}%{_initddir} +rm -rf %{buildroot}/etc/init.d +rm -f %{buildroot}%{_mandir}/man8/dcbd.8 + + +%clean +rm -rf %{buildroot} + + +%post +/sbin/chkconfig --add %{name} + +%preun +if [ $1 = 0 ]; then + /sbin/service %{name} stop > /dev/null 2>&1 + /sbin/chkconfig --del %{name} +fi + +%postun +if [ "$1" -ge "1" ]; then + /sbin/service %{name} condrestart > /dev/null 2>&1 || : +fi + + +%files +%defattr(-,root,root,-) +%doc COPYING README ChangeLog +%{_sbindir}/* +%dir %{_sharedstatedir}/%{name} +%{_initddir}/%{name} +%{_mandir}/man8/* + +%files devel +%defattr(-,root,root,-) +%doc COPYING +%doc README +%{_includedir}/* +%{_libdir}/pkgconfig/*.pc + + +%changelog +* Fri Feb 26 2010 Jan Zeleny - 0.9.26-2 +- updated spec file and LSB init script patch for re-review + (#568641) +* Thu Feb 25 2010 Jan Zeleny - 0.9.26-1 +- rebased to 0.9.26 +- package renamed to lldpad +- enahanced functionality (LLDP supported as well as DCBX) + +* Fri Nov 13 2009 Jan Zeleny - 0.9.19-2 +- init script patch adding LSB compliance + +* Thu Oct 08 2009 Jan Zeleny - 0.9.19-1 +- update to new upstream version + +* Mon Oct 05 2009 Jan Zeleny - 0.9.15-5 +- replaced the last patch, which was not fully functional, with + the new one + +* Wed Sep 09 2009 Karsten Hopp 0.9.15-4 +- buildrequire libconfig-devel >= 1.3.2, it doesn't build with 1.3.1 due to + the different config_lookup_string api + +* Thu Aug 20 2009 Jan Zeleny - 0.9.15-3 +- update of config_lookup_string() function calls + +* Thu Aug 20 2009 Jan Zeleny - 0.9.15-2 +- rebuild in order to match new libconfig + +* Mon Aug 17 2009 Jan Zeleny - 0.9.15-1 +- rebase to 0.9.15 + +* Fri Jul 24 2009 Fedora Release Engineering - 0.9.7-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Mar 20 2009 Jan Zeleny - 0.9.7-4 +- updated scriptlets in spec file to follow the rules + +* Wed Mar 11 2009 Jan Zeleny - 0.9.7-3 +- added devel files again to support fcoe-utils package +- added kernel >= 2.6.29 to Requires, deleted dcbnl.h, since it is + aviable in kernel 2.6.29-rc7 +- changed config dir from /etc/sysconfig/dcbd to /etc/dcbd +- updated init script: added mandatory Short description tag, + deleted default runlevels, which should start the script + +* Tue Mar 10 2009 Jan Zeleny - 0.9.7-2 +- added patch to enable usage of libconfig shared in system +- removed devel part of package + +* Mon Mar 2 2009 Chris Leech - 0.9.7-1 +- Updated to 0.9.7 +- Added a private copy of dcbnl.h until kernel-headers includes it. + Export patch is making it's way to the upstream kernel via net-2.6, + expected in 2.6.29-rc7 + +* Thu Feb 26 2009 Chris Leech - 0.9.5-1 +- initial RPM packaging + diff --git a/sources b/sources index e69de29..71364ef 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +96cfc9310336ad7f2614722146033857 lldpad-0.9.26.tar.gz