3 # Define with/without/bcond_without macros (needed for RHEL4)
4 %define with
() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
5 %define bcond_without
() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
6 %define bcond_with
() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
8 # Conditional build options, disable with "--without xxx"
14 %bcond_without lldpmed
18 # On RHEL < 5, disable SNMP, Net-SNMP installation seems broken. CentOS 5 too.
19 %if 0%{?rhel_version} > 0 && 0%{?rhel_version} < 600 || 0%{?centos_version} > 0 && 0%{?centos_version} < 600
25 %define lldpd_user _lldpd
26 %define lldpd_group _lldpd
27 %define lldpd_chroot
/var
/run
/lldpd
29 Summary: Implementation of IEEE
802.1ab
(LLDP
)
34 Group: System Environment
/Daemons
35 URL: https
://github.com
/vincentbernat
/lldpd
/wiki
36 Source0: http
://media.luffy.cx
/files
/lldpd
/%{name}-%{version}.tar.gz
37 Source1: lldpd.init
%{?suse_version:.suse}
38 Source2: lldpd.sysconfig
40 BuildRequires
: pkgconfig
41 BuildRequires
: libedit
-devel
43 BuildRequires
: net
-snmp
-devel
44 BuildRequires
: openssl
-devel
45 %{!?suse_version:BuildRequires: lm_sensors-devel}
48 BuildRequires
: libxml2
-devel
51 PreReq
: %fillup_prereq %insserv_prereq pwdutils
53 Requires(post
): chkconfig
54 Requires(preun
): chkconfig
55 Requires(preun
): initscripts
56 Requires(postun
): initscripts
59 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
62 This implementation provides LLDP sending and reception
, supports VLAN
63 and includes an SNMP subagent that can interface to an SNMP agent
64 through AgentX protocol.
66 LLDP is an industry standard protocol designed to supplant proprietary
67 Link
-Layer protocols such as Extreme EDP
(Extreme Discovery Protocol
)
68 and CDP
(Cisco Discovery Protocol
). The goal of LLDP is to provide an
69 inter
-vendor compatible mechanism to deliver Link
-Layer notifications
70 to adjacent network devices.
72 This daemon is also able to deal with CDP
, FDP
, SONMP and EDP
73 protocol. It also handles LLDP
-MED extension.
76 Summary: Implementation of IEEE
802.1ab
- Tools and header files
for developers
77 Group: Development
/Libraries
78 Requires: lldpd
= %{version}-%{release}
81 This package is required to develop alternate clients
for lldpd.
128 --with
-privsep
-user
=%lldpd_user \
129 --with
-privsep
-group
=%lldpd_group \
130 --with
-privsep
-chroot
=%lldpd_chroot \
131 --prefix
=/usr
--localstatedir
=%lldpd_chroot --sysconfdir
=/etc
--libdir
=%{_libdir} \
132 --docdir
=%{_docdir}/lldpd
134 [ -f
/usr
/include
/net
-snmp
/agent
/struct.h
] || touch src
/struct.h
138 make install DESTDIR
=$RPM_BUILD_ROOT
139 install -d
-m770 $RPM_BUILD_ROOT
/%lldpd_chroot
140 install -d $RPM_BUILD_ROOT
/%{_initrddir}
141 install -m755
%{SOURCE1} $RPM_BUILD_ROOT/%{_initrddir}/lldpd
142 %if 0%{?suse_version}
143 mkdir -p $
{RPM_BUILD_ROOT
}/var
/adm
/fillup
-templates
144 install -m700
%{SOURCE2} ${RPM_BUILD_ROOT}/var
/adm
/fillup
-templates
/sysconfig.lldpd
146 install -d $RPM_BUILD_ROOT
/etc
/sysconfig
147 install -m644
%{SOURCE2} $RPM_BUILD_ROOT
/etc
/sysconfig
/lldpd
151 # Create lldpd user/group
152 if getent group
%lldpd_group >/dev
/null
2>&1 ; then : ; else \
153 %{_sbindir}/groupadd
-r
%lldpd_group > /dev
/null
2>&1 ||
exit 1 ; fi
154 if getent passwd
%lldpd_user >/dev
/null
2>&1 ; then : ; else \
155 %{_sbindir}/useradd
-g
%lldpd_group -M
-r
-s
/bin
/false \
156 -c "LLDP daemon"
-d
%lldpd_chroot %lldpd_user 2> /dev
/null \
160 %if 0%{?suse_version}
161 # Service management for SuSE
164 %{fillup_and_insserv lldpd}
166 %restart_on_update lldpd
169 %stop_on_removal lldpd
172 # Service management for Redhat/Centos
175 /sbin
/chkconfig
--add lldpd
177 if [ "$
1"
-ge "
1"
]; then
178 /sbin
/service lldpd condrestart
>/dev
/null
2>&1 ||
:
181 if [ "$
1"
= "
0"
]; then
182 /sbin
/service lldpd stop
> /dev
/null
2>&1
183 /sbin
/chkconfig
--del lldpd
189 rm -rf $RPM_BUILD_ROOT
192 %defattr(-,root
,root
,-)
193 %dir %{_docdir}/lldpd
194 %doc %{_docdir}/lldpd
/NEWS
195 %doc %{_docdir}/lldpd
/ChangeLog
196 %doc %{_docdir}/lldpd
/README.md
200 %{_libdir}/liblldpctl.
*
201 %doc %{_mandir}/man8
/lldp
*
202 %dir %attr(750,root
,root
) %lldpd_chroot
203 %config %attr(755,root
,root
) %{_initrddir}/lldpd
204 %if 0%{?suse_version}
205 %attr(644,root
,root
) /var
/adm
/fillup
-templates
/sysconfig.lldpd
207 %config(noreplace
) /etc
/sysconfig
/lldpd
211 %defattr(-,root
,root
)
212 %{_libdir}/pkgconfig
/lldpctl.pc
213 %{_includedir}/lldpctl.h
214 %{_includedir}/lldp
-const.h
217 * Wed Sep
27 2012 Vincent Bernat
<bernat@luffy.cx
> - 0.6.1-1
218 - New upstream version
219 - Do not require libevent
, use embedded copy.
220 - Provide a
-devel package.
222 * Fri Jun
11 2010 Vincent Bernat
<bernat@luffy.cx
> - 0.5.1-1
223 - New upstream version
224 - Define bcond_without and with macros
if not defined to be compatible
226 - Requires useradd and groupadd
227 - Adapt to
make it work with SuSE
228 - Provide an init script targetted at SuSE
229 - Build require lm_sensors
-devel on RHEL
231 * Fri Mar
12 2010 Vincent Bernat
<bernat@luffy.cx
> - 0.5.0-1
232 - New upstream version
235 * Tue May
19 2009 Vincent Bernat
<bernat@luffy.cx
> - 0.4.0-1
237 - Enable SNMP support
238 - Add _lldpd user creation
240 - New upstream version
242 * Mon May
18 2009 Dean Hamstead
<dean.hamstead@optusnet.com.au
> - 0.3.3-1