powerdns.spec 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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.8
  36. Release: 20030614
  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 >= 20021204
  51. %if "%{with_fsl}" == "yes"
  52. BuildPreReq: fsl
  53. %endif
  54. %if "%{with_mysql}" == "yes"
  55. BuildPreReq: MYSQL
  56. %endif
  57. %if "%{with_pgsql}" == "yes"
  58. BuildPreReq: postgresql, postgresql::with_cxx = yes
  59. %endif
  60. PreReq: OpenPKG, openpkg >= 20021204
  61. %if "%{with_fsl}" == "yes"
  62. PreReq: fsl
  63. %endif
  64. %if "%{with_mysql}" == "yes"
  65. PreReq: MYSQL
  66. %endif
  67. %if "%{with_pgsql}" == "yes"
  68. PreReq: postgresql, postgresql::with_cxx = yes
  69. %endif
  70. AutoReq: no
  71. AutoReqProv: no
  72. Provides: DNS
  73. Conflicts: bind, bind8
  74. %description
  75. The PowerDNS name server is a modern, advanced and high performance
  76. authoritative-only nameserver. It is written from scratch and
  77. conforms to all the relevant DNS standards documents. The PowerDNS
  78. name server utilizes a flexible backend architecture which can
  79. access DNS information from any data source. This includes file
  80. formats, Bind zone files, relational databases or LDAP directories.
  81. By connecting directly to a database, no 'reloading' is needed.
  82. Changes committed to the database are effective immediately. If you
  83. have specific needs for your DNS infrastructure then you can use the
  84. Backend Developers Kit to write the 'glue' between PowerDNS and your
  85. data or logic.
  86. %prep
  87. %setup -q -n pdns-%{version}
  88. %build
  89. MODULES=""
  90. %if "%{with_pipe}" == "yes"
  91. MODULES="$MODULES pipe"
  92. %endif
  93. %if "%{with_mysql}" == "yes"
  94. MODULES="$MODULES gmysql"
  95. %endif
  96. %if "%{with_pgsql}" == "yes"
  97. MODULES="$MODULES gpgsql"
  98. %endif
  99. MODULES=`echo "$MODULES" | sed 's;^ ;;'`
  100. lf="%{l_ldflags}"
  101. li=""
  102. %if "%{with_fsl}" == "yes"
  103. lf="$lf `%{l_prefix}/bin/fsl-config --all --ldflags --libs`"
  104. li="$li `%{l_prefix}/bin/fsl-config --all --libs`"
  105. %endif
  106. CC="%{l_cc}" \
  107. CXX="%{l_cxx}" \
  108. CFLAGS="%{l_cflags -O}" \
  109. CXXFLAGS="%{l_cxxflags -O} -DDLLIMPORT=" \
  110. CPPFLAGS="%{l_cppflags} -DDLLIMPORT=" \
  111. LDFLAGS="$lf" \
  112. LIBS="$li" \
  113. ./configure \
  114. --prefix=%{l_prefix} \
  115. --sysconfdir=%{l_prefix}/etc/powerdns \
  116. %if "%{with_mysql}" == "yes"
  117. --enable-mysql \
  118. --with-mysql=%{l_prefix} \
  119. %else
  120. --disable-mysql \
  121. %endif
  122. %if "%{with_pgsql}" == "yes"
  123. --enable-pgsql \
  124. --with-pgsql=%{l_prefix} \
  125. --with-pgsql-includes=%{l_prefix}/include/libpq++ \
  126. --with-pgsql-lib=%{l_prefix}/lib \
  127. %else
  128. --disable-pgsql \
  129. %endif
  130. --with-modules="$MODULES" \
  131. --with-dynmodules="" \
  132. --disable-shared
  133. %{l_make} %{l_mflags -O} \
  134. CXXFLAGS="%{l_cxxflags -O} -DDLLIMPORT= -DHAVE_NAMESPACE_STD" \
  135. CPPFLAGS="%{l_cppflags} -DDLLIMPORT= -DHAVE_NAMESPACE_STD"
  136. %install
  137. rm -rf $RPM_BUILD_ROOT
  138. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  139. # Clean up installation
  140. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  141. # Setup config file
  142. mv $RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf-dist \
  143. $RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf
  144. %{l_shtool} subst \
  145. -e 's;@l_prefix@;%{l_prefix};g' \
  146. $RPM_BUILD_ROOT%{l_prefix}/etc/powerdns/pdns.conf
  147. # Creating run-command script
  148. %{l_shtool} mkdir -f -p -m 755 \
  149. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  150. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  151. -e 's;@l_susr@;%{l_susr};g' -e 's;@l_sgrp@;%{l_sgrp};g' \
  152. -e 's;@l_musr@;%{l_musr};g' -e 's;@l_mgrp@;%{l_mgrp};g' \
  153. %{SOURCE rc.powerdns} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  154. # Install setup script
  155. %{l_shtool} mkdir -p -m 755 \
  156. $RPM_BUILD_ROOT%{l_prefix}/sbin
  157. %{l_shtool} install -c -m 755 \
  158. %{SOURCE powerdnssetup} $RPM_BUILD_ROOT%{l_prefix}/sbin/
  159. # Creating fsl directory
  160. %{l_shtool} mkdir -f -p -m 755 \
  161. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  162. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  163. %{SOURCE fsl.powerdns} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  164. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  165. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  166. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  167. '%config %attr(0600,root,%{l_mgrp}) %{l_prefix}/etc/powerdns/*' \
  168. '%config %{l_prefix}/etc/fsl/fsl.powerdns' \
  169. '%not %dir %{l_prefix}/etc/fsl'
  170. %files -f files
  171. %clean
  172. rm -rf $RPM_BUILD_ROOT