pdnsd.spec 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. ##
  2. ## pdnsd.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: pdnsd
  25. Summary: Proxy DNS Daemon
  26. URL: http://www.phys.uu.nl/~rombouts/pdnsd/
  27. Vendor: Thomas Moestl
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: DNS
  32. License: GPL
  33. Version: 1.2.7
  34. Release: 20080905
  35. # package options
  36. %option with_fsl yes
  37. # list of sources
  38. Source0: http://www.phys.uu.nl/~rombouts/pdnsd/releases/pdnsd-%{version}-par.tar.gz
  39. Source1: rc.pdnsd
  40. Source2: fsl.pdnsd
  41. Source3: pdnsd.conf
  42. Patch0: pdnsd.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20060823, make, flex, bison, gcc
  47. PreReq: OpenPKG, openpkg >= 20060823
  48. %if "%{with_fsl}" == "yes"
  49. BuildPreReq: fsl
  50. PreReq: fsl
  51. %endif
  52. AutoReq: no
  53. AutoReqProv: no
  54. %description
  55. PDNSD is a proxy DNS server with permanent caching (the cache
  56. contents are written to hard disk on exit) that is designed to
  57. cope with unreachable or down DNS servers (for example in dial-in
  58. networking).
  59. %track
  60. prog pdnsd = {
  61. version = %{version}
  62. url = http://www.phys.uu.nl/~rombouts/pdnsd/dl.html
  63. regex = pdnsd-(__VER__)-par\.src\.rpm
  64. }
  65. %prep
  66. %setup -q
  67. %patch -p0
  68. %{l_shtool} subst \
  69. -e 's;/usr/share/docs\{0,1\}/pdnsd/;%{l_prefix}/share/pdnsd/;g' \
  70. doc/pdnsd.{conf.5,8}.in
  71. %build
  72. export CC="%{l_cc} -pthread"
  73. export CFLAGS="%{l_cflags -O}"
  74. export CPPFLAGS="%{l_cppflags}"
  75. export LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}"
  76. export LIBS="%{l_fsl_libs}"
  77. configure_opts=""
  78. case "%{l_platform -t}" in
  79. *-freebsd* ) configure_opts="$configure_opts --disable-src-addr-disc" ;;
  80. *-sunos* ) LIBS="$LIBS -lnsl -lsocket" ;;
  81. esac
  82. ./configure \
  83. --prefix=%{l_prefix} \
  84. --sysconfdir=%{l_prefix}/etc/pdnsd \
  85. --with-cachedir=%{l_prefix}/var/pdnsd \
  86. --with-default-id=%{l_ruid} \
  87. $configure_opts
  88. %{l_make} %{l_mflags -O}
  89. %install
  90. rm -rf $RPM_BUILD_ROOT
  91. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  92. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  93. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/pdnsd/pdnsd.conf.sample
  94. %{l_shtool} mkdir -f -p -m 755 \
  95. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  96. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
  97. $RPM_BUILD_ROOT%{l_prefix}/share/pdnsd
  98. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  99. %{SOURCE rc.pdnsd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  100. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  101. %{SOURCE fsl.pdnsd} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  102. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  103. %{SOURCE pdnsd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/pdnsd/
  104. %{l_shtool} install -c -m 644 \
  105. doc/txt/*.txt $RPM_BUILD_ROOT%{l_prefix}/share/pdnsd/
  106. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  107. %{l_files_std} \
  108. '%config %{l_prefix}/etc/fsl/fsl.pdnsd' \
  109. '%config %attr(644,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/pdnsd/*' \
  110. '%doc %{l_prefix}/share/pdnsd/*' \
  111. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/pdnsd'
  112. %files -f files
  113. %clean
  114. rm -rf $RPM_BUILD_ROOT