]> git.ipfire.org Git - thirdparty/lldpd.git/blob - redhat/lldpd.spec
release: prepare 0.7.16
[thirdparty/lldpd.git] / redhat / lldpd.spec
1 # configure options
2
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}}
7
8 # Conditional build options, disable with "--without xxx"
9 %bcond_without xml
10 %bcond_without cdp
11 %bcond_without edp
12 %bcond_without sonmp
13 %bcond_without fdp
14 %bcond_without lldpmed
15 %bcond_without dot1
16 %bcond_without dot3
17 %bcond_without custom
18 %bcond_with json
19
20 # On RHEL < 5, disable SNMP, Net-SNMP installation seems broken
21 %if 0%{?rhel_version} > 0 && 0%{?rhel_version} < 500 || 0%{?centos_version} > 0 && 0%{?centos_version} < 500
22 %bcond_with snmp
23 %else
24 %bcond_without snmp
25 %endif
26
27 %define lldpd_user _lldpd
28 %define lldpd_group _lldpd
29 %define lldpd_chroot /var/run/lldpd
30
31 Summary: Implementation of IEEE 802.1ab (LLDP)
32 Name: lldpd
33 Version: 0.7.16
34 Release: 1%{?dist}
35 License: MIT
36 Group: System/Management
37 URL: http://vincentbernat.github.com/lldpd/
38 Source0: http://media.luffy.cx/files/lldpd/%{name}-%{version}.tar.gz
39 Source1: lldpd.init%{?suse_version:.suse}
40 Source2: lldpd.sysconfig
41
42 BuildRequires: pkgconfig
43 BuildRequires: readline-devel
44 %if %{with snmp}
45 BuildRequires: net-snmp-devel
46 BuildRequires: openssl-devel
47 %{!?suse_version:BuildRequires: lm_sensors-devel}
48 %endif
49 %if %{with xml}
50 BuildRequires: libxml2-devel
51 %endif
52 %if %{with json}
53 BuildRequires: json-c-devel
54 %endif
55 %if 0%{?suse_version}
56 PreReq: %fillup_prereq %insserv_prereq pwdutils
57 %else
58 Requires(pre): /usr/sbin/groupadd /usr/sbin/useradd
59 Requires(post): chkconfig
60 Requires(preun): chkconfig
61 Requires(preun): initscripts
62 Requires(postun): initscripts
63 %endif
64
65 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
66
67 %description
68 This implementation provides LLDP sending and reception, supports VLAN
69 and includes an SNMP subagent that can interface to an SNMP agent
70 through AgentX protocol.
71
72 LLDP is an industry standard protocol designed to supplant proprietary
73 Link-Layer protocols such as Extreme EDP (Extreme Discovery Protocol)
74 and CDP (Cisco Discovery Protocol). The goal of LLDP is to provide an
75 inter-vendor compatible mechanism to deliver Link-Layer notifications
76 to adjacent network devices.
77
78 This daemon is also able to deal with CDP, FDP, SONMP and EDP
79 protocol. It also handles LLDP-MED extension.
80
81 %package devel
82 Summary: Implementation of IEEE 802.1ab - Tools and header files for developers
83 Group: Development/Libraries/C
84 BuildRequires: pkgconfig
85 Requires: lldpd = %{version}-%{release}
86
87 %description devel
88 This package is required to develop alternate clients for lldpd.
89
90 LLDP is an industry standard protocol designed to supplant proprietary
91 Link-Layer protocols such as Extreme EDP (Extreme Discovery Protocol)
92 and CDP (Cisco Discovery Protocol). The goal of LLDP is to provide an
93 inter-vendor compatible mechanism to deliver Link-Layer notifications
94 to adjacent network devices.
95
96 %prep
97 %setup -q
98 %build
99 %configure \
100 %if %{with snmp}
101 --with-snmp \
102 %endif
103 %if %{with xml}
104 --with-xml \
105 %endif
106 %if %{with cdp}
107 --enable-cdp \
108 %else
109 --disable-cdp \
110 %endif
111 %if %{with edp}
112 --enable-edp \
113 %else
114 --disable-edp \
115 %endif
116 %if %{with sonmp}
117 --enable-sonmp \
118 %else
119 --disable-sonmp \
120 %endif
121 %if %{with fdp}
122 --enable-fdp \
123 %else
124 --disable-fdp \
125 %endif
126 %if %{with lldpmed}
127 --enable-lldpmed \
128 %else
129 --disable-lldpmed \
130 %endif
131 %if %{with dot1}
132 --enable-dot1 \
133 %else
134 --disable-dot1 \
135 %endif
136 %if %{with dot3}
137 --enable-dot3 \
138 %else
139 --disable-dot3 \
140 %endif
141 %if %{with custom}
142 --enable-custom \
143 %else
144 --disable-custom \
145 %endif
146 --with-privsep-user=%lldpd_user \
147 --with-privsep-group=%lldpd_group \
148 --with-privsep-chroot=%lldpd_chroot \
149 --with-systemdsystemunitdir=no \
150 --with-sysusersdir=no \
151 --prefix=%{_usr} \
152 --localstatedir=%{_localstatedir} \
153 --sysconfdir=%{_sysconfdir} \
154 --libdir=%{_libdir} \
155 --docdir=%{_docdir}/lldpd
156
157 [ -f %{_includedir}/net-snmp/agent/struct.h ] || touch src/struct.h
158 make %{?_smp_mflags}
159
160 %install
161 make install DESTDIR=$RPM_BUILD_ROOT
162 install -d $RPM_BUILD_ROOT/%{_initrddir}
163 install -m755 %{SOURCE1} $RPM_BUILD_ROOT/%{_initrddir}/lldpd
164 %if 0%{?suse_version}
165 mkdir -p ${RPM_BUILD_ROOT}/var/adm/fillup-templates
166 install -m700 %{SOURCE2} ${RPM_BUILD_ROOT}/var/adm/fillup-templates/sysconfig.lldpd
167 %else
168 install -d $RPM_BUILD_ROOT/etc/sysconfig
169 install -m644 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lldpd
170 %endif
171
172 %pre
173 # Create lldpd user/group
174 if getent group %lldpd_group >/dev/null 2>&1 ; then : ; else \
175 %{_sbindir}/groupadd -r %lldpd_group > /dev/null 2>&1 || exit 1 ; fi
176 if getent passwd %lldpd_user >/dev/null 2>&1 ; then : ; else \
177 %{_sbindir}/useradd -g %lldpd_group -M -r -s /bin/false \
178 -c "LLDP daemon" -d %lldpd_chroot %lldpd_user 2> /dev/null \
179 || exit 1 ; fi
180
181 %if 0%{?suse_version}
182 # Service management for SuSE
183
184 %post
185 /sbin/ldconfig
186 %{fillup_and_insserv lldpd}
187 %postun
188 /sbin/ldconfig
189 %restart_on_update lldpd
190 %insserv_cleanup
191 %preun
192 %stop_on_removal lldpd
193
194 %else
195 # Service management for Redhat/Centos
196
197 %post
198 /sbin/ldconfig
199 /sbin/chkconfig --add lldpd
200 %postun
201 /sbin/ldconfig
202 if [ "$1" -ge "1" ]; then
203 /sbin/service lldpd condrestart >/dev/null 2>&1 || :
204 fi
205 %preun
206 if [ "$1" = "0" ]; then
207 /sbin/service lldpd stop > /dev/null 2>&1
208 /sbin/chkconfig --del lldpd
209 fi
210
211 %endif
212
213 %clean
214 rm -rf $RPM_BUILD_ROOT
215
216 %files
217 %defattr(-,root,root,-)
218 %dir %{_docdir}/lldpd
219 %doc %{_docdir}/lldpd/NEWS
220 %doc %{_docdir}/lldpd/ChangeLog
221 %doc %{_docdir}/lldpd/README.md
222 %doc %{_docdir}/lldpd/CONTRIBUTE.md
223 %{_sbindir}/lldpd
224 %{_sbindir}/lldpctl
225 %{_sbindir}/lldpcli
226 %{_libdir}/liblldpctl.so.*
227 %{_datadir}/zsh
228 %{_datadir}/bash-completion
229 %doc %{_mandir}/man8/lldp*
230 %config %{_sysconfdir}/lldpd.d
231 %config %attr(755,root,root) %{_initrddir}/lldpd
232 %if 0%{?suse_version}
233 %attr(644,root,root) %{_var}/adm/fillup-templates/sysconfig.lldpd
234 %else
235 %config(noreplace) %{_sysconfdir}/sysconfig/lldpd
236 %endif
237
238 %files devel
239 %defattr(-,root,root)
240 %{_libdir}/liblldpctl.so
241 %{_libdir}/liblldpctl.a
242 %{_libdir}/liblldpctl.la
243 %{_libdir}/pkgconfig/lldpctl.pc
244 %{_includedir}/lldpctl.h
245 %{_includedir}/lldp-const.h
246
247 %changelog
248 * Fri Aug 07 2015 Vincent Bernat <bernat@luffy.cx> - 0.7.16-1
249 - New upstream version.
250
251 * Wed May 20 2015 Vincent Bernat <bernat@luffy.cx> - 0.7.15-1
252 - New upstream version.
253
254 * Sat Apr 04 2015 Vincent Bernat <bernat@luffy.cx> - 0.7.14-1
255 - New upstream version.
256
257 * Tue Dec 30 2014 Vincent Bernat <bernat@luffy.cx> - 0.7.13-1
258 - New upstream version.
259
260 * Sat Nov 22 2014 Vincent Bernat <bernat@luffy.cx> - 0.7.12-1
261 - New upstream version.
262 - Completion for bash and zsh.
263
264 * Wed Oct 08 2014 Vincent Bernat <bernat@luffy.cx> - 0.7.11-1
265 - New upstream version.
266 - Completion for bash and zsh.
267
268 * Mon Jul 21 2014 Vincent Bernat <bernat@luffy.cx> - 0.7.10-1
269 - New upstream version.
270
271 * Wed May 28 2014 Vincent Bernat <bernat@luffy.cx> - 0.7.9-1
272 - New upstream version.
273
274 * Sun Apr 13 2014 Vincent Bernat <bernat@luffy.cx> - 0.7.8-1
275 - New upstream version.
276
277 * Sun Nov 10 2013 Vincent Bernat <bernat@luffy.cx> - 0.7.7-1
278 - New upstream version.
279
280 * Fri Jul 12 2013 Vincent Bernat <bernat@luffy.cx> - 0.7.6-1
281 - New upstream version.
282
283 * Sat Jun 22 2013 Vincent Bernat <bernat@luffy.cx> - 0.7.5-1
284 - New upstream version.
285
286 * Sun May 12 2013 Vincent Bernat <bernat@luffy.cx> - 0.7.3-1
287 - New upstream version.
288
289 * Fri Apr 19 2013 Vincent Bernat <bernat@luffy.cx> - 0.7.2-1
290 - New upstream version.
291
292 * Sat Jan 12 2013 Vincent Bernat <bernat@luffy.cx> - 0.7.1-1
293 - New upstream version.
294
295 * Sun Jan 06 2013 Vincent Bernat <bernat@luffy.cx> - 0.7.0-1
296 - New upstream version.
297 - Requires readline-devel.
298 - Ships lldpcli.
299
300 * Thu Sep 27 2012 Vincent Bernat <bernat@luffy.cx> - 0.6.1-1
301 - New upstream version
302 - Do not require libevent, use embedded copy.
303 - Provide a -devel package.
304
305 * Fri Jun 11 2010 Vincent Bernat <bernat@luffy.cx> - 0.5.1-1
306 - New upstream version
307 - Define bcond_without and with macros if not defined to be compatible
308 with RHEL
309 - Requires useradd and groupadd
310 - Adapt to make it work with SuSE
311 - Provide an init script targetted at SuSE
312 - Build require lm_sensors-devel on RHEL
313
314 * Fri Mar 12 2010 Vincent Bernat <bernat@luffy.cx> - 0.5.0-1
315 - New upstream version
316 - Add XML support
317
318 * Tue May 19 2009 Vincent Bernat <bernat@luffy.cx> - 0.4.0-1
319 - Add variables
320 - Enable SNMP support
321 - Add _lldpd user creation
322 - Add initscript
323 - New upstream version
324
325 * Mon May 18 2009 Dean Hamstead <dean.hamstead@optusnet.com.au> - 0.3.3-1
326 - Initial attempt