quagga.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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.4
  35. Release: 20031102
  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. case "%{l_platform -t}" in
  66. *-freebsd* )
  67. %{l_shtool} subst \
  68. -e 's;UINT32_MAX;UINT_MAX;' \
  69. bgpd/bgp_routemap.c
  70. ;;
  71. esac
  72. %build
  73. # configure package
  74. CC="%{l_cc}" \
  75. CFLAGS="%{l_cflags -O}" \
  76. CPPFLAGS="%{l_cppflags}" \
  77. LDFLAGS="%{l_ldflags}" \
  78. ./configure \
  79. --prefix=%{l_prefix} \
  80. --sysconfdir=%{l_prefix}/etc/quagga \
  81. --localstatedir=%{l_prefix}/var/quagga \
  82. --enable-vtysh \
  83. --disable-ospf6d \
  84. --disable-ripngd \
  85. --disable-ipv6 \
  86. --without-libpam
  87. # build package
  88. %{l_make} %{l_mflags -O}
  89. %install
  90. rm -rf $RPM_BUILD_ROOT
  91. # install package
  92. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  93. # strip down package
  94. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/ospf6d.8
  95. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/ripngd.8
  96. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  97. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  98. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  99. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  100. # replace default configuration
  101. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/quagga/*
  102. %{l_shtool} install -c -m 600 %{l_value -s -a} \
  103. %{SOURCE zebra.conf} %{SOURCE vtysh.conf} \
  104. %{SOURCE ripd.conf} %{SOURCE ospfd.conf} %{SOURCE bgpd.conf} \
  105. $RPM_BUILD_ROOT%{l_prefix}/etc/quagga/
  106. %{l_shtool} install -c -m 600 /dev/null \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/quagga/zebra.conf.integrate
  108. # install run-command script
  109. %{l_shtool} mkdir -f -p -m 755 \
  110. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  111. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  112. %{SOURCE rc.quagga} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  113. # make sure pid and log directory exists
  114. %{l_shtool} mkdir -f -p -m 755 \
  115. $RPM_BUILD_ROOT%{l_prefix}/var/quagga
  116. # determine package file list
  117. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  118. %{l_files_std} \
  119. '%config %{l_prefix}/etc/quagga/*'
  120. %files -f files
  121. %clean
  122. rm -rf $RPM_BUILD_ROOT
  123. %post
  124. # after upgrade, restart service
  125. [ $1 -eq 2 ] || exit 0
  126. eval `%{l_rc} quagga status 2>/dev/null`
  127. [ ".$quagga_active" = .yes ] && %{l_rc} quagga restart
  128. exit 0
  129. %preun
  130. # before erase, stop service and remove log files
  131. [ $1 -eq 0 ] || exit 0
  132. %{l_rc} quagga stop 2>/dev/null
  133. rm -f $RPM_INSTALL_PREFIX/var/quagga/quagga.log* >/dev/null 2>&1 || true
  134. exit 0