]>
Commit | Line | Data |
---|---|---|
edd7c245 | 1 | # configure options |
68980084 | 2 | %define with_snmp 0 |
788cdc6d | 3 | %define with_vtysh 1 |
4 | %define with_ospf_te 1 | |
5 | %define with_nssa 1 | |
6 | %define with_opaque_lsa 1 | |
7 | %define with_tcp_zebra 0 | |
8 | %define with_vtysh 1 | |
9 | %define with_pam 1 | |
10 | %define with_ipv6 1 | |
55ea381f | 11 | %define with_ospfclient 1 |
12 | %define with_ospfapi 1 | |
8f754983 | 13 | %define with_multipath 64 |
edd7c245 | 14 | %define zebra_user zebra |
15 | %define vty_group zebravty | |
30b9d89b | 16 | |
17 | # path defines | |
788cdc6d | 18 | %define _sysconfdir /etc/zebra |
8f754983 | 19 | %define zeb_src %{_builddir}/%{name}-%{version} |
20 | %define zeb_rh_src %{zeb_src}/redhat | |
21 | %define zeb_docs %{zeb_src}/doc | |
788cdc6d | 22 | |
e0626854 | 23 | # defines for configure |
24 | %define _libexecdir %{_exec_prefix}/libexec/zebra | |
25 | %define _includedir %{_prefix}/include/zebra | |
26 | %define _libdir %{_exec_prefix}/%{_lib}/zebra | |
edd7c245 | 27 | %define _localstatedir /var/run/zebra |
e0626854 | 28 | |
788cdc6d | 29 | Summary: Routing daemon |
30 | Name: zebra | |
6382b6f8 | 31 | Version: @VERSION@ |
edd7c245 | 32 | Release: @CONFDATE@01 |
788cdc6d | 33 | License: GPL |
34 | Group: System Environment/Daemons | |
35 | Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz | |
788cdc6d | 36 | URL: http://www.zebra.org/ |
37 | %if %with_snmp | |
e0626854 | 38 | #BuildRequires: ucd-snmp-devel |
788cdc6d | 39 | Prereq: ucd-snmp |
40 | %endif | |
d7ccae28 | 41 | %if %with_vtysh |
30b9d89b | 42 | BuildRequires: readline readline-devel ncurses ncurses-devel |
d7ccae28 | 43 | Prereq: readline ncurses |
44 | %endif | |
45 | BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch | |
788cdc6d | 46 | # Initscripts > 5.60 is required for IPv6 support |
30b9d89b | 47 | Prereq: initscripts >= 5.60 |
48 | Prereq: openssl ncurses readline pam | |
788cdc6d | 49 | Prereq: /sbin/install-info |
50 | Provides: routingdaemon | |
51 | BuildRoot: %{_tmppath}/%{name}-%{version}-root | |
52 | Obsoletes: bird gated mrt | |
53 | ||
54 | %description | |
55 | GNU Zebra is a free software that manages TCP/IP based routing | |
56 | protocol. It takes multi-server and multi-thread approach to resolve | |
57 | the current complexity of the Internet. | |
58 | ||
59 | GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng. | |
60 | ||
61 | GNU Zebra is intended to be used as a Route Server and a Route | |
62 | Reflector. It is not a toolkit, it provides full routing power under | |
63 | a new architecture. GNU Zebra is unique in design in that it has a | |
64 | process for each protocol. | |
65 | ||
448ed4a2 | 66 | %package contrib |
67 | Summary: contrib tools for zebra | |
68 | Group: System Environment/Daemons | |
69 | ||
70 | %description contrib | |
71 | Contributed/3rd party tools which may be of use with zebra. | |
72 | ||
e0626854 | 73 | %package devel |
74 | Summary: Header and object files for zebra development | |
75 | Group: System Environment/Daemons | |
76 | ||
77 | %description devel | |
78 | The zebra-devel package contains the header and object files neccessary for | |
79 | developing OSPF-API and zebra applications. | |
80 | ||
788cdc6d | 81 | %prep |
82 | %setup -q | |
788cdc6d | 83 | |
84 | %build | |
85 | %configure \ | |
788cdc6d | 86 | %if %with_ipv6 |
87 | --enable-ipv6 \ | |
88 | %endif | |
89 | %if %with_snmp | |
90 | --enable-snmp \ | |
91 | %endif | |
92 | %if %with_multipath | |
93 | --enable-multipath=%with_multipath \ | |
94 | %endif | |
95 | %if %with_tcp_zebra | |
96 | --enable-tcp-zebra \ | |
97 | %endif | |
98 | %if %with_nssa | |
99 | --enable-nssa \ | |
100 | %endif | |
101 | %if %with_opaque_lsa | |
102 | --enable-opaque-lsa \ | |
103 | %endif | |
104 | %if %with_ospf_te | |
105 | --enable-ospf-te \ | |
106 | %endif | |
107 | %if %with_vtysh | |
108 | --enable-vtysh \ | |
109 | %endif | |
68980084 | 110 | %if %with_ospfclient |
111 | --enable-ospfclient=yes \ | |
112 | %else | |
113 | --enable-ospfclient=no\ | |
114 | %endif | |
115 | %if %with_ospfapi | |
116 | --enable-ospfapi=yes \ | |
117 | %else | |
118 | --enable-ospfapi=no \ | |
119 | %endif | |
788cdc6d | 120 | %if %with_pam |
edd7c245 | 121 | --with-libpam \ |
788cdc6d | 122 | %endif |
edd7c245 | 123 | %if %zebra_user |
124 | --enable-user=%zebra_user \ | |
125 | --enable-group=%zebra_user \ | |
126 | %endif | |
127 | %if %vty_group | |
128 | --enable-vty-group=%vty_group \ | |
129 | %endif | |
130 | --with-cflags="-O2" \ | |
131 | --enable-netlink | |
788cdc6d | 132 | |
133 | make %{?_smp_mflags} MAKEINFO="makeinfo --no-split" | |
134 | ||
135 | pushd doc | |
136 | texi2html zebra.texi | |
137 | popd | |
138 | ||
139 | %install | |
140 | rm -rf $RPM_BUILD_ROOT | |
141 | ||
142 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \ | |
143 | $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir} | |
144 | ||
145 | make install \ | |
146 | DESTDIR=$RPM_BUILD_ROOT | |
147 | ||
8f754983 | 148 | install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra |
149 | install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd | |
d7ccae28 | 150 | %if %with_ipv6 |
8f754983 | 151 | install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d |
152 | install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd | |
d7ccae28 | 153 | %endif |
8f754983 | 154 | install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd |
155 | install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd | |
156 | install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra | |
157 | install -m644 %{zeb_rh_src}/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra | |
edd7c245 | 158 | install -d -m750 $RPM_BUILD_ROOT/var/run/zebra |
159 | ||
160 | %pre | |
161 | # add vty_group | |
162 | %if %vty_group | |
163 | groupadd -r %vty_group 2> /dev/null || : | |
164 | %endif | |
165 | # add zebra user and group | |
166 | %if %zebra_user | |
167 | /usr/sbin/useradd -M -r -s /bin/false -c "Zebra routing suite" \ | |
168 | -d %_localstatedir %zebra_user 2> /dev/null || : | |
169 | %endif | |
788cdc6d | 170 | |
788cdc6d | 171 | %post |
30b9d89b | 172 | # zebra_spec_add_service <service name> <port/proto> <comment> |
788cdc6d | 173 | # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
174 | ||
175 | zebra_spec_add_service () | |
176 | { | |
177 | # Add port /etc/services entry if it isn't already there | |
178 | if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then | |
179 | echo "$1 $2 # $3" >> /etc/services | |
180 | fi | |
181 | } | |
182 | ||
183 | zebra_spec_add_service zebrasrv 2600/tcp "zebra service" | |
184 | zebra_spec_add_service zebra 2601/tcp "zebra vty" | |
185 | zebra_spec_add_service ripd 2602/tcp "RIPd vty" | |
d7ccae28 | 186 | %if %with_ipv6 |
788cdc6d | 187 | zebra_spec_add_service ripngd 2603/tcp "RIPngd vty" |
d7ccae28 | 188 | %endif |
788cdc6d | 189 | zebra_spec_add_service ospfd 2604/tcp "OSPFd vty" |
190 | zebra_spec_add_service bgpd 2605/tcp "BGPd vty" | |
d7ccae28 | 191 | %if %with_ipv6 |
788cdc6d | 192 | zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty" |
d7ccae28 | 193 | %endif |
788cdc6d | 194 | |
195 | /sbin/chkconfig --add zebra | |
196 | /sbin/chkconfig --add ripd | |
d7ccae28 | 197 | %if %with_ipv6 |
788cdc6d | 198 | /sbin/chkconfig --add ripngd |
788cdc6d | 199 | /sbin/chkconfig --add ospf6d |
d7ccae28 | 200 | %endif |
30b9d89b | 201 | /sbin/chkconfig --add ospfd |
788cdc6d | 202 | /sbin/chkconfig --add bgpd |
203 | ||
204 | /sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir | |
205 | ||
206 | # Create dummy files if they don't exist so basic functions can be used. | |
207 | if [ ! -e %{_sysconfdir}/zebra.conf ]; then | |
208 | echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf | |
209 | chmod 640 %{_sysconfdir}/zebra.conf | |
210 | fi | |
211 | if [ ! -e %{_sysconfdir}/vtysh.conf ]; then | |
212 | touch %{_sysconfdir}/vtysh.conf | |
213 | chmod 640 %{_sysconfdir}/vtysh.conf | |
214 | fi | |
215 | ||
216 | %postun | |
217 | if [ "$1" -ge "1" ]; then | |
218 | /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1 | |
219 | /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1 | |
d7ccae28 | 220 | %if %with_ipv6 |
788cdc6d | 221 | /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1 |
d7ccae28 | 222 | %endif |
788cdc6d | 223 | /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1 |
d7ccae28 | 224 | %if %with_ipv6 |
788cdc6d | 225 | /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1 |
d7ccae28 | 226 | %endif |
788cdc6d | 227 | /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1 |
228 | fi | |
229 | /sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir | |
230 | ||
231 | %preun | |
232 | if [ "$1" = "0" ]; then | |
233 | /sbin/chkconfig --del zebra | |
234 | /sbin/chkconfig --del ripd | |
d7ccae28 | 235 | %if %with_ipv6 |
788cdc6d | 236 | /sbin/chkconfig --del ripngd |
d7ccae28 | 237 | %endif |
788cdc6d | 238 | /sbin/chkconfig --del ospfd |
d7ccae28 | 239 | %if %with_ipv6 |
788cdc6d | 240 | /sbin/chkconfig --del ospf6d |
d7ccae28 | 241 | %endif |
788cdc6d | 242 | /sbin/chkconfig --del bgpd |
243 | fi | |
244 | ||
245 | %clean | |
246 | #rm -rf $RPM_BUILD_ROOT | |
247 | ||
248 | %files | |
249 | %defattr(-,root,root) | |
448ed4a2 | 250 | %doc */*.sample* AUTHORS COPYING |
8f754983 | 251 | %doc doc/zebra.html |
30b9d89b | 252 | %doc doc/mpls |
8f754983 | 253 | %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO |
edd7c245 | 254 | %if %zebra_user |
255 | %dir %attr(751,%zebra_user,%zebra_user) %{_sysconfdir} | |
256 | %dir %attr(750,%zebra_user,%zebra_user) /var/log/zebra | |
257 | %dir %attr(751,%zebra_user,%zebra_user) /var/run/zebra | |
258 | %else | |
788cdc6d | 259 | %dir %attr(750,root,root) %{_sysconfdir} |
260 | %dir %attr(750,root,root) /var/log/zebra | |
261 | %dir %attr(755,root,root) /usr/share/info | |
edd7c245 | 262 | %dir %attr(750,root,root) /var/run/zebra |
263 | %endif | |
264 | %if %vty_group | |
265 | %attr(750,%zebra_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample | |
266 | %endif | |
788cdc6d | 267 | %{_infodir}/*info* |
268 | %{_mandir}/man*/* | |
269 | %{_sbindir}/* | |
d7ccae28 | 270 | %if %with_vtysh |
788cdc6d | 271 | %{_bindir}/* |
d7ccae28 | 272 | %endif |
788cdc6d | 273 | %config /etc/zebra/* |
274 | %config /etc/rc.d/init.d/* | |
275 | %config(noreplace) /etc/pam.d/zebra | |
276 | %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* | |
277 | ||
448ed4a2 | 278 | %files contrib |
279 | %defattr(-,root,root) | |
280 | %doc tools | |
281 | ||
e0626854 | 282 | %files devel |
283 | %defattr(-,root,root) | |
284 | %dir %{_libdir}/* | |
68980084 | 285 | %dir %{_includedir}/ospfd/* |
286 | %if %with_ospfapi | |
e0626854 | 287 | %dir %{_includedir}/ospfapi/* |
68980084 | 288 | %endif |
e0626854 | 289 | |
788cdc6d | 290 | %changelog |
edd7c245 | 291 | * Tue Mar 20 2003 Paul Jakma <paul@dishone.st> |
292 | - zebra privileges support | |
293 | ||
e0626854 | 294 | * Mon Mar 18 2003 Paul Jakma <paul@dishone.st> |
295 | - Fix mem leak in 'show thread cpu' | |
296 | - Ralph Keller's OSPF-API | |
297 | - Amir: Fix configure.ac for net-snmp | |
298 | ||
448ed4a2 | 299 | * Sat Mar 1 2003 Paul Jakma <paul@dishone.st> |
300 | - ospfd IOS prefix to interface matching for 'network' statement | |
301 | - temporary fix for PtP and IPv6 | |
302 | - sync to zebra.org CVS | |
303 | ||
8f754983 | 304 | * Mon Jan 20 2003 Paul Jakma <paul@dishone.st> |
305 | - update to latest cvs | |
306 | - Yon's "show thread cpu" patch - 17217 | |
307 | - walk up tree - 17218 | |
308 | - ospfd NSSA fixes - 16681 | |
309 | - ospfd nsm fixes - 16824 | |
310 | - ospfd OLSA fixes and new feature - 16823 | |
311 | - KAME and ifindex fixes - 16525 | |
312 | - spec file changes to allow redhat files to be in tree | |
313 | ||
d7ccae28 | 314 | * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com> |
315 | - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP | |
316 | - Fixed up some build requirements (patch) | |
317 | - Added conditional build requirements for vtysh / snmp | |
318 | - Added conditional to %files for %_bindir depending on vtysh | |
319 | ||
788cdc6d | 320 | * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie> |
321 | - update to latest CVS | |
322 | - add Greg Troxel's md5 buffer copy/dup fix | |
323 | - add RIPv1 fix | |
324 | - add Frank's multicast flag fix | |
325 | ||
326 | * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie> | |
327 | - update to latest CVS | |
328 | - timestamped crypt_seqnum patch | |
329 | - oi->on_write_q fix | |
330 | ||
331 | * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie> | |
332 | - update to latest CVS | |
333 | - add vtysh 'write-config (integrated|daemon)' patch | |
334 | - always 'make rebuild' in vtysh/ to catch new commands | |
335 | ||
336 | * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie> | |
337 | - update to 0.93b | |
338 | ||
339 | * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie> | |
340 | - update to latest CVS | |
341 | - add "/sbin/ip route flush proto zebra" to zebra RH init on startup | |
342 | ||
343 | * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie> | |
344 | - update to current CVS | |
345 | - add OSPF point to multipoint patch | |
346 | - add OSPF bugfixes | |
347 | - add BGP hash optimisation patch | |
348 | ||
349 | * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie> | |
350 | - update to 0.93-pre1 / CVS | |
351 | - add link state detection support | |
352 | - add generic PtP and RFC3021 support | |
353 | - various bug fixes | |
354 | ||
355 | * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6 | |
356 | - Fix bug #51336 | |
357 | ||
358 |