bind.spec 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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: 20011121.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 >= 0.9-20011025.0
  49. PreReq: OpenPKG, openpkg >= 0.9-20011025.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. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/bind/* > /dev/null 2>&1 || true
  128. # install manual pages
  129. ( cd doc/man
  130. for i in 1 8; do
  131. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man$i
  132. %{l_shtool} install -c *.$i $RPM_BUILD_ROOT%{l_prefix}/man/man$i/
  133. done
  134. )
  135. # remove superfluous manual pages
  136. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/mkdep.1
  137. # install run-command script
  138. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  139. %{l_shtool} install -c -m 755 \
  140. -e 's;@l_prefix@;%{l_prefix};g' \
  141. -e 's;@l_fsusr@;%{l_fsusr};g' \
  142. -e 's;@l_fsgrp@;%{l_fsgrp};g' \
  143. %{SOURCE rc.bind} \
  144. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  145. # install a reasonable default configuration
  146. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind
  147. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  148. %{SOURCE named.conf} \
  149. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
  150. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db
  151. %{l_shtool} install -c -m 644 \
  152. %{SOURCE db.127.0.0} \
  153. %{SOURCE db.localhost} \
  154. %{SOURCE db.root} \
  155. %{SOURCE db.root.sh} \
  156. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/
  157. # create an empty var directory
  158. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/bind
  159. # determine the installed files
  160. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  161. %{l_files_std} \
  162. '%config %{l_prefix}/etc/bind/named.conf' \
  163. '%config %{l_prefix}/etc/bind/named.db/*'
  164. egrep -v "/(bin|man1)/" files >files-sys
  165. egrep -v "/(etc|libexec|sbin|man8|var)/" files >files-usr
  166. %files sys -f files-sys
  167. %files usr -f files-usr
  168. %clean
  169. rm -rf $RPM_BUILD_ROOT
  170. %pre
  171. if [ $1 -gt 1 ]; then
  172. # stop daemon before any upgrade
  173. $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
  174. fi
  175. %preun
  176. if [ $1 -eq 0 ]; then
  177. # stop daemon before removing package
  178. $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1
  179. # remove dynamically generated files
  180. rm -f $RPM_INSTALL_PREFIX/var/bind/*
  181. fi