bind.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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 [REL]
  32. Group: DNS
  33. License: ISC
  34. Version: 9.2.0
  35. Release: 20020226
  36. # list of sources
  37. Source0: ftp://ftp.isc.org/isc/bind/%{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. PATH="%{l_prefix}/bin:$PATH"; export PATH
  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. PATH="%{l_prefix}/bin:$PATH"; export PATH
  78. # perform standard install procedure
  79. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  80. # strip down installation
  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.127.0.0} \
  111. %{SOURCE db.localhost} \
  112. %{SOURCE db.root} \
  113. %{SOURCE db.root.sh} \
  114. $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/
  115. # create an empty var directory
  116. %{l_shtool} mkdir -f -p -m 755 \
  117. $RPM_BUILD_ROOT%{l_prefix}/var/bind
  118. # determine the installed files
  119. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  120. %{l_files_std} \
  121. '%config %{l_prefix}/etc/bind/*.conf' \
  122. '%config %{l_prefix}/etc/bind/named.db/*'
  123. %files -f files
  124. %clean
  125. rm -rf $RPM_BUILD_ROOT
  126. %post
  127. if [ $1 -eq 1 ]; then
  128. # generate local rndc key
  129. $RPM_INSTALL_PREFIX/sbin/rndc-confgen -a
  130. chown %{l_musr}:%{l_mgrp} $RPM_INSTALL_PREFIX/etc/bind/rndc.key
  131. elif [ $1 -gt 1 ]; then
  132. # reload daemon
  133. $RPM_INSTALL_PREFIX/sbin/rndc reload >/dev/null 2>&1 || true
  134. fi
  135. %preun
  136. if [ $1 -eq 0 ]; then
  137. # stop daemon
  138. $RPM_INSTALL_PREFIX/sbin/rndc stop >/dev/null 2>&1 || true
  139. # remove dynamically generated files
  140. rm -f $RPM_INSTALL_PREFIX/etc/bind/rndc.key
  141. rm -f $RPM_INSTALL_PREFIX/var/bind/*
  142. fi