zebra.spec 4.5 KB

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