nsd.spec 5.6 KB

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