bind.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ##
  2. ## bind.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: 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: 20020820
  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.127.0.0
  42. Source6: named.conf
  43. Source7: rndc.conf
  44. Source8: rc.bind
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20020206, make, openssl
  49. PreReq: OpenPKG, openpkg >= 20020206
  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. %prep
  59. %setup -q
  60. %build
  61. CC="%{l_cc}" \
  62. CFLAGS="%{l_cflags -O}" \
  63. ./configure \
  64. --prefix=%{l_prefix} \
  65. --sysconfdir=%{l_prefix}/etc/bind \
  66. --localstatedir=%{l_prefix}/var/bind \
  67. --with-openssl=%{l_prefix} \
  68. --with-libtool \
  69. --without-libbind \
  70. --disable-threads \
  71. --disable-shared \
  72. --disable-nls
  73. %{l_make} %{l_mflags}
  74. %install
  75. rm -rf $RPM_BUILD_ROOT
  76. # perform standard install procedure
  77. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  78. # strip down installation
  79. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  80. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/isc-config.sh
  81. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  82. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  83. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  84. # install BIND9 ARM
  85. %{l_shtool} mkdir -f -p -m 755 \
  86. $RPM_BUILD_ROOT%{l_prefix}/share/bind/
  87. %{l_shtool} install -c -m 644 \
  88. doc/arm/*.html $RPM_BUILD_ROOT%{l_prefix}/share/bind/
  89. # install run-command script
  90. %{l_shtool} mkdir -f -p -m 755 \
  91. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  92. %{l_shtool} install -c -m 755 \
  93. -e 's;@l_prefix@;%{l_prefix};g' \
  94. -e 's;@l_musr@;%{l_musr};g' \
  95. -e 's;@l_mgrp@;%{l_mgrp};g' \
  96. %{SOURCE rc.bind} \
  97. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  98. # install a reasonable default configuration
  99. %{l_shtool} mkdir -f -p -m 755 \
  100. $RPM_BUILD_ROOT%{l_prefix}/etc/bind
  101. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  102. %{SOURCE named.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
  103. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  104. %{SOURCE rndc.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/bind/
  105. %{l_shtool} mkdir -f -p -m 755 \
  106. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db
  107. %{l_shtool} install -c -m 644 \
  108. %{SOURCE db.127.0.0} \
  109. %{SOURCE db.localhost} \
  110. %{SOURCE db.root} \
  111. %{SOURCE db.root.sh} \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/
  113. # create an empty var directory
  114. %{l_shtool} mkdir -f -p -m 755 \
  115. $RPM_BUILD_ROOT%{l_prefix}/var/bind
  116. # determine the installed files
  117. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  118. %{l_files_std} \
  119. '%config %{l_prefix}/etc/bind/*.conf' \
  120. '%config %{l_prefix}/etc/bind/named.db/*' \
  121. '%dir %attr(-,root,%{l_mgrp}) %{l_prefix}/var/bind'
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT
  125. %post
  126. if [ $1 -eq 1 ]; then
  127. # generate local rndc key
  128. $RPM_INSTALL_PREFIX/sbin/rndc-confgen -a
  129. chown %{l_musr}:%{l_mgrp} $RPM_INSTALL_PREFIX/etc/bind/rndc.key
  130. elif [ $1 -gt 1 ]; then
  131. # reload daemon
  132. $RPM_INSTALL_PREFIX/sbin/rndc reload >/dev/null 2>&1 || true
  133. fi
  134. %preun
  135. if [ $1 -eq 0 ]; then
  136. # stop daemon
  137. $RPM_INSTALL_PREFIX/sbin/rndc stop >/dev/null 2>&1 || true
  138. # remove dynamically generated files
  139. rm -f $RPM_INSTALL_PREFIX/etc/bind/rndc.key
  140. rm -f $RPM_INSTALL_PREFIX/var/bind/*
  141. fi