xerces-c.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. ##
  2. ## xerces-c.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. # package version
  26. %define V_opkg 2.2.0
  27. %define V_dist 2_2_0
  28. # package information
  29. Name: xerces-c
  30. Summary: Validating XML parser
  31. URL: http://xml.apache.org/xerces-c/
  32. Vendor: Apache Software Foundation
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [EVAL]
  35. Group: Web
  36. License: Apache Software License 1.1
  37. Version: %{V_opkg}
  38. Release: 20030211
  39. # package options
  40. %option with_pth no
  41. %option with_threads no
  42. # package option dependencies
  43. %if "%{with_pth}" == "yes"
  44. %undefine with_threads
  45. %define with_threads yes
  46. %endif
  47. # list of sources
  48. Source0: http://xml.apache.org/dist/xerces-c/stable/xerces-c-src%{V_dist}.tar.gz
  49. Patch0: xerces-c.patch
  50. Patch1: xerces-c-pth.patch
  51. # build information
  52. Prefix: %{l_prefix}
  53. BuildRoot: %{l_buildroot}
  54. BuildPreReq: OpenPKG, openpkg >= 20030103, gcc, make, autoconf, libtool
  55. PreReq: OpenPKG, openpkg >= 20030103
  56. %if "%{with_pth}" == "yes"
  57. BuildPreReq: pth
  58. PreReq: pth
  59. %endif
  60. AutoReq: no
  61. AutoReqProv: no
  62. %description
  63. Xerces-C++ is a validating XML parser written in a portable subset of C++.
  64. %prep
  65. %setup -q -n xerces-c-src%{V_dist}
  66. %patch0 -p0
  67. %if "%{with_pth}" == "yes"
  68. %patch1 -p0
  69. %endif
  70. %build
  71. rm -rf $RPM_BUILD_ROOT
  72. ( XERCESCROOT=`pwd`
  73. export XERCESCROOT
  74. %{l_shtool} subst \
  75. -e 's;@l_ar@;%{l_libtool} --mode=link c++ -static -o;' \
  76. obj/Makefile.in
  77. cd $XERCESCROOT/src/xercesc
  78. %{l_prefix}/bin/autoconf
  79. %if "%{with_threads}" == "yes"
  80. os="freebsd"
  81. pt="pthread"
  82. case "%{l_target}" in
  83. %if "%{with_pth}" == "yes"
  84. *-freebsd*) os=freebsd; pt=pth ;;
  85. %else
  86. *-freebsd*) os=freebsd; pt=pthread ;;
  87. %endif
  88. *-linux*) os=linux; pt=pthread ;;
  89. *-solaris*) os=solaris; pt=pthread ;;
  90. *-irix*) os=irix; pt=sproc ;;
  91. *-hpux-10.*) os=hp-10; pt=none ;;
  92. *-hpux-11.*) os=hp-11; pt=none ;;
  93. *-aix*) os=aix; pt=pthread ;;
  94. esac
  95. %else
  96. os="freebsd"
  97. pt="none"
  98. case "%{l_target}" in
  99. *-freebsd*) os=freebsd ;;
  100. *-linux*) os=linux ;;
  101. *-solaris*) os=solaris ;;
  102. *-irix*) os=irix ;;
  103. *-hpux-10.*) os=hp-10 ;;
  104. *-hpux-11.*) os=hp-11 ;;
  105. *-aix*) os=aix ;;
  106. esac ;
  107. %endif
  108. CC="%{l_cc}" \
  109. CFLAGS="%{l_cflags -O}" \
  110. CXX="%{l_cxx}" \
  111. CXXFLAGS="%{l_cxxflags -O}" \
  112. LDFLAGS="%{l_ldflags}" \
  113. ./runConfigure \
  114. -P%{l_prefix} \
  115. -p$os \
  116. -cgcc \
  117. -xc++ \
  118. -minmem \
  119. -nsocket \
  120. -tnative \
  121. -r$pt
  122. %{l_make} %{l_mflags}
  123. cd $XERCESCROOT/samples
  124. CC="%{l_cc}" \
  125. CFLAGS="%{l_cflags -O}" \
  126. CXX="%{l_cxx}" \
  127. CXXFLAGS="%{l_cxxflags -O}" \
  128. LDFLAGS="%{l_ldflags}" \
  129. ./runConfigure \
  130. -p$os \
  131. -cgcc \
  132. -xc++ \
  133. -r$pt
  134. %{l_make} %{l_mflags}
  135. cd $XERCESCROOT/tests
  136. CC="%{l_cc}" \
  137. CFLAGS="%{l_cflags -O}" \
  138. CXX="%{l_cxx}" \
  139. CXXFLAGS="%{l_cxxflags -O}" \
  140. LDFLAGS="%{l_ldflags}" \
  141. ./runConfigure \
  142. -p$os \
  143. -cgcc \
  144. -xc++ \
  145. -r$pt
  146. %{l_make} %{l_mflags}
  147. ) || exit $?
  148. %install
  149. ( XERCESCROOT=`pwd`
  150. export XERCESCROOT
  151. cd $XERCESCROOT/src/xercesc
  152. %{l_make} %{l_mflags} install "PREFIX=$RPM_BUILD_ROOT%{l_prefix}"
  153. cd $XERCESCROOT/bin
  154. %{l_shtool} mkdir -f -p -m 755 \
  155. $i $RPM_BUILD_ROOT%{l_prefix}/libexec/xerces-c
  156. for i in *; do
  157. if [ -f $i ]; then
  158. %{l_shtool} install -s -c -m 755 \
  159. $i $RPM_BUILD_ROOT%{l_prefix}/libexec/xerces-c
  160. fi
  161. done
  162. ) || exit $?
  163. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  164. %files -f files
  165. %clean
  166. rm -rf $RPM_BUILD_ROOT