]> git.ipfire.org Git - thirdparty/lldpd.git/blame - lldpd.spec
Enhance .spec.
[thirdparty/lldpd.git] / lldpd.spec
CommitLineData
edc4813f
VB
1# configure options
2%define with_snmp 1
3%define with_cdp 1
4%define with_edp 1
5%define with_sonmp 1
6%define with_fdp 1
7%define with_lldpmed 1
8%define with_dot1 1
9%define with_dot3 1
10%define lldpd_user _lldpd
11%define lldpd_group _lldpd
12%define lldpd_chroot /var/run/lldpd
13
0f6eb1ee 14Summary: implementation of IEEE 802.1ab (LLDP)
80530161
VB
15Name: lldpd
16Version: 0.3.3
edc4813f
VB
17Release: 1%{?dist}
18License: MIT
80530161 19Group: System Environment/Daemons
0f6eb1ee 20URL: https://trac.luffy.cx/lldpd/
edc4813f
VB
21Source0: http://www.luffy.cx/lldpd/%{name}-%{version}.tar.gz
22
23%if %with_snmp
24BuildRequires: net-snmp-devel
25Requires: net-snmp
26%endif
80530161
VB
27
28BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
29
80530161 30%description
edc4813f
VB
31This implementation provides LLDP sending and reception, supports VLAN
32and includes an SNMP subagent that can interface to an SNMP agent
33through AgentX protocol.
80530161 34
edc4813f
VB
35LLDP is an industry standard protocol designed to supplant proprietary
36Link-Layer protocols such as Extreme EDP (Extreme Discovery Protocol)
37and CDP (Cisco Discovery Protocol). The goal of LLDP is to provide an
38inter-vendor compatible mechanism to deliver Link-Layer notifications
39to adjacent network devices.
80530161 40
edc4813f
VB
41This daemon is also able to deal with CDP, FDP, SONMP and EDP
42protocol. It also handles LLDP-MED extension.
80530161
VB
43
44%prep
edc4813f 45%setup -q
80530161 46%build
edc4813f
VB
47%configure \
48%if %with_snmp
49 --with-snmp \
50%endif
51%if %with_cdp
52 --enable-cdp \
53%else
54 --disable-cdp \
55%endif
56%if %with_edp
57 --enable-edp \
58%else
59 --disable-edp \
60%endif
61%if %with_sonmp
62 --enable-sonmp \
63%else
64 --disable-sonmp \
65%endif
66%if %with_fdp
67 --enable-fdp \
68%else
69 --disable-fdp \
70%endif
71%if %with_lldpmed
72 --enable-lldpmed \
73%else
74 --disable-lldpmed \
75%endif
76%if %with_dot1
77 --enable-dot1 \
78%else
79 --disable-dot1 \
80%endif
81%if %with_dot3
82 --enable-dot3 \
83%else
84 --disable-dot3 \
85%endif
86 --with-privsep-user=%lldpd_user \
87 --with-privsep-group=%lldpd_group \
88 --with-privsep-chroot=%lldpd_chroot \
89 --prefix=/usr --localstatedir=%lldpd_chroot --sysconfdir=/etc --libdir=%{_libdir}
90
80530161
VB
91make %{?_smp_mflags}
92
93%install
94rm -rf $RPM_BUILD_ROOT
95make install DESTDIR=$RPM_BUILD_ROOT
edc4813f
VB
96install -d -m770 $RPM_BUILD_ROOT/%lldpd_chroot
97
98%pre
99# Create lldpd user/group
100if getent group %lldpd_group >/dev/null 2>&1 ; then : ; else \
101 /usr/sbin/groupadd -r %lldpd_group > /dev/null 2>&1 || exit 1 ; fi
102if getent passwd %lldpd_user >/dev/null 2>&1 ; then : ; else \
103 /usr/sbin/useradd -g %lldpd_group -M -r -s /bin/false \
104 -c "LLDP daemon" -d %lldpd_chroot %lldpd_user 2> /dev/null \
105 || exit 1 ; fi
80530161
VB
106
107%clean
108rm -rf $RPM_BUILD_ROOT
109
110%files
111%defattr(-,root,root,-)
112%doc CHANGELOG
113%doc %_docdir/lldpd/README
114%_sbindir/lldpd
115%_sbindir/lldpctl
116%doc %_mandir/man8/lldp*
117
118%changelog
119* Mon May 18 2009 Dean Hamstead <dean.hamstead@optusnet.com.au> - 0.3.3-1
120- Initial attempt