zebra.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. ##
  2. ## zebra.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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: zebra
  27. Summary: Internet Routing Daemon
  28. URL: http://www.zebra.org/
  29. Vendor: Kunihiro Ishiguro
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: Network
  33. License: GPL
  34. Version: 0.93b
  35. Release: 20030707
  36. # list of sources
  37. Source0: ftp://ftp.zebra.org/pub/zebra/zebra-%{version}.tar.gz
  38. Source1: rc.zebra
  39. Source2: bgpd.conf
  40. Source3: ospfd.conf
  41. Source4: ripd.conf
  42. Source5: zebra.conf
  43. Source6: vtysh.conf
  44. Patch0: zebra.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20020206, gcc, perl
  49. PreReq: OpenPKG, openpkg >= 20020206
  50. BuildPreReq: readline
  51. PreReq: readline
  52. AutoReq: no
  53. AutoReqProv: no
  54. %description
  55. GNU Zebra is free software (distributed under GNU Generic Public
  56. License) that manages TCP/IP based routing protocols. It supports
  57. BGP-4 protocol as described in RFC1771 (A Border Gateway Protocol
  58. 4) as well as RIPv1, RIPv2 and OSPFv2. Unlike traditional, Gated
  59. based, monolithic architectures and even the so-called "new modular
  60. 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. %patch -p0
  66. %build
  67. # patch configure script for correct pid directory
  68. %{l_shtool} subst \
  69. -e 's;^ac_piddir=\$ZEBRA_PID_DIR;ac_piddir=%{l_prefix}/var/zebra;' \
  70. configure
  71. # configure package
  72. CC="%{l_cc}" \
  73. CFLAGS="%{l_cflags -O}" \
  74. CPPFLAGS="%{l_cppflags}" \
  75. LDFLAGS="%{l_ldflags}" \
  76. ./configure \
  77. --prefix=%{l_prefix} \
  78. --sysconfdir=%{l_prefix}/etc/zebra \
  79. --enable-vtysh \
  80. --disable-ospf6d \
  81. --disable-ripngd \
  82. --disable-ipv6 \
  83. --without-libpam
  84. # rebuild vtysh command list
  85. ( cd vtysh
  86. %{l_shtool} subst -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;g' extract.pl
  87. %{l_make} %{l_mflags} rebuild )
  88. # build package
  89. %{l_make} %{l_mflags -O}
  90. %install
  91. rm -rf $RPM_BUILD_ROOT
  92. # install package
  93. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  94. # strip down package
  95. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/ospf6d.8
  96. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/ripngd.8
  97. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  98. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  99. # replace default configuration
  100. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/zebra/*
  101. %{l_shtool} install -c -m 600 \
  102. -e 's;@l_prefix@;%{l_prefix};g' \
  103. %{SOURCE zebra.conf} %{SOURCE vtysh.conf} \
  104. %{SOURCE ripd.conf} %{SOURCE ospfd.conf} %{SOURCE bgpd.conf} \
  105. $RPM_BUILD_ROOT%{l_prefix}/etc/zebra/
  106. %{l_shtool} install -c -m 600 /dev/null \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/zebra/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 \
  112. -e 's;@l_prefix@;%{l_prefix};g' \
  113. -e 's;@l_susr@;%{l_susr};g' \
  114. %{SOURCE rc.zebra} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  115. # make sure pid and log directory exists
  116. %{l_shtool} mkdir -f -p -m 755 \
  117. $RPM_BUILD_ROOT%{l_prefix}/var/zebra
  118. # determine package file list
  119. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  120. %{l_files_std} \
  121. '%config %{l_prefix}/etc/zebra/*'
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT
  125. %preun
  126. if [ $1 -eq 0 ]; then
  127. $RPM_INSTALL_PREFIX/etc/rc zebra stop
  128. rm -f $RPM_INSTALL_PREFIX/var/zebra/*.log
  129. rm -f $RPM_INSTALL_PREFIX/var/zebra/*.pid
  130. fi