bind8.spec 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ##
  2. ## bind8.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 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: bind8
  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.3.3
  35. Release: 20020703
  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 >= 20011227, make, flex, bison
  50. PreReq: OpenPKG, openpkg >= 20011227
  51. AutoReq: no
  52. AutoReqProv: no
  53. Conflicts: bind
  54. %description
  55. Berkeley Internet Name Domain (BIND) is an implementation of
  56. the Domain Name System (DNS) protocols and provides an openly
  57. redistributable reference implementation of the major components
  58. of the Domain Name System, including a Domain Name System server
  59. (named)
  60. %prep
  61. %setup0 -q -c -n bind8-%{version}
  62. %setup1 -q -T -D -a 1
  63. ## FIXME: surely we need the patch for Linux only but those do not work
  64. ## as documented in RPM-HOWTO. Any hints how to work around the
  65. ## situation without requireing external patch program?
  66. %ifarch linux2.2
  67. %patch0 -p0
  68. %endif
  69. %build
  70. PATH="%{l_prefix}/bin:$PATH"; export PATH
  71. cd src
  72. # make sure BIND accepts our overriding parameters later
  73. systype=`sh ./port/systype`
  74. rm -f .settings .systype
  75. echo "'DESTINC=/dummy'" >>port/$systype/Makefile.set
  76. echo "'DESTLIB=/dummy'" >>port/$systype/Makefile.set
  77. # find a reasonable compiler, but because of BIND v8's
  78. # system dependend linking stuff, we have to use the vendor
  79. # version on some platforms.
  80. cc="%{l_cc}"
  81. case $systype in
  82. freebsd ) cc="/usr/bin/cc" ;;
  83. esac
  84. cc="$cc"
  85. # now configure and build the package
  86. %{l_make} %{l_mflags} \
  87. CC="$cc" \
  88. DESTDIR="$RPM_BUILD_ROOT" \
  89. DESTBIN="%{l_prefix}/bin" \
  90. DESTSBIN="%{l_prefix}/sbin" \
  91. DESTEXEC="%{l_prefix}/libexec/bind" \
  92. DESTHELP="%{l_prefix}/etc/bind" \
  93. DESTETC="%{l_prefix}/etc/bind" \
  94. DESTINC="%{l_prefix}/include/bind" \
  95. DESTLIB="%{l_prefix}/lib" \
  96. DESTRUN="%{l_prefix}/var/bind"
  97. %install
  98. rm -rf $RPM_BUILD_ROOT
  99. PATH="%{l_prefix}/bin:$PATH"; export PATH
  100. # install the standard stuff
  101. ( cd src
  102. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT INSTALL_LIB=""
  103. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  104. )
  105. # strip down installation
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/mkservdb
  107. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/bind/nslookup.help
  108. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  109. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  110. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/irpd
  111. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* > /dev/null 2>&1 || true
  112. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* > /dev/null 2>&1 || true
  113. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/bind/* > /dev/null 2>&1 || true
  114. # install manual pages
  115. ( cd doc/man
  116. for i in 1 8; do
  117. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man$i
  118. %{l_shtool} install -c *.$i $RPM_BUILD_ROOT%{l_prefix}/man/man$i/
  119. done
  120. )
  121. # remove superfluous manual pages
  122. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/mkdep.1
  123. # install run-command script
  124. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  125. %{l_shtool} install -c -m 755 \
  126. -e 's;@l_prefix@;%{l_prefix};g' \
  127. -e 's;@l_musr@;%{l_musr};g' \
  128. -e 's;@l_mgrp@;%{l_mgrp};g' \
  129. %{SOURCE rc.bind} \
  130. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  131. # install a reasonable default configuration
  132. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind
  133. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  134. %{SOURCE named.conf} \
  135. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
  136. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db
  137. %{l_shtool} install -c -m 644 \
  138. %{SOURCE db.127.0.0} \
  139. %{SOURCE db.localhost} \
  140. %{SOURCE db.root} \
  141. %{SOURCE db.root.sh} \
  142. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/
  143. # create an empty var directory
  144. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/bind
  145. # determine the installed files
  146. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  147. %{l_files_std} \
  148. '%config %{l_prefix}/etc/bind/named.conf' \
  149. '%config %{l_prefix}/etc/bind/named.db/*'
  150. %files -f files
  151. %clean
  152. rm -rf $RPM_BUILD_ROOT
  153. %pre
  154. if [ $1 -gt 1 -a -e $RPM_INSTALL_PREFIX/var/bind/ndc ]; then
  155. # stop daemon before any upgrade
  156. $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
  157. fi
  158. %preun
  159. if [ $1 -eq 0 -a -e $RPM_INSTALL_PREFIX/var/bind/ndc ]; then
  160. # stop daemon before removing package
  161. $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
  162. # remove dynamically generated files
  163. rm -f $RPM_INSTALL_PREFIX/var/bind/*
  164. fi