SHA256
3
0
forked from pool/rpm

Disable BerkeleyDB and switch over to ndb

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=529
This commit is contained in:
Michael Schröder 2020-01-17 14:07:00 +00:00 committed by Git OBS Bridge
parent ea73343fda
commit 4f3b62c4df

View File

@ -20,6 +20,7 @@
%{?!_fillupdir:%define _fillupdir /var/adm/fillup-templates} %{?!_fillupdir:%define _fillupdir /var/adm/fillup-templates}
%global librpmsover 9 %global librpmsover 9
%global without_bdb 1
Name: rpm Name: rpm
BuildRequires: binutils BuildRequires: binutils
@ -215,6 +216,7 @@ and requires some packages that are usually required.
%prep %prep
%setup -q -n rpm-%{version} %setup -q -n rpm-%{version}
rm -rf sqlite rm -rf sqlite
%if 0%{?!without_bdb:1}
tar xjf %{SOURCE11} tar xjf %{SOURCE11}
ln -s db-4.8.30 db ln -s db-4.8.30 db
cd db cd db
@ -222,6 +224,8 @@ cd db
cd .. cd ..
chmod -R u+w db/* chmod -R u+w db/*
rm -f rpmdb/db.h rm -f rpmdb/db.h
cp config.guess config.sub db/dist/
%endif
%patch3 -p1 %patch3 -p1
%patch5 -p1 %patch5 -p1
%patch -P 11 -P 12 -P 13 -P 15 -P 16 -P 18 %patch -P 11 -P 12 -P 13 -P 15 -P 16 -P 18
@ -241,7 +245,6 @@ rm -f rpmdb/db.h
%patch6464 %patch6464
%endif %endif
cp config.guess config.sub db/dist/
tar -xjvf %{SOURCE1} tar -xjvf %{SOURCE1}
rm -f m4/libtool.m4 rm -f m4/libtool.m4
rm -f m4/lt*.m4 rm -f m4/lt*.m4
@ -270,10 +273,13 @@ autoreconf -fi
--with-crypto=libgcrypt \ --with-crypto=libgcrypt \
--with-acl \ --with-acl \
--with-cap \ --with-cap \
--enable-shared \
--enable-ndb \ --enable-ndb \
--enable-bdb-ro \ --enable-bdb-ro \
--enable-zstd \ --enable-zstd \
--enable-shared %{?with_python: --enable-python} $BUILDTARGET %{?without_bdb: --enable-bdb=no} \
%{?with_python: --enable-python} \
$BUILDTARGET
rm po/de.gmo rm po/de.gmo
make %{?_smp_mflags} make %{?_smp_mflags}
@ -285,7 +291,9 @@ ln -s ../share/locale %{buildroot}/usr/lib/locale
%make_install %make_install
mkdir -p %{buildroot}/bin mkdir -p %{buildroot}/bin
ln -s /usr/bin/rpm %{buildroot}/bin/rpm ln -s /usr/bin/rpm %{buildroot}/bin/rpm
%if 0%{?!without_bdb:1}
install -m 644 db3/db.h %{buildroot}/usr/include/rpm install -m 644 db3/db.h %{buildroot}/usr/include/rpm
%endif
# remove .la file and the static variant of libpopt # remove .la file and the static variant of libpopt
# have to remove the dependency from other .la files as well # have to remove the dependency from other .la files as well
for f in %{buildroot}/%{_libdir}/*.la; do for f in %{buildroot}/%{_libdir}/*.la; do
@ -355,17 +363,24 @@ sh %{buildroot}/usr/lib/rpm/find-lang.sh %{buildroot} rpm
# so we need to enforce the platform here. # so we need to enforce the platform here.
echo -n "%{_target_cpu}-suse-linux-gnueabi" > %{buildroot}/etc/rpm/platform echo -n "%{_target_cpu}-suse-linux-gnueabi" > %{buildroot}/etc/rpm/platform
%endif %endif
%if 0%{?without_bdb:1}
# make ndb the default database backend
echo "setting the default database backend to 'ndb'"
sed -i -e '/_db_backend/s/bdb/ndb/' %{buildroot}/usr/lib/rpm/macros
%endif
%post %post
%{fillup_only -an services} %{fillup_only -an services}
# var/lib/rpm migration: set forwards compatible symlink for /usr/lib/sysimage/rpm so scriptlets in same transaction will still work # var/lib/rpm migration: set forwards compatible symlink for /usr/lib/sysimage/rpm so scriptlets in same transaction will still work
if test ! -L var/lib/rpm -a -f var/lib/rpm/Packages -a ! -f usr/lib/sysimage/rpm/Packages ; then if test ! -L var/lib/rpm -a ! -f usr/lib/sysimage/rpm/Packages -a ! -f usr/lib/sysimage/rpm/Packages.db ; then
if test -f var/lib/rpm/Packages -o -f var/lib/rpm/Packages.db ; then
rmdir usr/lib/sysimage/rpm rmdir usr/lib/sysimage/rpm
ln -s ../../../var/lib/rpm usr/lib/sysimage/rpm ln -s ../../../var/lib/rpm usr/lib/sysimage/rpm
fi fi
fi
test -f usr/lib/sysimage/rpm/Packages || rpmdb --initdb test -f usr/lib/sysimage/rpm/Packages -o -f usr/lib/sysimage/rpm/Packages.db || rpmdb --initdb
test -e var/lib/rpm || ln -s ../../usr/lib/sysimage/rpm var/lib/rpm test -e var/lib/rpm || ln -s ../../usr/lib/sysimage/rpm var/lib/rpm
%posttrans %posttrans
@ -374,7 +389,7 @@ if test ! -L var/lib/rpm ; then
# delete no longer maintained databases # delete no longer maintained databases
rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion var/lib/rpm/Provideversion rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion var/lib/rpm/Provideversion
if test -f var/lib/rpm/Packages ; then if test -f var/lib/rpm/Packages -o -f var/lib/rpm/Packages.db ; then
echo "migrating rpmdb from /var/lib/rpm to /usr/lib/sysimage/rpm..." echo "migrating rpmdb from /var/lib/rpm to /usr/lib/sysimage/rpm..."
# remove forwards compatible symlink # remove forwards compatible symlink