recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / db / berkeley-db / recipe
blob9ae024fe0c352cbe235f9a0b9cfda0668b0ca54c
1 # Build recipe for the berkeley-db.
3 # Copyright (c) 2017-2019 Matias Fonzo, <selk@dragora.org>.
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
9 #    http://www.apache.org/licenses/LICENSE-2.0
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.
17 program=db
18 version=6.2.38
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=db
24 pkgname=berkeley-db
26 tarname=${program}-${version}.tar.gz
28 # Remote source(s)
29 fetch="
30  http://rsync.dragora.org/current/sources/$tarname
31  http://mirror.cedia.org.ec/dragora/current/sources/$tarname
32  http://download.oracle.com/berkeley-db/$tarname
35 description="
36 Berkeley database library.
38 Berkeley DB is a programmatic toolkit that provides embedded database
39 support for client/server applications.
42 homepage=http://www.oracle.com/database/berkeley-db/index.html
43 license=Custom
45 # Source documentation
46 docs="README LICENSE"
47 docsdir="${docdir}/${program}-${version}"
49 build()
51     set -e
53     unpack "${tardir}/$tarname"
55     cd "$srcdir"
57     # Set sane permissions
58     chmod -R u+w,go-w,a+rX-s .
60     cd build_unix
61     ../dist/configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
62     LDFLAGS="$QILDFLAGS" \
63      $configure_args \
64      --libdir=/usr/lib${libSuffix} \
65      --enable-compat185 \
66      --enable-dbm \
67      --enable-cxx \
68      --enable-stl \
69      --build="$(cc -dumpmachine)"
71     make -j${jobs} V=1
72     make -j${jobs} DESTDIR="$destdir" install
74     # Huge size for the package
75     rm -rf "${destdir}/usr/docs"
77     # Strip remaining binaries and libraries
78     find "$destdir" -type f | xargs file | \
79      awk '/ELF/ && /executable/ || /shared object/' | \
80       cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
82     find "$destdir" -type f | xargs file | awk '/current ar archive/' | \
83      cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
85     cd ..
87     # Copy documentation
88     mkdir -p "${destdir}${docsdir}"
89     cp -p $docs "${destdir}${docsdir}"