recipe 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Build recipe for the berkeley-db.
  2. #
  3. # Copyright (c) 2017-2019 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.38
  18. release=1
  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="
  25. http://rsync.dragora.org/current/sources/$tarname
  26. http://mirror.cedia.org.ec/dragora/current/sources/$tarname
  27. http://download.oracle.com/berkeley-db/$tarname
  28. "
  29. description="
  30. Berkeley database library.
  31. Berkeley DB is a programmatic toolkit that provides embedded database
  32. support for client/server applications.
  33. "
  34. homepage=http://www.oracle.com/database/berkeley-db/index.html
  35. license=Custom
  36. # Source documentation
  37. docs="README LICENSE"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. set -e
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. cd build_unix
  47. ../dist/configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
  48. LDFLAGS="$QILDFLAGS" \
  49. $configure_args \
  50. --libdir=/usr/lib${libSuffix} \
  51. --enable-compat185 \
  52. --enable-dbm \
  53. --enable-cxx \
  54. --enable-stl \
  55. --build="$(cc -dumpmachine)"
  56. make -j${jobs} V=1
  57. make -j${jobs} DESTDIR="$destdir" install
  58. # Huge size for the package
  59. rm -rf "${destdir}/usr/docs"
  60. # Strip remaining binaries and libraries
  61. find "$destdir" -type f | xargs file | \
  62. awk '/ELF/ && /executable/ || /shared object/' | \
  63. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  64. find "$destdir" -type f | xargs file | awk '/current ar archive/' | \
  65. cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
  66. cd ..
  67. # Copy documentation
  68. mkdir -p "${destdir}${docsdir}"
  69. cp -p $docs "${destdir}${docsdir}"
  70. }