db.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. ##
  2. ## db.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package version
  25. %define V_version 4.5.20
  26. %define V_revision 2
  27. # package information
  28. Name: db
  29. Summary: Berkeley-DB Library
  30. URL: http://www.oracle.com/database/berkeley-db.html
  31. Vendor: Keith Bostic
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: BASE
  35. Group: Database
  36. License: BSD
  37. Version: %{V_version}.%{V_revision}
  38. Release: 20070505
  39. # package options
  40. %option with_compat no
  41. %option with_cxx no
  42. # list of sources
  43. Source0: http://download-uk.oracle.com/berkeley-db/db-%{V_version}.tar.gz
  44. Source1: db.pc
  45. Patch0: db.patch
  46. Patch1: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.1
  47. Patch2: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.2
  48. # build information
  49. Prefix: %{l_prefix}
  50. BuildRoot: %{l_buildroot}
  51. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  52. PreReq: OpenPKG, openpkg >= 20040130
  53. %if "%{with_cxx}" == "yes"
  54. BuildPreReq: gcc::with_cxx = yes
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. Berkeley DB is a programmatic toolkit that provides high-performance
  60. built-in database support for desktop and server applications and
  61. for information appliances. The Berkeley DB access methods include
  62. B+tree, Extended Linear Hashing, Fixed and Variable-length records,
  63. and Queues. Berkeley DB provides full transactional support,
  64. database recovery, online backups, and separate access to locking,
  65. logging and shared memory caching subsystems.
  66. %track
  67. prog db = {
  68. version = %{V_version}
  69. url = http://www.oracle.com/technology/software/products/berkeley-db/index.html
  70. regex = Berkeley\s+DB\s+(__VER__)\s+\.tar\.gz
  71. }
  72. %prep
  73. %setup -q -n db-%{V_version}
  74. %patch -p0 -P 0 1 2
  75. %{l_shtool} subst \
  76. -e 's;\($(ar) cr .*\);\1 _udivdi3.o _muldi3.o _clz.o;' \
  77. -e 's;install_utilities install_docs;install_utilities;' \
  78. dist/Makefile.in
  79. %build
  80. # configure library
  81. cppflags=""
  82. case "%{l_platform -t}" in
  83. sparc64-freebsd* ) cppflags="-fPIC" ;;
  84. esac
  85. mutex="no"
  86. case "%{l_platform -p}" in
  87. ix86-* ) mutex="x86/gcc-assembly" ;;
  88. ia64-* ) mutex="ia64/gcc-assembly" ;;
  89. sparc*-* ) mutex="Sparc/gcc-assembly" ;;
  90. ppc*-* ) mutex="PPC/gcc-assembly" ;;
  91. alpha*-* ) mutex="ALPHA/gcc-assembly" ;;
  92. * ) mutex="UNIX/fcntl" ;;
  93. esac
  94. cd build_unix
  95. CC="%{l_cc}" \
  96. CPPFLAGS="%{l_cppflags} $cppflags" \
  97. CFLAGS="%{l_cflags -O}" \
  98. %if "%{with_cxx}" == "yes"
  99. CXX="%{l_cxx}" \
  100. CXXFLAGS="%{l_cxxflags -O}" \
  101. %endif
  102. GREP="grep" \
  103. ../dist/configure \
  104. --prefix=%{l_prefix} \
  105. %if "%{with_compat}" == "yes"
  106. --enable-compat185 \
  107. %else
  108. --disable-compat185 \
  109. %endif
  110. %if "%{with_cxx}" == "yes"
  111. --enable-cxx \
  112. %else
  113. --disable-cxx \
  114. %endif
  115. --with-mutex="$mutex" \
  116. --disable-shared
  117. # build library
  118. ar -vx `%{l_cc} -print-libgcc-file-name` _udivdi3.o _muldi3.o _clz.o
  119. %{l_make} %{l_mflags -O}
  120. %install
  121. # install library
  122. rm -rf $RPM_BUILD_ROOT
  123. ( cd build_unix
  124. %{l_make} %{l_mflags} install \
  125. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  126. ) || exit $?
  127. # strip down installation
  128. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libdb-[0-9]*.a
  129. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  130. %if "%{with_compat}" == "no"
  131. rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_185.h
  132. %endif
  133. %if "%{with_cxx}" == "no"
  134. rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_cxx.h
  135. rm -f $RPM_BUILD_ROOT%{l_prefix}/include/cxx_*.h
  136. %endif
  137. # install pkg-config configuration
  138. libs="-ldb"
  139. case "%{l_platform -t}" in
  140. *-sunos* ) libs="$libs -lrt" ;;
  141. esac
  142. %{l_shtool} mkdir -f -p -m 755 \
  143. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
  144. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  145. -e "s;@version@;%{version};" \
  146. -e "s;@libs@;$libs;" \
  147. %{SOURCE db.pc} \
  148. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
  149. # determine installation files
  150. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  151. %files -f files
  152. %clean
  153. rm -rf $RPM_BUILD_ROOT