This repository has been archived on 2024-11-07. You can view files and clone it, but cannot push or open issues or pull requests.
db48/db48.spec

401 lines
14 KiB
RPMSpec

%define majver %(echo %version | cut -d . -f1-2)
%define majvershort %(echo %version | cut -d . -f1-2 | tr -d .)
%define MAJver %(echo %version | cut -d . -f1)
Name: db48
Version: 4.8.30
Release: 4mamba
Summary: The Berkeley DB database library
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.oracle.com/technology/products/berkeley-db/index.html
Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
Source1: http://download.oracle.com/berkeley-db/db.1.85.tar.gz
Patch0: patch.4.2.52.1
Patch1: patch.4.2.52.2
Patch2: db4-jni-casting.diff
# from http://www.stanford.edu/services/directory/openldap/configuration/patches/db/
Patch3: bdb-transactions.diff
Patch4: btree.diff
Patch5: java.diff
# db-1.85 upstream patches
Patch6: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.1
Patch7: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.2
Patch8: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.3
Patch9: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.4
Patch10: db-1.85-errno.patch
Patch11: db-4.6.21-1.85-compat.patch
Patch12: db-4.8.30-jni-include-dir.patch
License: BSD, GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
BuildRequires: libtcl-devel
BuildRequires: gcc-java
BuildRequires: java-gcj-compat
#BuildRequires: java-openjdk
BuildRequires: jpackage-utils
BuildRequires: sharutils
Requires: libdb48 = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
This package contains the tools for managing Berkeley DB.
%package docs
Summary: The Berkeley DB database Documentation
Group: Documentation
Requires: libdb48 = %{version}-%{release}
%description docs
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
This package contains documentation for %{name}.
%package -n libdb48
Summary: The Berkeley DB database library
Group: System/Libraries
%description -n libdb48
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
%package -n libdb48-devel
Summary: Development files for the Berkeley DB library.
Group: Development/Libraries
Requires: libdb48 = %{version}-%{release}
%description -n libdb48-devel
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
This package contains the header files, libraries, and documentation for building programs which use the Berkeley DB.
%package -n libdb48-static
Summary: Development files for the Berkeley DB library - static libraries.
Group: Development/Libraries
Requires: libdb48-devel = %{version}-%{release}
%description -n libdb48-static
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
This package contains static libraries for building programs which use the Berkeley DB.
%package -n java-bdb48
Summary: Java bindings for the Berkeley DB library
Group: System/Libraries
Requires: libdb48 = %{version}-%{release}
Provides: libdb48-java
%description -n java-bdb48
Java bindings for the Berkeley DB library.
%package -n libdb48-tcl
Summary: Development files for using the Berkeley DB (version 4) with tcl
Group: Development/Libraries
Requires: libdb48 = %{version}-%{release}
%description -n libdb48-tcl
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. This package contains the libraries for building programs which use the Berkeley DB in Tcl.
%prep
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%setup -q -n db-%{version} -a 1
#%patch0 -p0
#%patch1 -p0
#%patch2 -p2
#%patch3 -p1
#%patch4 -p1
#%patch5 -p1
pushd db.1.85/PORT/linux
%patch6 -p0 -b .1.1
popd
pushd db.1.85
%patch7 -p0 -b .1.2
%patch8 -p0 -b .1.3
%patch9 -p0 -b .1.4
%patch10 -p1 -b .errno
popd
%patch11 -p1 -b .185compat
%patch12 -p0 -b .4.8.30.jni
cd dist
./s_config
%build
case "%{_target_cpu}" in
i586) mutex="x86/gcc-assembly" ;;
ppc) mutex="PPC/gcc-assembly" ;;
arm) mutex="ARM/gcc-assembly" ;;
x86_64) mutex="x86_64/gcc-assembly" ;;
*) mutex="UNIX/fcntl" ;;
esac
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"; export CFLAGS
# Build the old db-185 libraries.
make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
/bin/sh libtool --mode=compile %{__cc} $RPM_OPT_FLAGS -Idb.1.85/PORT/%{_os}/include -D_REENTRANT -c db_dump185/db_dump185.c -o dist/$1/db_dump185.lo
/bin/sh libtool --mode=link %{__cc} -o dist/$1/db_dump185 dist/$1/db_dump185.lo db.1.85/PORT/%{_os}/libdb.a
build() {
test -d dist/$1 || mkdir dist/$1
# Static link db_dump185 with old db-185 libraries.
/bin/sh libtool --mode=compile %{__cc} $RPM_OPT_FLAGS -Idb.1.85/PORT/%{_os}/include -D_REENTRANT -c db_dump185/db_dump185.c -o dist/$1/db_dump185.lo
/bin/sh libtool --mode=link %{__cc} -o dist/$1/db_dump185 dist/$1/db_dump185.lo db.1.85/PORT/%{_os}/libdb.a
pushd dist
popd
pushd dist/$1
ln -sf ../configure .
JAVA_HOME=%{_jvmdir}/java/ \
%configure -C \
--prefix=%{_prefix} \
--datadir=%{_datadir} \
--includedir=%{_includedir}/db4 \
--enable-compat185 \
--enable-dump185 \
--enable-shared \
--enable-static \
--enable-tcl \
--with-tcl=%{_libdir} \
--with-mutex="$mutex" \
--enable-cxx \
%if "%{stage1}" != "1"
--enable-java \
%endif
--enable-test \
# --enable-diagnostic
# --enable-debug
# --enable-debug_rop
# --enable-debug_wop
perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
perl -pi -e 's/-shared -nostdlib/-shared/' libtool
%make
LDBJ=./.libs/libdb_java-%{majver}.la
if test -f ${LDBJ} -a ! -f ${LDBJ}i; then
sed -e 's,^installed=no,installed=yes,' < ${LDBJ} > ${LDBJ}i
fi
popd
}
build dist-tls
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}
%makeinstall -C dist/dist-tls
mkdir -p %{buildroot}%{_datadir}/doc/libdb4-%{version}
mv %{buildroot}%{_prefix}/docs/* \
%{buildroot}%{_datadir}/doc/libdb4-%{version}
rmdir %{buildroot}%{_prefix}/docs
## need for build pythonic extension
#for i in db.h db_cxx.h db_185.h; do
# ln -s db4/$i %{buildroot}%{_includedir}
#done
pushd %{buildroot}%{_bindir}
find * -exec ln -s {} {}-%{majvershort} \;
popd
# fix strange permissions
chmod u+w %{buildroot}%{_bindir} %{buildroot}%{_bindir}/*
ln -s libdb-%{majver}.so %{buildroot}%{_libdir}/libdb.so.%{majver}
%if "%{stage1}" != "1"
ln -s libdb_java-%{majver}.so %{buildroot}%{_libdir}/libdb_java.so.%{majver}
mkdir -p %{buildroot}%{_datadir}/java
mv %{buildroot}%{_libdir}/db.jar %{buildroot}%{_datadir}/java/db-%{version}.jar
(
cd %{buildroot}%{_datadir}/java
for jar in *-%{version}*; do
ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
done
)
%endif
# remove unneeded files
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/libdb.so
rm -f %{buildroot}%{_libdir}/libdb_cxx.so
rm -f %{buildroot}%{_libdir}/libdb.a
rm -f %{buildroot}%{_libdir}/libdb_cxx.a
rm -f %{buildroot}%{_libdir}/libdb_tcl.so
rm -f %{buildroot}%{_libdir}/libdb-%{MAJver}.so
rm -f %{buildroot}%{_libdir}/libdb_cxx-%{MAJver}.so
rm -f %{buildroot}%{_libdir}/libdb_tcl-%{MAJver}.so
chmod +x %{buildroot}%{_libdir}/*.so*
#ln -sf libdb-%{majver}.so %{buildroot}%{_libdir}/libdb.so
#ln -sf libdb_cxx-%{majver}.so %{buildroot}%{_libdir}/libdb_cxx.so
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n libdb48 -p /sbin/ldconfig
%postun -n libdb48 -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/*
%files -n libdb48
%defattr(-,root,root)
%{_libdir}/libdb-%{majver}.so
%{_libdir}/libdb_cxx-%{majver}.so
%{_libdir}/libdb.so.%{majver}
%files -n libdb48-devel
%defattr(-,root,root)
%{_includedir}/*
#%{_libdir}/libdb_cxx.so
#%{_libdir}/libdb.so
%files docs
%defattr(-,root,root)
%dir %{_datadir}/doc/libdb4-%{version}
%{_datadir}/doc/libdb4-%{version}/*
%files -n libdb48-static
%defattr(-,root,root)
%{_libdir}/libdb-%{majver}.a
%{_libdir}/libdb_cxx-%{majver}.a
%{_libdir}/libdb_java-%{majver}.a
%{_libdir}/libdb_tcl-%{majver}.a
%post -n libdb48-tcl -p /sbin/ldconfig
%postun -n libdb48-tcl -p /sbin/ldconfig
%files -n libdb48-tcl
%defattr(-,root,root)
%{_libdir}/libdb_tcl-%{majver}.so
%post -n java-bdb48 -p /sbin/ldconfig
%postun -n java-bdb48 -p /sbin/ldconfig
%files -n java-bdb48
%defattr(-,root,root)
%{_libdir}/libdb_java.so
%{_libdir}/libdb_java-%{MAJver}.so
%{_libdir}/libdb_java-%{majver}.so
%{_libdir}/libdb_java-%{majver}_g.so
%{_libdir}/libdb_java.so.%{majver}
%{_datadir}/java/db-%{version}.jar
%{_datadir}/java/db.jar
%changelog
* Thu Sep 15 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 4.8.30-4mamba
- java-bdb48: don't obsolete libdb-java, provided by libdb51-java
* Thu Mar 31 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 4.8.30-3mamba
- remove requirement for java-openjdk; current system jdk is used
- ok let's leave headers in %{_includedir}/db4 instead of %{_includedir}/db48
- but don't make this the system default db version thus not installing %{_includedir}/db*.h
* Sat Feb 26 2011 gil <puntogil@libero.it> 4.8.30-2mamba
- rename to db48
- add db48 libdb48-static docs sub packages
* Mon Jan 17 2011 gil <puntogil@libero.it> 4.8.30-1mamba
- update to 4.8.30
- add java-openjdk support
- add db 185 support
- add libtcl support
- move headers files in %{_includedir}/db4 and create db.h db_cxx.h db_185.h links in %{_includedir}
- add db.jar with version
- add libdb-tcl sub package
* Thu Dec 31 2009 Automatic Build System <autodist@mambasoft.it> 4.8.26-1mamba
- automatic update to 4.8.26 by autodist
* Fri Sep 25 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 4.8.24-1mamba
- update to 4.8.24
* Thu Jul 03 2008 gil <puntogil@libero.it> 4.7.25-1mamba
- update to version 4.7.25
- removed patches
* Wed Jun 04 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-8mamba
- specfile updated
* Thu Jul 13 2006 Davide Madrisan <davide.madrisan@qilinux.it> 4.2.52-7qilnx
- fixed openldap warning: "BerkeleyDB 4.2.52 library needs TXN patch!"
- official patches applied
- fixed permissions of binary files
* Wed Oct 26 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-6qilnx
- add OpenOffice patch
* Mon Oct 24 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-5qilnx
- do not link against libpthread
* Mon Oct 24 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-4qilnx
- rebuild with gcj
* Wed Feb 02 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-3qilnx
- rebuilt with java bindings
* Tue Jul 27 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.25-8qilnx
- new version build
- source RPM renamed to db42 (should cohexist with libdb4)
* Sun May 09 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-8qilnx
- added libdb.so provides
* Fri May 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-7qilnx
- fixed symlinks for compatibility
* Fri May 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-6qilnx
- rebuild with --enable-compat185
* Tue Sep 15 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-5qilnx
- Added symlink /usr/include/db.h so that db4 is system default version
* Tue Sep 09 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-4qilnx
- Moved includes to /usr/include/db4 for devel packages co-existence
* Fri Jul 25 2003 Silvan Calarco <silvan.calarco@qinet.it> 4.1.25-3qilnx
- Removed compat185 (it looks broken, I'll try to use db2's compat185)
* Thu Jul 24 2003 Silvan Calarco <silvan.calarco@qinet.it> 4.1.25-2qilnx
- Enabled compatibiliy with version 185
* Tue Apr 22 2003 Luca Tinelli <luca.tinelli@qinet.it> 4.1.25-1qilnx
- Creation of db4 package