quagga.spec.in 11 KB

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