nsd.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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.0.2
  37. Release: 20030227
  38. # list of sources
  39. Source0: http://www.nlnetlabs.nl/downloads/nsd/nsd-%{version}.tar.gz
  40. Source1: rc.nsd
  41. Source2: nsd.zones
  42. Source3: nsdc.conf
  43. Source4: example.com
  44. Source5: fsl.nsd
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20030103, fsl, make
  49. PreReq: OpenPKG, openpkg >= 20030103, fsl
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. NSD is an authoritative only, high performance, simple name server.
  54. It is especially intended to be run as a root nameserver and
  55. actually is used for the Internet K-Root-Server driven by RIPE NCC.
  56. It supports BIND-style zone files, but pre-compiles the DNS RRs into
  57. packet format in a separate step.
  58. %prep
  59. %setup -q
  60. %build
  61. # build programs
  62. %{l_make} %{l_mflags -O} \
  63. CC="%{l_cc}" \
  64. CFLAGS="%{l_cflags -O}" \
  65. NSDUSER="%{l_ruid}.%{l_rgid}" \
  66. NAMEDXFER="%{l_prefix}/libexec/bind/named-xfer" \
  67. NSDKEYSDIR="%{l_prefix}/etc/nsd/keys" \
  68. PREFIX="%{l_prefix}" \
  69. NSDZONESDIR="%{l_prefix}/etc/nsd" \
  70. NSDZONES="%{l_prefix}/etc/nsd/nsd.zones" \
  71. NSDDB="%{l_prefix}/var/nsd/nsd.db" \
  72. NSDPIDFILE="%{l_prefix}/var/nsd/nsd.pid" \
  73. FEATURES="-DLOG_NOTIFIES -DBIND8_STATS" \
  74. LIBWRAP="`%{l_prefix}/bin/fsl-config --all --ldflags --libs`"
  75. %install
  76. rm -rf $RPM_BUILD_ROOT
  77. # pre-create installation hierarchy
  78. %{l_shtool} mkdir -f -p -m 755 \
  79. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  80. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
  81. $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.db \
  82. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  83. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  84. $RPM_BUILD_ROOT%{l_prefix}/var/nsd
  85. # perform default installation procedure
  86. %{l_make} %{l_mflags} install \
  87. PREFIX="$RPM_BUILD_ROOT%{l_prefix}" \
  88. NSDZONESDIR="$RPM_BUILD_ROOT%{l_prefix}/etc/nsd" \
  89. NSDZONES="$RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.zones" \
  90. NSDDB="$RPM_BUILD_ROOT%{l_prefix}/var/nsd/nsd.db" \
  91. NSDPIDFILE="$RPM_BUILD_ROOT%{l_prefix}/var/nsd/nsd.pid" \
  92. INSTALL="%{l_shtool} install -c"
  93. # install default configuration
  94. %{l_shtool} install -c -m 644 \
  95. %{SOURCE nsdc.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/
  96. %{l_shtool} install -c -m 644 \
  97. %{SOURCE nsd.zones} $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/
  98. %{l_shtool} install -c -m 644 \
  99. %{SOURCE example.com} $RPM_BUILD_ROOT%{l_prefix}/etc/nsd/nsd.db/
  100. # install run-command script
  101. %{l_shtool} install -c -m 755 \
  102. -e 's;@l_prefix@;%{l_prefix};g' \
  103. -e 's;@l_susr@;%{l_susr};g' \
  104. %{SOURCE rc.nsd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  105. # install fsl configuration file
  106. %{l_shtool} install -c -m 644 \
  107. -e 's;@l_prefix@;%{l_prefix};g' \
  108. %{SOURCE fsl.nsd} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  109. # strip installation
  110. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  111. # determine installation files
  112. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  113. %{l_files_std} \
  114. '%not %dir %{l_prefix}/etc/rc.d' \
  115. '%not %dir %{l_prefix}/etc/fsl' \
  116. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/nsd'
  117. %files -f files
  118. %clean
  119. rm -rf $RPM_BUILD_ROOT
  120. %post
  121. # update database
  122. %{l_prefix}/sbin/nsdc rebuild