powerdns.spec 6.2 KB

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