bind8.spec 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.1
  35. Release: 20020306
  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. %patch0 -p0
  64. %build
  65. PATH="%{l_prefix}/bin:$PATH"; export PATH
  66. cd src
  67. # make sure BIND accepts our overriding parameters later
  68. systype=`sh ./port/systype`
  69. rm -f .settings .systype
  70. echo "'DESTINC=/dummy'" >>port/$systype/Makefile.set
  71. echo "'DESTLIB=/dummy'" >>port/$systype/Makefile.set
  72. # find a reasonable compiler, but because of BIND v8's
  73. # system dependend linking stuff, we have to use the vendor
  74. # version on some platforms.
  75. cc="%{l_cc}"
  76. case $systype in
  77. freebsd ) cc="/usr/bin/cc" ;;
  78. esac
  79. cc="$cc"
  80. # now configure and build the package
  81. %{l_make} %{l_mflags} \
  82. CC="$cc" \
  83. DESTDIR="$RPM_BUILD_ROOT" \
  84. DESTBIN="%{l_prefix}/bin" \
  85. DESTSBIN="%{l_prefix}/sbin" \
  86. DESTEXEC="%{l_prefix}/libexec/bind" \
  87. DESTHELP="%{l_prefix}/etc/bind" \
  88. DESTETC="%{l_prefix}/etc/bind" \
  89. DESTINC="%{l_prefix}/include/bind" \
  90. DESTLIB="%{l_prefix}/lib" \
  91. DESTRUN="%{l_prefix}/var/bind"
  92. %install
  93. rm -rf $RPM_BUILD_ROOT
  94. PATH="%{l_prefix}/bin:$PATH"; export PATH
  95. # install the standard stuff
  96. ( cd src
  97. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT INSTALL_LIB=""
  98. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  99. )
  100. # strip down installation
  101. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/mkservdb
  102. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/bind/nslookup.help
  103. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  104. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/irpd
  106. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* > /dev/null 2>&1 || true
  107. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* > /dev/null 2>&1 || true
  108. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/bind/* > /dev/null 2>&1 || true
  109. # install manual pages
  110. ( cd doc/man
  111. for i in 1 8; do
  112. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man$i
  113. %{l_shtool} install -c *.$i $RPM_BUILD_ROOT%{l_prefix}/man/man$i/
  114. done
  115. )
  116. # remove superfluous manual pages
  117. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/mkdep.1
  118. # install run-command script
  119. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  120. %{l_shtool} install -c -m 755 \
  121. -e 's;@l_prefix@;%{l_prefix};g' \
  122. -e 's;@l_fsusr@;%{l_fsusr};g' \
  123. -e 's;@l_fsgrp@;%{l_fsgrp};g' \
  124. %{SOURCE rc.bind} \
  125. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  126. # install a reasonable default configuration
  127. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind
  128. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  129. %{SOURCE named.conf} \
  130. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
  131. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db
  132. %{l_shtool} install -c -m 644 \
  133. %{SOURCE db.127.0.0} \
  134. %{SOURCE db.localhost} \
  135. %{SOURCE db.root} \
  136. %{SOURCE db.root.sh} \
  137. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/
  138. # create an empty var directory
  139. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/bind
  140. # determine the installed files
  141. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  142. %{l_files_std} \
  143. '%config %{l_prefix}/etc/bind/named.conf' \
  144. '%config %{l_prefix}/etc/bind/named.db/*'
  145. %files -f files
  146. %clean
  147. rm -rf $RPM_BUILD_ROOT
  148. %pre
  149. if [ $1 -gt 1 ]; then
  150. # stop daemon before any upgrade
  151. $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
  152. fi
  153. %preun
  154. if [ $1 -eq 0 ]; then
  155. # stop daemon before removing package
  156. $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
  157. # remove dynamically generated files
  158. rm -f $RPM_INSTALL_PREFIX/var/bind/*
  159. fi