bind.spec 7.0 KB

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