zebra.spec 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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. Summary: Routing daemon
  13. Name: zebra
  14. Version: 0.93b
  15. Release: 2002111101
  16. License: GPL
  17. Group: System Environment/Daemons
  18. Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
  19. Source1: zebra.init
  20. Source2: bgpd.init
  21. Source3: ospf6d.init
  22. Source4: ospfd.init
  23. Source5: ripd.init
  24. Source6: ripngd.init
  25. Source8: zebra.pam
  26. Source9: zebra.logrotate
  27. Source10: zebra.mpls-docs.tar.gz
  28. Patch0: zebra-bgpd-hash.patch
  29. Patch1: zebra-ptp.patch
  30. Patch2: zebra-linkstate.patch
  31. Patch3: zebra-ospfd-ptmp.patch
  32. Patch4: zebra-ospfd-misc.patch
  33. Patch5: zebra-ospfd-olsa.patch
  34. Patch7: zebra-vtysh-write-config.patch
  35. Patch8: zebra-ospfd-md5auth-seqnum.patch
  36. Patch9: zebra-ospfd-oi_write_q.patch
  37. Patch10: zebra-ripv1-netmask.patch
  38. Patch11: zebra-ospfd-md5-buffer-fix.patch
  39. Patch12: zebra-multi.patch
  40. URL: http://www.zebra.org/
  41. %if %with_snmp
  42. BuildRequires: ucd-snmp-devel
  43. Prereq: ucd-snmp
  44. %endif
  45. %if %with_vtysh
  46. BuildRequires: readline readline-devel ncurses ncuses-devel
  47. Prereq: readline ncurses
  48. %endif
  49. BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
  50. # Initscripts > 5.60 is required for IPv6 support
  51. Prereq: openssl ncurses readline initscripts pam
  52. Prereq: /sbin/install-info
  53. Provides: routingdaemon
  54. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  55. Obsoletes: bird gated mrt
  56. %description
  57. GNU Zebra is a free software that manages TCP/IP based routing
  58. protocol. It takes multi-server and multi-thread approach to resolve
  59. the current complexity of the Internet.
  60. GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
  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. %prep
  66. %setup -q
  67. %patch0 -p1 -b .bgphash
  68. %patch1 -p0 -b .ptp
  69. %patch2 -p1 -b .linkstate
  70. %patch3 -p1 -b .ospf-ptmp
  71. %patch4 -p1 -b .ospf-misc
  72. %patch5 -p1 -b .ospf-olsa
  73. %patch7 -p1 -b .vtysh-write
  74. %patch8 -p2 -b .ospf-md5auth-seqnum
  75. %patch9 -p0 -b .ospfd-oi_write_q
  76. %patch10 -p0 -b .ripd-netmask
  77. %patch11 -p0 -b .ospfd-md5-buffer
  78. %patch12 -p0 -b .zebra-multi
  79. %{__tar} -zxf %{SOURCE10}
  80. %build
  81. %configure \
  82. --with-cflags="-O2" \
  83. --enable-netlink \
  84. %if %with_ipv6
  85. --enable-ipv6 \
  86. %endif
  87. %if %with_snmp
  88. --enable-snmp \
  89. %endif
  90. %if %with_multipath
  91. --enable-multipath=%with_multipath \
  92. %endif
  93. %if %with_tcp_zebra
  94. --enable-tcp-zebra \
  95. %endif
  96. %if %with_nssa
  97. --enable-nssa \
  98. %endif
  99. %if %with_opaque_lsa
  100. --enable-opaque-lsa \
  101. %endif
  102. %if %with_ospf_te
  103. --enable-ospf-te \
  104. %endif
  105. %if %with_vtysh
  106. --enable-vtysh \
  107. %endif
  108. %if %with_pam
  109. --with-libpam
  110. %endif
  111. pushd vtysh
  112. make %{?_smp_mflags} rebuild
  113. popd
  114. make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
  115. pushd doc
  116. texi2html zebra.texi
  117. popd
  118. %install
  119. rm -rf $RPM_BUILD_ROOT
  120. install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
  121. $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
  122. make install \
  123. DESTDIR=$RPM_BUILD_ROOT
  124. install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
  125. install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
  126. %if %with_ipv6
  127. install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
  128. %endif
  129. install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
  130. install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
  131. %if %with_ipv6
  132. install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
  133. %endif
  134. install -m644 %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/zebra
  135. install -m644 %{SOURCE9} $RPM_BUILD_ROOT/etc/logrotate.d/zebra
  136. %post
  137. # zebra_spec_add_service <sercice name> <port/proto> <comment>
  138. # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
  139. zebra_spec_add_service ()
  140. {
  141. # Add port /etc/services entry if it isn't already there
  142. if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
  143. echo "$1 $2 # $3" >> /etc/services
  144. fi
  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"
  149. %if %with_ipv6
  150. zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
  151. %endif
  152. zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
  153. zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
  154. %if %with_ipv6
  155. zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
  156. %endif
  157. /sbin/chkconfig --add zebra
  158. /sbin/chkconfig --add ripd
  159. %if %with_ipv6
  160. /sbin/chkconfig --add ripngd
  161. %endif
  162. /sbin/chkconfig --add ospfd
  163. %if %with_ipv6
  164. /sbin/chkconfig --add ospf6d
  165. %endif
  166. /sbin/chkconfig --add bgpd
  167. /sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
  168. # Create dummy files if they don't exist so basic functions can be used.
  169. if [ ! -e %{_sysconfdir}/zebra.conf ]; then
  170. echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
  171. chmod 640 %{_sysconfdir}/zebra.conf
  172. fi
  173. if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
  174. touch %{_sysconfdir}/vtysh.conf
  175. chmod 640 %{_sysconfdir}/vtysh.conf
  176. fi
  177. %postun
  178. if [ "$1" -ge "1" ]; then
  179. /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
  180. /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
  181. %if %with_ipv6
  182. /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
  183. %endif
  184. /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
  185. %if %with_ipv6
  186. /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
  187. %endif
  188. /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
  189. fi
  190. /sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
  191. %preun
  192. if [ "$1" = "0" ]; then
  193. /sbin/chkconfig --del zebra
  194. /sbin/chkconfig --del ripd
  195. %if %with_ipv6
  196. /sbin/chkconfig --del ripngd
  197. %endif
  198. /sbin/chkconfig --del ospfd
  199. %if %with_ipv6
  200. /sbin/chkconfig --del ospf6d
  201. %endif
  202. /sbin/chkconfig --del bgpd
  203. fi
  204. %clean
  205. #rm -rf $RPM_BUILD_ROOT
  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. %if %with_vtysh
  217. %{_bindir}/*
  218. %endif
  219. %config /etc/zebra/*
  220. %config /etc/rc.d/init.d/*
  221. %config(noreplace) /etc/pam.d/zebra
  222. %config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
  223. %changelog
  224. * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
  225. - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
  226. - Fixed up some build requirements (patch)
  227. - Added conditional build requirements for vtysh / snmp
  228. - Added conditional to %files for %_bindir depending on vtysh
  229. * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
  230. - update to latest CVS
  231. - add Greg Troxel's md5 buffer copy/dup fix
  232. - add RIPv1 fix
  233. - add Frank's multicast flag fix
  234. * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
  235. - update to latest CVS
  236. - timestamped crypt_seqnum patch
  237. - oi->on_write_q fix
  238. * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
  239. - update to latest CVS
  240. - add vtysh 'write-config (integrated|daemon)' patch
  241. - always 'make rebuild' in vtysh/ to catch new commands
  242. * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
  243. - update to 0.93b
  244. * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
  245. - update to latest CVS
  246. - add "/sbin/ip route flush proto zebra" to zebra RH init on startup
  247. * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
  248. - update to current CVS
  249. - add OSPF point to multipoint patch
  250. - add OSPF bugfixes
  251. - add BGP hash optimisation patch
  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. * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
  258. - Fix bug #51336
  259. * Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
  260. - Use generic initscript strings instead of initscript specific
  261. ( "Starting foo: " -> "Starting $prog:" )
  262. * Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
  263. - Bump the release when rebuilding into the dist.
  264. * Tue Feb 6 2001 Tim Powers <timp@redhat.com>
  265. - built for Powertools
  266. * Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
  267. - Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
  268. - Update to 0.91a
  269. - Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
  270. - Should be quite Red Hat'isque now.