]>
Commit | Line | Data |
---|---|---|
788cdc6d | 1 | %define with_snmp 0 |
2 | %define with_vtysh 1 | |
3 | %define with_ospf_te 1 | |
4 | %define with_nssa 1 | |
5 | %define with_opaque_lsa 1 | |
6 | %define with_tcp_zebra 0 | |
7 | %define with_vtysh 1 | |
8 | %define with_pam 1 | |
9 | %define with_ipv6 1 | |
10 | %define with_multipath 32 | |
30b9d89b | 11 | |
12 | # path defines | |
788cdc6d | 13 | %define _sysconfdir /etc/zebra |
30b9d89b | 14 | %define zeb_builddir %{_builddir}/%{name}-%{version} |
15 | %define zeb_rh_src %{zeb_builddir}/redhat | |
16 | %define zeb_docs %{zeb_builddir}/doc | |
17 | ||
18 | # files | |
19 | %define zebra.ini | |
20 | %define zebra_init %{zeb_rh_src}/zebra.init | |
21 | %define bgpd_init %{zeb_rh_src}/bgpd.init | |
22 | %define ospf6d_init %{zeb_rh_src}/ospf6d.init | |
23 | %define ospfd_init %{zeb_rh_src}/ospfd.init | |
24 | %define ripd_init %{zeb_rh_src}/ripd.init | |
25 | %define ripngd_init %{zeb_rh_src}/ripngd.init | |
26 | %define zebra_pam %{zeb_rh_src}/zebra.pam | |
27 | %define zebra_logrotate %{zeb_rh_src}/zebra.logrotate | |
28 | ||
29 | #echo %{zeb_docs} | |
30 | #echo %{zeb_rh_src} | |
788cdc6d | 31 | |
32 | Summary: Routing daemon | |
33 | Name: zebra | |
34 | Version: 0.93b | |
30b9d89b | 35 | Release: 2003011801 |
788cdc6d | 36 | License: GPL |
37 | Group: System Environment/Daemons | |
38 | Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz | |
788cdc6d | 39 | URL: http://www.zebra.org/ |
40 | %if %with_snmp | |
41 | BuildRequires: ucd-snmp-devel | |
42 | Prereq: ucd-snmp | |
43 | %endif | |
d7ccae28 | 44 | %if %with_vtysh |
30b9d89b | 45 | BuildRequires: readline readline-devel ncurses ncurses-devel |
d7ccae28 | 46 | Prereq: readline ncurses |
47 | %endif | |
48 | BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch | |
788cdc6d | 49 | # Initscripts > 5.60 is required for IPv6 support |
30b9d89b | 50 | Prereq: initscripts >= 5.60 |
51 | Prereq: openssl ncurses readline pam | |
788cdc6d | 52 | Prereq: /sbin/install-info |
53 | Provides: routingdaemon | |
54 | BuildRoot: %{_tmppath}/%{name}-%{version}-root | |
55 | Obsoletes: bird gated mrt | |
56 | ||
57 | %description | |
58 | GNU Zebra is a free software that manages TCP/IP based routing | |
59 | protocol. It takes multi-server and multi-thread approach to resolve | |
60 | the current complexity of the Internet. | |
61 | ||
62 | GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng. | |
63 | ||
64 | GNU Zebra is intended to be used as a Route Server and a Route | |
65 | Reflector. It is not a toolkit, it provides full routing power under | |
66 | a new architecture. GNU Zebra is unique in design in that it has a | |
67 | process for each protocol. | |
68 | ||
69 | %prep | |
70 | %setup -q | |
788cdc6d | 71 | |
72 | %build | |
73 | %configure \ | |
74 | --with-cflags="-O2" \ | |
75 | --enable-netlink \ | |
76 | %if %with_ipv6 | |
77 | --enable-ipv6 \ | |
78 | %endif | |
79 | %if %with_snmp | |
80 | --enable-snmp \ | |
81 | %endif | |
82 | %if %with_multipath | |
83 | --enable-multipath=%with_multipath \ | |
84 | %endif | |
85 | %if %with_tcp_zebra | |
86 | --enable-tcp-zebra \ | |
87 | %endif | |
88 | %if %with_nssa | |
89 | --enable-nssa \ | |
90 | %endif | |
91 | %if %with_opaque_lsa | |
92 | --enable-opaque-lsa \ | |
93 | %endif | |
94 | %if %with_ospf_te | |
95 | --enable-ospf-te \ | |
96 | %endif | |
97 | %if %with_vtysh | |
98 | --enable-vtysh \ | |
99 | %endif | |
100 | %if %with_pam | |
101 | --with-libpam | |
102 | %endif | |
103 | ||
104 | pushd vtysh | |
105 | make %{?_smp_mflags} rebuild | |
106 | popd | |
107 | ||
108 | make %{?_smp_mflags} MAKEINFO="makeinfo --no-split" | |
109 | ||
110 | pushd doc | |
111 | texi2html zebra.texi | |
112 | popd | |
113 | ||
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
117 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \ | |
118 | $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir} | |
119 | ||
120 | make install \ | |
121 | DESTDIR=$RPM_BUILD_ROOT | |
122 | ||
30b9d89b | 123 | install %{zebra_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra |
124 | install %{bgpd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd | |
d7ccae28 | 125 | %if %with_ipv6 |
30b9d89b | 126 | install %{ospf6d_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d |
127 | install %{ripngd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd | |
d7ccae28 | 128 | %endif |
30b9d89b | 129 | install %{ospfd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd |
130 | install %{ripd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd | |
131 | install -m644 %{zebra_pam} $RPM_BUILD_ROOT/etc/pam.d/zebra | |
132 | install -m644 %{zebra_logrotate} $RPM_BUILD_ROOT/etc/logrotate.d/zebra | |
788cdc6d | 133 | |
788cdc6d | 134 | %post |
30b9d89b | 135 | # zebra_spec_add_service <service name> <port/proto> <comment> |
788cdc6d | 136 | # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
137 | ||
138 | zebra_spec_add_service () | |
139 | { | |
140 | # Add port /etc/services entry if it isn't already there | |
141 | if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then | |
142 | echo "$1 $2 # $3" >> /etc/services | |
143 | fi | |
144 | } | |
145 | ||
146 | zebra_spec_add_service zebrasrv 2600/tcp "zebra service" | |
147 | zebra_spec_add_service zebra 2601/tcp "zebra vty" | |
148 | zebra_spec_add_service ripd 2602/tcp "RIPd vty" | |
d7ccae28 | 149 | %if %with_ipv6 |
788cdc6d | 150 | zebra_spec_add_service ripngd 2603/tcp "RIPngd vty" |
d7ccae28 | 151 | %endif |
788cdc6d | 152 | zebra_spec_add_service ospfd 2604/tcp "OSPFd vty" |
153 | zebra_spec_add_service bgpd 2605/tcp "BGPd vty" | |
d7ccae28 | 154 | %if %with_ipv6 |
788cdc6d | 155 | zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty" |
d7ccae28 | 156 | %endif |
788cdc6d | 157 | |
158 | /sbin/chkconfig --add zebra | |
159 | /sbin/chkconfig --add ripd | |
d7ccae28 | 160 | %if %with_ipv6 |
788cdc6d | 161 | /sbin/chkconfig --add ripngd |
788cdc6d | 162 | /sbin/chkconfig --add ospf6d |
d7ccae28 | 163 | %endif |
30b9d89b | 164 | /sbin/chkconfig --add ospfd |
788cdc6d | 165 | /sbin/chkconfig --add bgpd |
166 | ||
167 | /sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir | |
168 | ||
169 | # Create dummy files if they don't exist so basic functions can be used. | |
170 | if [ ! -e %{_sysconfdir}/zebra.conf ]; then | |
171 | echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf | |
172 | chmod 640 %{_sysconfdir}/zebra.conf | |
173 | fi | |
174 | if [ ! -e %{_sysconfdir}/vtysh.conf ]; then | |
175 | touch %{_sysconfdir}/vtysh.conf | |
176 | chmod 640 %{_sysconfdir}/vtysh.conf | |
177 | fi | |
178 | ||
179 | %postun | |
180 | if [ "$1" -ge "1" ]; then | |
181 | /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1 | |
182 | /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1 | |
d7ccae28 | 183 | %if %with_ipv6 |
788cdc6d | 184 | /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1 |
d7ccae28 | 185 | %endif |
788cdc6d | 186 | /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1 |
d7ccae28 | 187 | %if %with_ipv6 |
788cdc6d | 188 | /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1 |
d7ccae28 | 189 | %endif |
788cdc6d | 190 | /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1 |
191 | fi | |
192 | /sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir | |
193 | ||
194 | %preun | |
195 | if [ "$1" = "0" ]; then | |
196 | /sbin/chkconfig --del zebra | |
197 | /sbin/chkconfig --del ripd | |
d7ccae28 | 198 | %if %with_ipv6 |
788cdc6d | 199 | /sbin/chkconfig --del ripngd |
d7ccae28 | 200 | %endif |
788cdc6d | 201 | /sbin/chkconfig --del ospfd |
d7ccae28 | 202 | %if %with_ipv6 |
788cdc6d | 203 | /sbin/chkconfig --del ospf6d |
d7ccae28 | 204 | %endif |
788cdc6d | 205 | /sbin/chkconfig --del bgpd |
206 | fi | |
207 | ||
208 | %clean | |
209 | #rm -rf $RPM_BUILD_ROOT | |
210 | ||
211 | %files | |
212 | %defattr(-,root,root) | |
213 | %doc */*.sample* doc/zebra.html tools AUTHORS COPYING | |
214 | %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO | |
30b9d89b | 215 | %doc doc/mpls |
788cdc6d | 216 | %dir %attr(750,root,root) %{_sysconfdir} |
217 | %dir %attr(750,root,root) /var/log/zebra | |
218 | %dir %attr(755,root,root) /usr/share/info | |
219 | %{_infodir}/*info* | |
220 | %{_mandir}/man*/* | |
221 | %{_sbindir}/* | |
d7ccae28 | 222 | %if %with_vtysh |
788cdc6d | 223 | %{_bindir}/* |
d7ccae28 | 224 | %endif |
788cdc6d | 225 | %config /etc/zebra/* |
226 | %config /etc/rc.d/init.d/* | |
227 | %config(noreplace) /etc/pam.d/zebra | |
228 | %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* | |
229 | ||
230 | %changelog | |
d7ccae28 | 231 | * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com> |
232 | - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP | |
233 | - Fixed up some build requirements (patch) | |
234 | - Added conditional build requirements for vtysh / snmp | |
235 | - Added conditional to %files for %_bindir depending on vtysh | |
236 | ||
788cdc6d | 237 | * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie> |
238 | - update to latest CVS | |
239 | - add Greg Troxel's md5 buffer copy/dup fix | |
240 | - add RIPv1 fix | |
241 | - add Frank's multicast flag fix | |
242 | ||
243 | * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie> | |
244 | - update to latest CVS | |
245 | - timestamped crypt_seqnum patch | |
246 | - oi->on_write_q fix | |
247 | ||
248 | * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie> | |
249 | - update to latest CVS | |
250 | - add vtysh 'write-config (integrated|daemon)' patch | |
251 | - always 'make rebuild' in vtysh/ to catch new commands | |
252 | ||
253 | * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie> | |
254 | - update to 0.93b | |
255 | ||
256 | * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie> | |
257 | - update to latest CVS | |
258 | - add "/sbin/ip route flush proto zebra" to zebra RH init on startup | |
259 | ||
260 | * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie> | |
261 | - update to current CVS | |
262 | - add OSPF point to multipoint patch | |
263 | - add OSPF bugfixes | |
264 | - add BGP hash optimisation patch | |
265 | ||
266 | * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie> | |
267 | - update to 0.93-pre1 / CVS | |
268 | - add link state detection support | |
269 | - add generic PtP and RFC3021 support | |
270 | - various bug fixes | |
271 | ||
272 | * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6 | |
273 | - Fix bug #51336 | |
274 | ||
275 |