bind.spec 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. ##
  2. ## bind.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2001 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: bind
  27. Summary: Berkeley Internet Name Domain (BIND)
  28. URL: http://www.isc.org/products/BIND/
  29. Vendor: Free Software Foundation
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [REL]
  32. Group: DNS
  33. License: GPL
  34. Version: 8.2.5
  35. Release: 20011201.0
  36. # list of sources
  37. Source0: ftp://ftp.isc.org/isc/bind/src/%{version}/bind-src.tar.gz
  38. Source1: ftp://ftp.isc.org/isc/bind/src/%{version}/bind-doc.tar.gz
  39. Source2: db.root
  40. Source3: db.root.sh
  41. Source4: db.localhost
  42. Source5: db.127.0.0
  43. Source6: named.conf
  44. Source7: rc.bind
  45. Patch0: bind.patch
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20011126.0, make, flex, bison
  50. PreReq: OpenPKG, openpkg >= 20011126.0
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. Berkeley Internet Name Domain (BIND) is an implementation of
  55. the Domain Name System (DNS) protocols and provides an openly
  56. redistributable reference implementation of the major components
  57. of the Domain Name System, including a Domain Name System server
  58. (named)
  59. %prep
  60. %setup0 -q -c -n bind-%{version}
  61. %setup1 -q -T -D -a 1
  62. %patch0 -p0
  63. %build
  64. PATH="%{l_prefix}/bin:$PATH"; export PATH
  65. cd src
  66. # make sure BIND accepts our overriding parameters later
  67. systype=`sh ./port/systype`
  68. rm -f .settings .systype
  69. echo "'DESTINC=/dummy'" >>port/$systype/Makefile.set
  70. echo "'DESTLIB=/dummy'" >>port/$systype/Makefile.set
  71. # find a reasonable compiler, but because of BIND v8's
  72. # system dependend linking stuff, we have to use the vendor
  73. # version on some platforms.
  74. cc="%{l_cc}"
  75. case $systype in
  76. freebsd ) cc="/usr/bin/cc" ;;
  77. esac
  78. cc="$cc -I%{l_prefix}/include -L%{l_prefix}/lib";
  79. # now configure and build the package
  80. %{l_make} %{l_mflags} \
  81. CC="$cc" \
  82. DESTDIR="$RPM_BUILD_ROOT" \
  83. DESTBIN="%{l_prefix}/bin" \
  84. DESTSBIN="%{l_prefix}/sbin" \
  85. DESTEXEC="%{l_prefix}/libexec/bind" \
  86. DESTHELP="%{l_prefix}/etc/bind" \
  87. DESTETC="%{l_prefix}/etc/bind" \
  88. DESTINC="%{l_prefix}/include/bind" \
  89. DESTLIB="%{l_prefix}/lib" \
  90. DESTRUN="%{l_prefix}/var/bind"
  91. %install
  92. rm -rf $RPM_BUILD_ROOT
  93. PATH="%{l_prefix}/bin:$PATH"; export PATH
  94. # install the standard stuff
  95. ( cd src
  96. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT INSTALL_LIB=""
  97. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  98. )
  99. # strip down installation
  100. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/mkservdb
  101. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/bind/nslookup.help
  102. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  103. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/irpd
  105. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* > /dev/null 2>&1 || true
  106. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* > /dev/null 2>&1 || true
  107. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/bind/* > /dev/null 2>&1 || true
  108. # install manual pages
  109. ( cd doc/man
  110. for i in 1 8; do
  111. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man$i
  112. %{l_shtool} install -c *.$i $RPM_BUILD_ROOT%{l_prefix}/man/man$i/
  113. done
  114. )
  115. # remove superfluous manual pages
  116. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/mkdep.1
  117. # install run-command script
  118. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  119. %{l_shtool} install -c -m 755 \
  120. -e 's;@l_prefix@;%{l_prefix};g' \
  121. -e 's;@l_fsusr@;%{l_fsusr};g' \
  122. -e 's;@l_fsgrp@;%{l_fsgrp};g' \
  123. %{SOURCE rc.bind} \
  124. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  125. # install a reasonable default configuration
  126. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind
  127. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  128. %{SOURCE named.conf} \
  129. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
  130. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db
  131. %{l_shtool} install -c -m 644 \
  132. %{SOURCE db.127.0.0} \
  133. %{SOURCE db.localhost} \
  134. %{SOURCE db.root} \
  135. %{SOURCE db.root.sh} \
  136. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/
  137. # create an empty var directory
  138. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/bind
  139. # determine the installed files
  140. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  141. %{l_files_std} \
  142. '%config %{l_prefix}/etc/bind/named.conf' \
  143. '%config %{l_prefix}/etc/bind/named.db/*'
  144. %files -f files
  145. %clean
  146. rm -rf $RPM_BUILD_ROOT
  147. %pre
  148. if [ $1 -gt 1 ]; then
  149. # stop daemon before any upgrade
  150. $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
  151. fi
  152. %preun
  153. if [ $1 -eq 0 ]; then
  154. # stop daemon before removing package
  155. $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
  156. # remove dynamically generated files
  157. rm -f $RPM_INSTALL_PREFIX/var/bind/*
  158. fi