bind.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. ##
  2. ## bind.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 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: Internet Software Foundation
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: DNS
  33. License: ISC
  34. Version: 9.2.1
  35. Release: 20021203
  36. # list of sources
  37. Source0: ftp://ftp.isc.org/isc/bind9/%{version}/bind-%{version}.tar.gz
  38. Source2: db.root
  39. Source3: db.root.sh
  40. Source4: db.localhost
  41. Source5: db.localhost.ipv4
  42. Source6: db.localhost.ipv6
  43. Source7: named.conf
  44. Source8: rndc.conf
  45. Source9: rc.bind
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20021002, make, openssl
  50. PreReq: OpenPKG, openpkg >= 20021002
  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. %setup -q
  61. %build
  62. CC="%{l_cc}" \
  63. CFLAGS="%{l_cflags -O}" \
  64. ./configure \
  65. --prefix=%{l_prefix} \
  66. --sysconfdir=%{l_prefix}/etc/bind \
  67. --localstatedir=%{l_prefix}/var/bind \
  68. --with-openssl=%{l_prefix} \
  69. --with-libtool \
  70. --without-libbind \
  71. --disable-threads \
  72. --disable-shared \
  73. --disable-nls
  74. %{l_make} %{l_mflags}
  75. %install
  76. rm -rf $RPM_BUILD_ROOT
  77. # perform standard install procedure
  78. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  79. # strip down installation
  80. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  81. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  82. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/isc-config.sh
  83. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  84. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  85. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  86. # install BIND9 ARM
  87. %{l_shtool} mkdir -f -p -m 755 \
  88. $RPM_BUILD_ROOT%{l_prefix}/share/bind/
  89. %{l_shtool} install -c -m 644 \
  90. doc/arm/*.html $RPM_BUILD_ROOT%{l_prefix}/share/bind/
  91. # install run-command script
  92. %{l_shtool} mkdir -f -p -m 755 \
  93. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  94. %{l_shtool} install -c -m 755 \
  95. -e 's;@l_prefix@;%{l_prefix};g' \
  96. -e 's;@l_musr@;%{l_musr};g' \
  97. -e 's;@l_mgrp@;%{l_mgrp};g' \
  98. %{SOURCE rc.bind} \
  99. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  100. # install a reasonable default configuration
  101. %{l_shtool} mkdir -f -p -m 755 \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/bind
  103. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  104. %{SOURCE named.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
  105. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  106. %{SOURCE rndc.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
  107. %{l_shtool} mkdir -f -p -m 755 \
  108. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db
  109. %{l_shtool} install -c -m 644 \
  110. %{SOURCE db.localhost} \
  111. %{SOURCE db.localhost.ipv4} \
  112. %{SOURCE db.localhost.ipv6} \
  113. %{SOURCE db.root} \
  114. %{SOURCE db.root.sh} \
  115. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/
  116. # create an empty var directory
  117. %{l_shtool} mkdir -f -p -m 755 \
  118. $RPM_BUILD_ROOT%{l_prefix}/var/bind
  119. # determine the installed files
  120. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  121. %{l_files_std} \
  122. '%config %{l_prefix}/etc/bind/*.conf' \
  123. '%config %{l_prefix}/etc/bind/named.db/*' \
  124. '%dir %attr(-,root,%{l_mgrp}) %{l_prefix}/var/bind'
  125. %files -f files
  126. %clean
  127. rm -rf $RPM_BUILD_ROOT
  128. %post
  129. if [ $1 -eq 1 ]; then
  130. # generate local rndc key
  131. ( echo "Generating RSA key for RNDC operation in $RPM_INSTALL_PREFIX/etc/bind/rndc.key."
  132. echo "Please be patient, this takes a non-deterministic amount of time."
  133. ) | %{l_rpmtool} msg -b -t notice
  134. $RPM_INSTALL_PREFIX/sbin/rndc-confgen -a
  135. chown %{l_musr}:%{l_mgrp} $RPM_INSTALL_PREFIX/etc/bind/rndc.key
  136. elif [ $1 -gt 1 ]; then
  137. # reload daemon
  138. $RPM_INSTALL_PREFIX/sbin/rndc reload >/dev/null 2>&1 || true
  139. fi
  140. %preun
  141. if [ $1 -eq 0 ]; then
  142. # stop daemon
  143. $RPM_INSTALL_PREFIX/sbin/rndc stop >/dev/null 2>&1 || true
  144. # remove dynamically generated files
  145. rm -f $RPM_INSTALL_PREFIX/etc/bind/rndc.key
  146. rm -f $RPM_INSTALL_PREFIX/var/bind/*
  147. fi