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