1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 version = %{version_major}.%{version_minor}.%{version_patch}
12 thisapp = db-%{version}
14 soversion = %{version_major}.%{version_minor}
16 maintainer = Michael Tremer <michael.tremer@ipfire.org>
17 groups = System/Libraries
18 url = http://www.oracle.com/technology/products/berkeley-db/
20 summary = Berkeley DB is a library that provides an embedded database.
23 Berkeley DB (BDB) is a computer software library that provides
24 a high-performance embedded database.
27 source_dl = http://download.oracle.com/berkeley-db/
39 CFLAGS += -fno-strict-aliasing
41 DIR_APP = %{DIR_SRC}/%{thisapp}/dist/dist-tls
44 for i in $(find %{DIR_SRC}/%{thisapp} -name config.guess -or -name config.sub); do
45 cp -vf %{datadir}/automake-*/config.{guess,sub} $(dirname ${i})
48 mkdir -pv %{DIR_APP} && cd %{DIR_APP}
49 ln -svf ../configure .
53 # Remove libtool predep_objects and postdep_objects wonkiness so that
54 # building without -nostdlib doesn't include them twice. Because we
55 # already link with g++, weird stuff happens if you don't let the
56 # compiler handle this.
57 perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
58 perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
59 perl -pi -e 's/-shared -nostdlib/-shared/' libtool
62 configure_options += \
72 # Remove RPATH in all binaries.
73 for i in %{BUILDROOT}%{bindir}/*; do
74 patchelf --remove-rpath ${i}
77 # Remove documentation which is very big.
78 rm -rf %{BUILDROOT}%{prefix}/docs
80 # Remove unversioned libs.
81 rm -vf %{BUILDROOT}%{libdir}/libdb*-%{version_major}.so
83 mkdir -pv %{BUILDROOT}%{includedir}/%{name}
84 mv -v %{BUILDROOT}%{includedir}/*.h %{BUILDROOT}%{includedir}/%{name}/
85 for i in db.h db_cxx.h db_185.h; do
86 ln -svf %{name}/${i} %{BUILDROOT}/%{includedir}
89 # Fix binary permissions.
90 find %{BUILDROOT}%{bindir} -type f -executable \
93 # Fix header permissions.
94 find %{BUILDROOT}%{includedir} -type f -iname "*.h" \
102 package %{name}-devel
109 # You cannot install libdb-devel and db4-devel
116 files += !%{libdir}/libdb-%{soversion}.so
117 files += !%{libdir}/libdb_sql-%{soversion}.so
120 package %{name}-utils
121 summary = Command line tools for managing Berkeley DB (version 4) databases.
122 description = %{summary}
130 summary = The Berkeley DB database library (version 4) for C++.
131 description = %{summary}
134 %{libdir}/libdb_cxx-%{soversion}.so
138 package %{name}-debuginfo