bind.spec 6.1 KB

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