quagga.spec.in 10 KB

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