recipe 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Build recipe for the berkeley-db.
  2. #
  3. # Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. program=db
  17. version=6.2.32
  18. release=2
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/db"
  21. pkgname=berkeley-db
  22. tarname=${program}-${version}.tar.gz
  23. # Remote source(s)
  24. fetch=http://download.oracle.com/berkeley-db/$tarname
  25. description="
  26. Berkeley database library.
  27. Berkeley DB is a programmatic toolkit that provides embedded database
  28. support for client/server applications.
  29. "
  30. homepage=http://www.oracle.com/database/berkeley-db/index.html
  31. license=Custom
  32. # Source documentation
  33. docs="README LICENSE"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. cd build_unix
  43. ../dist/configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  44. $configure_args \
  45. --libdir=/usr/lib${libSuffix} \
  46. --enable-compat185 \
  47. --enable-dbm \
  48. --enable-cxx \
  49. --enable-stl \
  50. --build="$(cc -dumpmachine)"
  51. make -j${jobs} V=1
  52. make -j${jobs} DESTDIR="$destdir" install
  53. # Huge size for the package
  54. rm -rf "${destdir}/usr/docs"
  55. # Strip remaining binaries and libraries
  56. find "$destdir" -type f | xargs file | \
  57. awk '/ELF/ && /executable/ || /shared object/' | \
  58. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  59. find "$destdir" -type f | xargs file | awk '/current ar archive/' | \
  60. cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
  61. cd ..
  62. # Copy documentation
  63. mkdir -p "${destdir}${docsdir}"
  64. cp -p $docs "${destdir}${docsdir}"
  65. }