powerdns.spec 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ##
  2. ## powerdns.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. # FIXME: mlelstv: JUNK because not well tested and no config
  26. # package information
  27. Name: powerdns
  28. Summary: PowerDNS high performance authoritative-only name server
  29. URL: http://www.powerdns.com/products/powerdns/
  30. Vendor: PowerDNS.COM BV
  31. Packager: The OpenPKG Project
  32. Distribution: OpenPKG [JUNK]
  33. Group: DNS
  34. License: GPL
  35. Version: 2.9.10
  36. Release: 20030708
  37. # package options
  38. %option with_fsl yes
  39. %option with_pipe no
  40. %option with_mysql no
  41. %option with_pgsql no
  42. # list of sources
  43. Source0: http://downloads.powerdns.com/releases/pdns-%{version}.tar.gz
  44. Source1: rc.powerdns
  45. Source2: fsl.powerdns
  46. Source3: powerdnssetup
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20030415
  51. PreReq: OpenPKG, openpkg >= 20030415
  52. %if "%{with_fsl}" == "yes"
  53. BuildPreReq: fsl
  54. PreReq: fsl
  55. %endif
  56. %if "%{with_mysql}" == "yes"
  57. BuildPreReq: mysql
  58. PreReq: mysql
  59. %endif
  60. %if "%{with_pgsql}" == "yes"
  61. BuildPreReq: postgresql, postgresql::with_cxx = yes
  62. PreReq: postgresql, postgresql::with_cxx = yes
  63. %endif
  64. AutoReq: no
  65. AutoReqProv: no
  66. Provides: DNS
  67. Conflicts: bind, bind8
  68. %description
  69. The PowerDNS name server is a modern, advanced and high performance
  70. authoritative-only nameserver. It is written from scratch and
  71. conforms to all the relevant DNS standards documents. The PowerDNS
  72. name server utilizes a flexible backend architecture which can
  73. access DNS information from any data source. This includes file
  74. formats, Bind zone files, relational databases or LDAP directories.
  75. By connecting directly to a database, no 'reloading' is needed.
  76. Changes committed to the database are effective immediately. If you
  77. have specific needs for your DNS infrastructure then you can use the
  78. Backend Developers Kit to write the 'glue' between PowerDNS and your
  79. data or logic.
  80. %prep
  81. %setup -q -n pdns-%{version}
  82. %build
  83. MODULES=""
  84. %if "%{with_pipe}" == "yes"
  85. MODULES="$MODULES pipe"
  86. %endif
  87. %if "%{with_mysql}" == "yes"
  88. MODULES="$MODULES gmysql"
  89. %endif
  90. %if "%{with_pgsql}" == "yes"
  91. MODULES="$MODULES gpgsql"
  92. %endif
  93. MODULES=`echo "$MODULES" | sed 's;^ ;;'`
  94. CC="%{l_cc}" \
  95. CXX="%{l_cxx}" \
  96. CFLAGS="%{l_cflags -O}" \
  97. CXXFLAGS="%{l_cxxflags -O} -DDLLIMPORT=" \
  98. CPPFLAGS="%{l_cppflags} -DDLLIMPORT=" \
  99. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}"
  100. LIBS="%{l_fsl_libs}"
  101. ./configure \
  102. --prefix=%{l_prefix} \
  103. --sysconfdir=%{l_prefix}/etc/powerdns \
  104. %if "%{with_mysql}" == "yes"
  105. --enable-mysql \
  106. --with-mysql=%{l_prefix} \
  107. %else
  108. --disable-mysql \
  109. %endif
  110. %if "%{with_pgsql}" == "yes"
  111. --enable-pgsql \
  112. --with-pgsql=%{l_prefix} \
  113. --with-pgsql-includes=%{l_prefix}/include/libpq++ \
  114. --with-pgsql-lib=%{l_prefix}/lib \
  115. %else
  116. --disable-pgsql \
  117. %endif
  118. --with-modules="$MODULES" \
  119. --with-dynmodules="" \
  120. --disable-shared
  121. %{l_make} %{l_mflags -O} \
  122. CXXFLAGS="%{l_cxxflags -O} -DDLLIMPORT= -DHAVE_NAMESPACE_STD" \
  123. CPPFLAGS="%{l_cppflags} -DDLLIMPORT= -DHAVE_NAMESPACE_STD"
  124. %install
  125. rm -rf $RPM_BUILD_ROOT
  126. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  127. # clean up installation
  128. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  129. # setup config file
  130. mv $RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf-dist \
  131. $RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf
  132. %{l_shtool} subst \
  133. -e 's;@l_prefix@;%{l_prefix};g' \
  134. $RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf
  135. # install run-command script
  136. %{l_shtool} mkdir -f -p -m 755 \
  137. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  138. %{l_shtool} install -c -m 755 \
  139. -e 's;@l_prefix@;%{l_prefix};g' \
  140. -e 's;@l_susr@;%{l_susr};g' \
  141. -e 's;@l_rusr@;%{l_rusr};g' \
  142. -e 's;@l_rgrp@;%{l_rgrp};g' \
  143. %{SOURCE rc.powerdns} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  144. # install setup script
  145. %{l_shtool} mkdir -p -m 755 \
  146. $RPM_BUILD_ROOT%{l_prefix}/sbin
  147. %{l_shtool} install -c -m 755 \
  148. %{SOURCE powerdnssetup} $RPM_BUILD_ROOT%{l_prefix}/sbin/
  149. # install OSSP fsl configuration
  150. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  151. %{l_shtool} install -c -m 644 \
  152. -e 's;@l_prefix@;%{l_prefix};g' \
  153. %{SOURCE fsl.powerdns} \
  154. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  155. %{l_shtool} mkdir -f -p -m 755 \
  156. $RPM_BUILD_ROOT%{l_prefix}/var/powerdns
  157. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  158. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  159. # determine installation files
  160. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  161. %{l_files_std} \
  162. '%not %dir %{l_prefix}/etc/fsl' \
  163. '%attr(775,%{l_musr},%{l_rgrp}) %{l_prefix}/var/powerdns' \
  164. '%config %{l_prefix}/etc/fsl/fsl.powerdns' \
  165. '%config %attr(0600,root,%{l_mgrp}) %{l_prefix}/etc/powerdns/*'
  166. %files -f files
  167. %clean
  168. rm -rf $RPM_BUILD_ROOT