quagga.spec.in 11 KB

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