quagga.spec.in 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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. --with-cflags="-O2" \
  119. --enable-netlink
  120. make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
  121. pushd doc
  122. texi2html quagga.texi
  123. popd
  124. %install
  125. rm -rf $RPM_BUILD_ROOT
  126. install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
  127. $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
  128. make install \
  129. DESTDIR=$RPM_BUILD_ROOT
  130. # Remove this file, as it is uninstalled and causes errors when building on RH9
  131. rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
  132. install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
  133. install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
  134. %if %with_ipv6
  135. install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
  136. install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
  137. %endif
  138. install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
  139. install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
  140. install -m644 %{zeb_rh_src}/quagga.pam $RPM_BUILD_ROOT/etc/pam.d/quagga
  141. install -m644 %{zeb_rh_src}/quagga.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/quagga
  142. install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
  143. %pre
  144. # add vty_group
  145. %if %vty_group
  146. groupadd -r %vty_group 2> /dev/null || :
  147. %endif
  148. # add quagga user and group
  149. %if %quagga_user
  150. /usr/sbin/useradd -M -r -s /bin/false -c "Quagga routing suite" \
  151. -d %_localstatedir %quagga_user 2> /dev/null || :
  152. %endif
  153. %post
  154. # zebra_spec_add_service <service name> <port/proto> <comment>
  155. # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
  156. zebra_spec_add_service ()
  157. {
  158. # Add port /etc/services entry if it isn't already there
  159. if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
  160. echo "$1 $2 # $3" >> /etc/services
  161. fi
  162. }
  163. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
  164. zebra_spec_add_service zebra 2601/tcp "zebra vty"
  165. zebra_spec_add_service ripd 2602/tcp "RIPd vty"
  166. %if %with_ipv6
  167. zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
  168. %endif
  169. zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
  170. zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
  171. %if %with_ipv6
  172. zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
  173. %endif
  174. %if %with_ospfapi
  175. zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
  176. %endif
  177. /sbin/chkconfig --add zebra
  178. /sbin/chkconfig --add ripd
  179. %if %with_ipv6
  180. /sbin/chkconfig --add ripngd
  181. /sbin/chkconfig --add ospf6d
  182. %endif
  183. /sbin/chkconfig --add ospfd
  184. /sbin/chkconfig --add bgpd
  185. /sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
  186. # Create dummy files if they don't exist so basic functions can be used.
  187. if [ ! -e %{_sysconfdir}/zebra.conf ]; then
  188. echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
  189. chmod 640 %{_sysconfdir}/zebra.conf
  190. fi
  191. if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
  192. touch %{_sysconfdir}/vtysh.conf
  193. chmod 640 %{_sysconfdir}/vtysh.conf
  194. fi
  195. %postun
  196. if [ "$1" -ge "1" ]; then
  197. /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
  198. /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
  199. %if %with_ipv6
  200. /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
  201. %endif
  202. /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
  203. %if %with_ipv6
  204. /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
  205. %endif
  206. /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
  207. fi
  208. /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
  209. %preun
  210. if [ "$1" = "0" ]; then
  211. /sbin/chkconfig --del zebra
  212. /sbin/chkconfig --del ripd
  213. %if %with_ipv6
  214. /sbin/chkconfig --del ripngd
  215. %endif
  216. /sbin/chkconfig --del ospfd
  217. %if %with_ipv6
  218. /sbin/chkconfig --del ospf6d
  219. %endif
  220. /sbin/chkconfig --del bgpd
  221. fi
  222. %clean
  223. #rm -rf $RPM_BUILD_ROOT
  224. %files
  225. %defattr(-,root,root)
  226. %doc */*.sample* AUTHORS COPYING
  227. %doc doc/quagga.html
  228. %doc doc/mpls
  229. %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
  230. %if %quagga_user
  231. %dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
  232. %dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
  233. %dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
  234. %else
  235. %dir %attr(750,root,root) %{_sysconfdir}
  236. %dir %attr(750,root,root) /var/log/quagga
  237. %dir %attr(755,root,root) /usr/share/info
  238. %dir %attr(750,root,root) /var/run/quagga
  239. %endif
  240. %if %vty_group
  241. %attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
  242. %endif
  243. %{_infodir}/*info*
  244. %{_mandir}/man*/*
  245. %{_sbindir}/*
  246. %if %with_vtysh
  247. %{_bindir}/*
  248. %endif
  249. %config /etc/quagga/[!v]*
  250. %config /etc/rc.d/init.d/*
  251. %config(noreplace) /etc/pam.d/quagga
  252. %config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
  253. %files contrib
  254. %defattr(-,root,root)
  255. %doc tools
  256. %files devel
  257. %defattr(-,root,root)
  258. %dir %{_libdir}/*
  259. %dir %{_includedir}/*.h
  260. %dir %{_includedir}/ospfd/*
  261. %if %with_ospfapi
  262. %dir %{_includedir}/ospfapi/*
  263. %endif
  264. %changelog
  265. * Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
  266. - Fix -devel package to include all files
  267. - Sync to 0.96.4
  268. * Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
  269. - Renamed to Quagga
  270. - Sync to Quagga release 0.96
  271. * Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
  272. - zebra privileges support
  273. * Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
  274. - Fix mem leak in 'show thread cpu'
  275. - Ralph Keller's OSPF-API
  276. - Amir: Fix configure.ac for net-snmp
  277. * Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
  278. - ospfd IOS prefix to interface matching for 'network' statement
  279. - temporary fix for PtP and IPv6
  280. - sync to zebra.org CVS
  281. * Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
  282. - update to latest cvs
  283. - Yon's "show thread cpu" patch - 17217
  284. - walk up tree - 17218
  285. - ospfd NSSA fixes - 16681
  286. - ospfd nsm fixes - 16824
  287. - ospfd OLSA fixes and new feature - 16823
  288. - KAME and ifindex fixes - 16525
  289. - spec file changes to allow redhat files to be in tree
  290. * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
  291. - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
  292. - Fixed up some build requirements (patch)
  293. - Added conditional build requirements for vtysh / snmp
  294. - Added conditional to %files for %_bindir depending on vtysh
  295. * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
  296. - update to latest CVS
  297. - add Greg Troxel's md5 buffer copy/dup fix
  298. - add RIPv1 fix
  299. - add Frank's multicast flag fix
  300. * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
  301. - update to latest CVS
  302. - timestamped crypt_seqnum patch
  303. - oi->on_write_q fix
  304. * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
  305. - update to latest CVS
  306. - add vtysh 'write-config (integrated|daemon)' patch
  307. - always 'make rebuild' in vtysh/ to catch new commands
  308. * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
  309. - update to 0.93b
  310. * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
  311. - update to latest CVS
  312. - add "/sbin/ip route flush proto zebra" to zebra RH init on startup
  313. * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
  314. - update to current CVS
  315. - add OSPF point to multipoint patch
  316. - add OSPF bugfixes
  317. - add BGP hash optimisation patch
  318. * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
  319. - update to 0.93-pre1 / CVS
  320. - add link state detection support
  321. - add generic PtP and RFC3021 support
  322. - various bug fixes
  323. * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
  324. - Fix bug #51336
  325. * Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
  326. - Use generic initscript strings instead of initscript specific
  327. ( "Starting foo: " -> "Starting $prog:" )
  328. * Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
  329. - Bump the release when rebuilding into the dist.
  330. * Tue Feb 6 2001 Tim Powers <timp@redhat.com>
  331. - built for Powertools
  332. * Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
  333. - Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
  334. - Update to 0.91a
  335. - Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
  336. - Should be quite Red Hat'isque now.