nsd.spec 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. ##
  2. ## nsd.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. # FIXME: rse: optional AXFR support via BIND8 named-xfer?
  26. # FIXME: rse: optional libwrap support via {tcp,socket}_wrappers for AXFR
  27. # FIXME: thl: libwrap can be (mis-)used for fsl, but the right side of the assignment must never be empty. this requires an "if"
  28. # package information
  29. Name: nsd
  30. Summary: Name Server Daemon
  31. URL: http://www.nlnetlabs.nl/nsd/
  32. Vendor: NLNet Labs
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [EVAL]
  35. Group: DNS
  36. License: GPL
  37. Version: 1.1.0
  38. Release: 20030708
  39. # package option
  40. %option with_fsl yes
  41. # list of sources
  42. Source0: http://www.nlnetlabs.nl/downloads/nsd/nsd-%{version}.tar.gz
  43. Source1: rc.nsd
  44. Source2: nsd.zones
  45. Source3: nsd.conf
  46. Source4: example.com
  47. Source5: fsl.nsd
  48. # build information
  49. Prefix: %{l_prefix}
  50. BuildRoot: %{l_buildroot}
  51. BuildPreReq: OpenPKG, openpkg >= 20030415, make
  52. PreReq: OpenPKG, openpkg >= 20030415
  53. %if "%{with_fsl}" == "yes"
  54. BuildPreReq: fsl
  55. PreReq: fsl
  56. %endif
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. NSD is an authoritative only, high performance, simple name server.
  61. It is especially intended to be run as a root nameserver and
  62. actually is used for the Internet K-Root-Server driven by RIPE NCC.
  63. It supports BIND-style zone files, but pre-compiles the DNS RRs into
  64. packet format in a separate step.
  65. %prep
  66. %setup -q
  67. %build
  68. # configure programs
  69. CC="%{l_cc}" \
  70. CFLAGS="%{l_cflags -O}" \
  71. LDFLAGS="%{l_ldflags}" \
  72. ./configure \
  73. --prefix=%{l_prefix} \
  74. --with-configdir=%{l_prefix}/etc/nsd \
  75. --with-configfile=%{l_prefix}/etc/nsd/nsd.conf \
  76. --with-pidfile=%{l_prefix}/var/nsd/nsd.pid \
  77. --with-zonesdir=%{l_prefix}/etc/nsd \
  78. --with-zonesfile=%{l_prefix}/etc/nsd/nsd.zones \
  79. --with-dbfile=%{l_prefix}/var/nsd/nsd.db \
  80. --with-user="%{l_ruid}.%{l_rgid}" \
  81. --with-namedxfer=%{l_prefix}/libexec/bind/named-xfer \
  82. %if "%{with_fsl}" == "yes"
  83. --with-libwrap="%{l_fsl_ldflags} %{l_fsl_libs}" \
  84. %endif
  85. --enable-bind8-stats \
  86. --disable-shared \
  87. --disable-nls
  88. # build programs
  89. %{l_make} %{l_mflags -O}
  90. %install
  91. rm -rf $RPM_BUILD_ROOT
  92. # pre-create installation hierarchy
  93. %{l_shtool} mkdir -f -p -m 755 \
  94. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  95. $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.db \
  96. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  97. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  98. $RPM_BUILD_ROOT%{l_prefix}/var/nsd
  99. # perform default installation procedure
  100. %{l_make} %{l_mflags} install \
  101. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  102. exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
  103. configdir=$RPM_BUILD_ROOT%{l_prefix}/etc/nsd \
  104. configfile=$RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.conf \
  105. pidfile=$RPM_BUILD_ROOT%{l_prefix}/var/nsd/nsd.pid \
  106. zonesdir=$RPM_BUILD_ROOT%{l_prefix}/etc/nsd \
  107. zonesfile=$RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.zones \
  108. dbfile=$RPM_BUILD_ROOT%{l_prefix}/var/nsd/nsd.db
  109. # post-adjustments
  110. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.zones.sample
  111. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.conf.sample
  112. # install default configuration
  113. %{l_shtool} install -c -m 644 \
  114. -e 's;@l_prefix@;%{l_prefix};g' \
  115. %{SOURCE nsd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/
  116. %{l_shtool} install -c -m 644 \
  117. -e 's;@l_prefix@;%{l_prefix};g' \
  118. %{SOURCE nsd.zones} $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/
  119. %{l_shtool} install -c -m 644 \
  120. %{SOURCE example.com} $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.db/
  121. # install run-command script
  122. %{l_shtool} install -c -m 755 \
  123. -e 's;@l_prefix@;%{l_prefix};g' \
  124. -e 's;@l_susr@;%{l_susr};g' \
  125. -e 's;@l_rusr@;%{l_rusr};g' \
  126. -e 's;@l_rgrp@;%{l_rgrp};g' \
  127. %{SOURCE rc.nsd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  128. # install OSSP fsl configuration
  129. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  130. %{l_shtool} install -c -m 644 \
  131. -e 's;@l_prefix@;%{l_prefix};g' \
  132. %{SOURCE fsl.nsd} \
  133. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  134. # strip installation
  135. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  136. # determine installation files
  137. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  138. %{l_files_std} \
  139. '%not %dir %{l_prefix}/etc/fsl' \
  140. '%config %{l_prefix}/etc/fsl/fsl.nsd' \
  141. '%config %{l_prefix}/etc/nsd/*' \
  142. '%not %dir %{l_prefix}/etc/rc.d' \
  143. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/nsd'
  144. %files -f files
  145. %clean
  146. rm -rf $RPM_BUILD_ROOT
  147. %post
  148. # update database
  149. %{l_prefix}/sbin/nsdc rebuild