1 # This .spec file is targeted for SuSE OBS. It relies on macro that
2 # are not available on regular distributions. If you use directly
3 # rpmbuild, be sure to use something like `--define 'rhel_version
6 # Conditional build options, disable with "--without xxx"
12 %bcond_without lldpmed
19 # On RHEL <= 6, compile with oldies
20 # For SuSE, SLE11 with a recent SP comes with 3.0. SLE12 comes with 3.12.
21 %if 0%{?rhel_version} > 0 && 0%{?rhel_version} < 700 || 0%{?centos_version} > 0 && 0%{?centos_version} < 700
27 # On RHEL < 7, disable systemd
28 # On SuSE < 12, disable systemd
29 %if 0%{?rhel_version} > 0 && 0%{?rhel_version} < 700 || 0%{?centos_version} > 0 && 0%{?centos_version} < 700 || 0%{?suse_version} > 0 && 0%{?suse_version} < 1200
32 %bcond_without systemd
35 # On RHEL < 7, use embedded libevent
36 %if 0%{?rhel_version} > 0 && 0%{?rhel_version} < 700 || 0%{?centos_version} > 0 && 0%{?centos_version} < 700 || 0%{?suse_version} > 0 && 0%{?suse_version} < 1200
37 %bcond_with system_libevent
39 %bcond_without system_libevent
42 # On RHEL < 7, use embedded libnl.
43 %if 0%{?rhel_version} > 0 && 0%{?rhel_version} < 700 || 0%{?centos_version} > 0 && 0%{?centos_version} < 600 || 0%{?suse_version} > 0 && 0%{?suse_version} < 1200
44 %bcond_with system_libnl
46 %bcond_without system_libnl
49 %define lldpd_user _lldpd
50 %define lldpd_group _lldpd
51 %define lldpd_chroot
/var
/run
/lldpd
53 Summary: Implementation of IEEE
802.1ab
(LLDP
)
58 Group: System
/Management
59 URL: http
://vincentbernat.github.com
/lldpd
/
60 Source0: http
://media.luffy.cx
/files
/lldpd
/%{name}-%{version}.tar.gz
61 Source1: lldpd.init
%{?suse_version:.suse}
62 Source2: lldpd.sysconfig
64 BuildRequires
: pkgconfig
65 %if %{with system_libevent}
66 BuildRequires
: libevent
-devel
68 %if %{with system_libnl}
69 BuildRequires
: libnl3
-devel
73 BuildRequires
: readline
-devel
75 BuildRequires
: net
-snmp
-devel
76 BuildRequires
: openssl
-devel
77 %{!?suse_version:BuildRequires: lm_sensors-devel}
80 BuildRequires
: libxml2
-devel
83 BuildRequires
: json
-c
-devel
86 Requires(post
): systemd
87 Requires(preun
): systemd
88 Requires(postun
): systemd
89 BuildRequires
: systemd
90 BuildRequires
: systemd
-units
93 PreReq
: %fillup_prereq %insserv_prereq pwdutils
95 Requires(pre
): /usr
/sbin
/groupadd
/usr
/sbin
/useradd
96 Requires(post
): chkconfig
97 Requires(preun
): chkconfig
98 Requires(preun
): initscripts
99 Requires(postun
): initscripts
102 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
105 This implementation provides LLDP sending and reception
, supports VLAN
106 and includes an SNMP subagent that can interface to an SNMP agent
107 through AgentX protocol.
109 LLDP is an industry standard protocol designed to supplant proprietary
110 Link
-Layer protocols such as Extreme EDP
(Extreme Discovery Protocol
)
111 and CDP
(Cisco Discovery Protocol
). The goal of LLDP is to provide an
112 inter
-vendor compatible mechanism to deliver Link
-Layer notifications
113 to adjacent network devices.
115 This daemon is also able to deal with CDP
, FDP
, SONMP and EDP
116 protocol. It also handles LLDP
-MED extension.
119 Summary: Implementation of IEEE
802.1ab
- Tools and header files
for developers
120 Group: Development
/Libraries
/C
121 BuildRequires
: pkgconfig
122 Requires: lldpd
= %{version}-%{release}
125 This package is required to develop alternate clients
for lldpd.
127 LLDP is an industry standard protocol designed to supplant proprietary
128 Link
-Layer protocols such as Extreme EDP
(Extreme Discovery Protocol
)
129 and CDP
(Cisco Discovery Protocol
). The goal of LLDP is to provide an
130 inter
-vendor compatible mechanism to deliver Link
-Layer notifications
131 to adjacent network devices.
188 --with
-privsep
-user
=%lldpd_user \
189 --with
-privsep
-group
=%lldpd_group \
190 --with
-privsep
-chroot
=%lldpd_chroot \
191 %if %{without systemd}
192 --with
-systemdsystemunitdir
=no \
194 --with
-sysusersdir
=no \
196 --localstatedir
=%{_localstatedir} \
197 --sysconfdir
=%{_sysconfdir} \
198 --libdir
=%{_libdir} \
199 --docdir
=%{_docdir}/lldpd \
202 [ -f
%{_includedir}/net
-snmp
/agent
/struct.h
] || touch src
/struct.h
206 make install DESTDIR
=$RPM_BUILD_ROOT
207 %if %{without systemd}
208 install -d $RPM_BUILD_ROOT
/%{_initrddir}
209 install -m755
%{SOURCE1} $RPM_BUILD_ROOT/%{_initrddir}/lldpd
211 %if 0%{?suse_version}
212 mkdir -p $
{RPM_BUILD_ROOT
}/var
/adm
/fillup
-templates
213 install -m700
%{SOURCE2} ${RPM_BUILD_ROOT}/var
/adm
/fillup
-templates
/sysconfig.lldpd
215 install -d $RPM_BUILD_ROOT
/etc
/sysconfig
216 install -m644
%{SOURCE2} $RPM_BUILD_ROOT
/etc
/sysconfig
/lldpd
220 # Create lldpd user/group
221 if getent group
%lldpd_group >/dev
/null
2>&1 ; then : ; else \
222 %{_sbindir}/groupadd
-r
%lldpd_group > /dev
/null
2>&1 ||
exit 1 ; fi
223 if getent passwd
%lldpd_user >/dev
/null
2>&1 ; then : ; else \
224 %{_sbindir}/useradd
-g
%lldpd_group -M
-r
-s
/sbin
/nologin \
225 -c "LLDP daemon"
-d
%lldpd_chroot %lldpd_user 2> /dev
/null \
228 %if 0%{?suse_version}
229 # Service management for SuSE
233 %{fillup_and_insserv lldpd}
236 %restart_on_update lldpd
239 %stop_on_removal lldpd
242 %if %{without systemd}
243 # Service management for Redhat/CentOS without systemd
247 /sbin
/chkconfig
--add lldpd
250 if [ "$
1"
-ge "
1"
]; then
251 /sbin
/service lldpd condrestart
>/dev
/null
2>&1 ||
:
254 if [ "$
1"
= "
0"
]; then
255 /sbin
/service lldpd stop
> /dev
/null
2>&1
256 /sbin
/chkconfig
--del lldpd
260 # Service management for Redhat/CentOS with systemd
264 %systemd_post lldpd.service
267 %systemd_preun lldpd.service
270 %systemd_postun_with_restart lldpd.service
277 rm -rf $RPM_BUILD_ROOT
280 %defattr(-,root
,root
,-)
281 %dir %{_docdir}/lldpd
282 %doc %{_docdir}/lldpd
/NEWS
283 %doc %{_docdir}/lldpd
/ChangeLog
284 %doc %{_docdir}/lldpd
/README.md
285 %doc %{_docdir}/lldpd
/CONTRIBUTE.md
289 %{_libdir}/liblldpctl.so.
*
291 %{_datadir}/bash
-completion
292 %doc %{_mandir}/man8
/lldp
*
293 %config %{_sysconfdir}/lldpd.d
294 %if %{without systemd}
295 %config %attr(755,root
,root
) %{_initrddir}/lldpd
297 %{_unitdir}/lldpd.service
299 %if 0%{?suse_version}
300 %attr(644,root
,root
) %{_var}/adm
/fillup
-templates
/sysconfig.lldpd
302 %config(noreplace
) %{_sysconfdir}/sysconfig
/lldpd
306 %defattr(-,root
,root
)
307 %{_libdir}/liblldpctl.so
308 %{_libdir}/liblldpctl.a
309 %{_libdir}/liblldpctl.la
310 %{_libdir}/pkgconfig
/lldpctl.pc
311 %{_includedir}/lldpctl.h
312 %{_includedir}/lldp
-const.h
315 * Sun Dec
27 2015 Vincent Bernat
<bernat@luffy.cx
> - 0.8.0-1
316 - New upstream version.
317 - Use system libnl3 when possible.
318 - Use system libevent when possible.
320 * Wed Sep
09 2015 Vincent Bernat
<bernat@luffy.cx
> - 0.7.17-1
321 - New upstream version.
323 * Fri Aug
07 2015 Vincent Bernat
<bernat@luffy.cx
> - 0.7.16-1
324 - New upstream version.
326 * Wed May
20 2015 Vincent Bernat
<bernat@luffy.cx
> - 0.7.15-1
327 - New upstream version.
329 * Sat Apr
04 2015 Vincent Bernat
<bernat@luffy.cx
> - 0.7.14-1
330 - New upstream version.
332 * Tue Dec
30 2014 Vincent Bernat
<bernat@luffy.cx
> - 0.7.13-1
333 - New upstream version.
335 * Sat Nov
22 2014 Vincent Bernat
<bernat@luffy.cx
> - 0.7.12-1
336 - New upstream version.
337 - Completion
for bash and zsh.
339 * Wed Oct
08 2014 Vincent Bernat
<bernat@luffy.cx
> - 0.7.11-1
340 - New upstream version.
341 - Completion
for bash and zsh.
343 * Mon Jul
21 2014 Vincent Bernat
<bernat@luffy.cx
> - 0.7.10-1
344 - New upstream version.
346 * Wed May
28 2014 Vincent Bernat
<bernat@luffy.cx
> - 0.7.9-1
347 - New upstream version.
349 * Sun Apr
13 2014 Vincent Bernat
<bernat@luffy.cx
> - 0.7.8-1
350 - New upstream version.
352 * Sun Nov
10 2013 Vincent Bernat
<bernat@luffy.cx
> - 0.7.7-1
353 - New upstream version.
355 * Fri Jul
12 2013 Vincent Bernat
<bernat@luffy.cx
> - 0.7.6-1
356 - New upstream version.
358 * Sat Jun
22 2013 Vincent Bernat
<bernat@luffy.cx
> - 0.7.5-1
359 - New upstream version.
361 * Sun May
12 2013 Vincent Bernat
<bernat@luffy.cx
> - 0.7.3-1
362 - New upstream version.
364 * Fri Apr
19 2013 Vincent Bernat
<bernat@luffy.cx
> - 0.7.2-1
365 - New upstream version.
367 * Sat Jan
12 2013 Vincent Bernat
<bernat@luffy.cx
> - 0.7.1-1
368 - New upstream version.
370 * Sun Jan
06 2013 Vincent Bernat
<bernat@luffy.cx
> - 0.7.0-1
371 - New upstream version.
372 - Requires readline
-devel.
375 * Thu Sep
27 2012 Vincent Bernat
<bernat@luffy.cx
> - 0.6.1-1
376 - New upstream version
377 - Do not require libevent
, use embedded copy.
378 - Provide a
-devel package.
380 * Fri Jun
11 2010 Vincent Bernat
<bernat@luffy.cx
> - 0.5.1-1
381 - New upstream version
382 - Define bcond_without and with macros
if not defined to be compatible
384 - Requires useradd and groupadd
385 - Adapt to
make it work with SuSE
386 - Provide an init script targetted at SuSE
387 - Build require lm_sensors
-devel on RHEL
389 * Fri Mar
12 2010 Vincent Bernat
<bernat@luffy.cx
> - 0.5.0-1
390 - New upstream version
393 * Tue May
19 2009 Vincent Bernat
<bernat@luffy.cx
> - 0.4.0-1
395 - Enable SNMP support
396 - Add _lldpd user creation
398 - New upstream version
400 * Mon May
18 2009 Dean Hamstead
<dean.hamstead@optusnet.com.au
> - 0.3.3-1