quagga.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. ##
  2. ## quagga.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: quagga
  27. Summary: Internet Routing Daemon
  28. URL: http://www.quagga.net/
  29. Vendor: Kunihiro Ishiguro
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Network
  33. License: GPL
  34. Version: 0.96.2
  35. Release: 20031001
  36. # list of sources
  37. Source0: http://www.quagga.net/download/quagga-%{version}.tar.gz
  38. Source1: rc.quagga
  39. Source2: bgpd.conf
  40. Source3: ospfd.conf
  41. Source4: ripd.conf
  42. Source5: zebra.conf
  43. Source6: vtysh.conf
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030718, gcc, perl
  48. PreReq: OpenPKG, openpkg >= 20030718
  49. BuildPreReq: readline
  50. PreReq: readline
  51. AutoReq: no
  52. AutoReqProv: no
  53. Conflicts: zebra
  54. %description
  55. Quagga (a fork of GNU Zebra) is free software (distributed under GNU
  56. Generic Public License) that manages TCP/IP based routing protocols.
  57. It supports BGP-4 protocol as described in RFC1771 (A Border Gateway
  58. Protocol 4) as well as RIPv1, RIPv2 and OSPFv2. Unlike traditional,
  59. Gated based, monolithic architectures and even the so-called "new
  60. modular architectures" that remove the burden of processing routing
  61. functions from the CPU and utilize special ASIC chips instead, Zebra
  62. software offers true modularity.
  63. %prep
  64. %setup -q
  65. %build
  66. # configure package
  67. CC="%{l_cc}" \
  68. CFLAGS="%{l_cflags -O}" \
  69. CPPFLAGS="%{l_cppflags}" \
  70. LDFLAGS="%{l_ldflags}" \
  71. ./configure \
  72. --prefix=%{l_prefix} \
  73. --sysconfdir=%{l_prefix}/etc/quagga \
  74. --localstatedir=%{l_prefix}/var/quagga \
  75. --enable-vtysh \
  76. --disable-ospf6d \
  77. --disable-ripngd \
  78. --disable-ipv6 \
  79. --without-libpam
  80. # build package
  81. %{l_make} %{l_mflags -O}
  82. %install
  83. rm -rf $RPM_BUILD_ROOT
  84. # install package
  85. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  86. # strip down package
  87. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/ospf6d.8
  88. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/ripngd.8
  89. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  90. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  91. # replace default configuration
  92. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/quagga/*
  93. %{l_shtool} install -c -m 600 %{l_value -s -a} \
  94. %{SOURCE zebra.conf} %{SOURCE vtysh.conf} \
  95. %{SOURCE ripd.conf} %{SOURCE ospfd.conf} %{SOURCE bgpd.conf} \
  96. $RPM_BUILD_ROOT%{l_prefix}/etc/quagga/
  97. %{l_shtool} install -c -m 600 /dev/null \
  98. $RPM_BUILD_ROOT%{l_prefix}/etc/quagga/zebra.conf.integrate
  99. # install run-command script
  100. %{l_shtool} mkdir -f -p -m 755 \
  101. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  102. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  103. %{SOURCE rc.quagga} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  104. # make sure pid and log directory exists
  105. %{l_shtool} mkdir -f -p -m 755 \
  106. $RPM_BUILD_ROOT%{l_prefix}/var/quagga
  107. # determine package file list
  108. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  109. %{l_files_std} \
  110. '%config %{l_prefix}/etc/quagga/*'
  111. %files -f files
  112. %clean
  113. rm -rf $RPM_BUILD_ROOT
  114. %post
  115. # after upgrade, restart service
  116. [ $1 -eq 2 ] || exit 0
  117. eval `%{l_rc} quagga status 2>/dev/null`
  118. [ ".$quagga_active" = .yes ] && %{l_rc} quagga restart
  119. exit 0
  120. %preun
  121. # before erase, stop service and remove log files
  122. [ $1 -eq 0 ] || exit 0
  123. %{l_rc} quagga stop 2>/dev/null
  124. rm -f $RPM_INSTALL_PREFIX/var/quagga/quagga.log* >/dev/null 2>&1 || true
  125. exit 0