]> git.proxmox.com Git - mirror_frr.git/blob - ports/redhat/zebra.spec
Added RedHat related files, (init, logrotate, pam, rpm spec)
[mirror_frr.git] / ports / redhat / zebra.spec
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
11 %define _sysconfdir /etc/zebra
12
13 Summary: Routing daemon
14 Name: zebra
15 Version: 0.93b
16 Release: 2002111101
17 License: GPL
18 Group: System Environment/Daemons
19 Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
20 Source1: zebra.init
21 Source2: bgpd.init
22 Source3: ospf6d.init
23 Source4: ospfd.init
24 Source5: ripd.init
25 Source6: ripngd.init
26 Source8: zebra.pam
27 Source9: zebra.logrotate
28 Source10: zebra.mpls-docs.tar.gz
29 Patch0: zebra-bgpd-hash.patch
30 Patch1: zebra-ptp.patch
31 Patch2: zebra-linkstate.patch
32 Patch3: zebra-ospfd-ptmp.patch
33 Patch4: zebra-ospfd-misc.patch
34 Patch5: zebra-ospfd-olsa.patch
35 Patch7: zebra-vtysh-write-config.patch
36 Patch8: zebra-ospfd-md5auth-seqnum.patch
37 Patch9: zebra-ospfd-oi_write_q.patch
38 Patch10: zebra-ripv1-netmask.patch
39 Patch11: zebra-ospfd-md5-buffer-fix.patch
40 Patch12: zebra-multi.patch
41 URL: http://www.zebra.org/
42 %if %with_snmp
43 BuildRequires: ucd-snmp-devel
44 Prereq: ucd-snmp
45 %endif
46 BuildRequires: texinfo tetex autoconf readline-devel ncurses-devel openssl-devel pam-devel
47 # Initscripts > 5.60 is required for IPv6 support
48 Prereq: openssl ncurses readline initscripts pam
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
66 %prep
67 %setup -q
68 %patch0 -p1 -b .bgphash
69 %patch1 -p0 -b .ptp
70 %patch2 -p1 -b .linkstate
71 %patch3 -p1 -b .ospf-ptmp
72 %patch4 -p1 -b .ospf-misc
73 %patch5 -p1 -b .ospf-olsa
74 %patch7 -p1 -b .vtysh-write
75 %patch8 -p2 -b .ospf-md5auth-seqnum
76 %patch9 -p0 -b .ospfd-oi_write_q
77 %patch10 -p0 -b .ripd-netmask
78 %patch11 -p0 -b .ospfd-md5-buffer
79 %patch12 -p0 -b .zebra-multi
80 %{__tar} -zxf %{SOURCE10}
81
82 %build
83 %configure \
84 --with-cflags="-O2" \
85 --enable-netlink \
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
110 %if %with_pam
111 --with-libpam
112 %endif
113
114 pushd vtysh
115 make %{?_smp_mflags} rebuild
116 popd
117
118 make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
119
120 pushd doc
121 texi2html zebra.texi
122 popd
123
124 %install
125 rm -rf $RPM_BUILD_ROOT
126
127 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
128 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
129
130 make install \
131 DESTDIR=$RPM_BUILD_ROOT
132
133 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
134 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
135 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
136 install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
137 install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
138 install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
139 install -m644 %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/zebra
140 install -m644 %{SOURCE9} $RPM_BUILD_ROOT/etc/logrotate.d/zebra
141
142
143 %post
144 # zebra_spec_add_service <sercice name> <port/proto> <comment>
145 # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
146
147 zebra_spec_add_service ()
148 {
149 # Add port /etc/services entry if it isn't already there
150 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
151 echo "$1 $2 # $3" >> /etc/services
152 fi
153 }
154
155 zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
156 zebra_spec_add_service zebra 2601/tcp "zebra vty"
157 zebra_spec_add_service ripd 2602/tcp "RIPd vty"
158 zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
159 zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
160 zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
161 zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
162
163 /sbin/chkconfig --add zebra
164 /sbin/chkconfig --add ripd
165 /sbin/chkconfig --add ripngd
166 /sbin/chkconfig --add ospfd
167 /sbin/chkconfig --add ospf6d
168 /sbin/chkconfig --add bgpd
169
170 /sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
171
172 # Create dummy files if they don't exist so basic functions can be used.
173 if [ ! -e %{_sysconfdir}/zebra.conf ]; then
174 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
175 chmod 640 %{_sysconfdir}/zebra.conf
176 fi
177 if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
178 touch %{_sysconfdir}/vtysh.conf
179 chmod 640 %{_sysconfdir}/vtysh.conf
180 fi
181
182 %postun
183 if [ "$1" -ge "1" ]; then
184 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
185 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
186 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
187 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
188 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
189 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
190 fi
191 /sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
192
193 %preun
194 if [ "$1" = "0" ]; then
195 /sbin/chkconfig --del zebra
196 /sbin/chkconfig --del ripd
197 /sbin/chkconfig --del ripngd
198 /sbin/chkconfig --del ospfd
199 /sbin/chkconfig --del ospf6d
200 /sbin/chkconfig --del bgpd
201 fi
202
203 %clean
204 #rm -rf $RPM_BUILD_ROOT
205
206 %files
207 %defattr(-,root,root)
208 %doc */*.sample* doc/zebra.html tools AUTHORS COPYING
209 %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
210 %dir %attr(750,root,root) %{_sysconfdir}
211 %dir %attr(750,root,root) /var/log/zebra
212 %dir %attr(755,root,root) /usr/share/info
213 %{_infodir}/*info*
214 %{_mandir}/man*/*
215 %{_sbindir}/*
216 %{_bindir}/*
217 %config /etc/zebra/*
218 %config /etc/rc.d/init.d/*
219 %config(noreplace) /etc/pam.d/zebra
220 %config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
221
222 %changelog
223 * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
224 - update to latest CVS
225 - add Greg Troxel's md5 buffer copy/dup fix
226 - add RIPv1 fix
227 - add Frank's multicast flag fix
228
229 * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
230 - update to latest CVS
231 - timestamped crypt_seqnum patch
232 - oi->on_write_q fix
233
234 * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
235 - update to latest CVS
236 - add vtysh 'write-config (integrated|daemon)' patch
237 - always 'make rebuild' in vtysh/ to catch new commands
238
239 * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
240 - update to 0.93b
241
242 * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
243 - update to latest CVS
244 - add "/sbin/ip route flush proto zebra" to zebra RH init on startup
245
246 * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
247 - update to current CVS
248 - add OSPF point to multipoint patch
249 - add OSPF bugfixes
250 - add BGP hash optimisation patch
251
252 * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
253 - update to 0.93-pre1 / CVS
254 - add link state detection support
255 - add generic PtP and RFC3021 support
256 - various bug fixes
257
258 * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
259 - Fix bug #51336
260
261 * Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
262 - Use generic initscript strings instead of initscript specific
263 ( "Starting foo: " -> "Starting $prog:" )
264
265 * Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
266 - Bump the release when rebuilding into the dist.
267
268 * Tue Feb 6 2001 Tim Powers <timp@redhat.com>
269 - built for Powertools
270
271 * Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
272 - Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
273 - Update to 0.91a
274 - Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
275 - Should be quite Red Hat'isque now.