--- /dev/null
+#!/bin/sh
+# openlldp LLDPD - LLDP, CDP and EDP implimentation
+#
+# chkconfig: 345 55 55
+# description: The LLDPD project aims to provide a comprehensive implementation
+# of the IEEE standard 802.1AB Link Layer Discovery Protocol.
+# processname: lldpd
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/lldpd ] && . /etc/sysconfig/lldpd
+
+start() {
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/lldpd ]; then
+ msg_starting "LLDP Daemon"
+ daemon /usr/sbin/lldpd $LLDP_OPT
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+ touch /var/lock/subsys/lldpd
+ ok
+ else
+ fail
+ fi
+ else
+ msg_already_running "LLDP Daemon"
+ fi
+}
+
+stop() {
+ # Stop daemons.
+ if [ -f /var/lock/subsys/lldpd ]; then
+ killproc --pidfile /var/run/lldpd.pid lldpd
+ rm -f /var/lock/subsys/lldpd
+ else
+ msg_not_running "LLDP Daemon"
+ fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ status)
+ status lldpd
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|status}"
+ exit 3
+ ;;
+esac
+
+exit $RETVAL
Group: Networking
Source0: http://media.luffy.cx/files/lldpd/%{name}-%{version}.tar.gz
# Source0-md5: 3db3a80fa6a384cd59e9d6a42ce7b630
-#Source2: %{name}-lldpd.init
-#Source3: %{name}-lldpd.sysconfig
-#Source4: %{name}-lldpd.service
+Source1: %{name}.init
+Source2: %{name}.sysconfig
+#Source3: %{name}-lldpd.service
URL: https://github.com/vincentbernat/lldpd/wiki
BuildRequires: autoconf >= 1.5
BuildRequires: automake
-BuildRequires: libconfuse-devel
Requires(post,preun,postun): systemd-units >= 38
Requires: systemd-units >= 38
+Conflicts: openlldp
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%install
rm -rf $RPM_BUILD_ROOT
-#install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{systemdunitdir}}
+install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{systemdunitdir}}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-#install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lldpd
-#install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/lldpd
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/lldpd
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lldpd
#install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/lldpd.service
%clean
%post
/sbin/chkconfig --add lldpd
%service lldpd restart "LLDP Daemon"
-%systemd_post lldpd.service
+#systemd_post lldpd.service
%preun
if [ "$1" = "0" ]; then
%postun
%systemd_reload
-%triggerpostun -- openlldp < 0.4
+%triggerpostun -- lldpd < 0.4
%systemd_trigger lldpd.service
%files
%defattr(644,root,root,755)
%doc CHANGELOG README.md
-#%attr(754,root,root) /etc/rc.d/init.d/lldpd
-#%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lldpd
+%attr(754,root,root) /etc/rc.d/init.d/lldpd
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lldpd
#%{systemdunitdir}/lldpd.service
%attr(755,root,root) %{_sbindir}/lldpd
%attr(755,root,root) %{_sbindir}/lldpctl