Accepting request 929659 from home:schubi2
- Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/929659 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libdb-4_8?expand=0&rev=61
This commit is contained in:
parent
e3b02da9d5
commit
6b8302156e
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 19 11:46:55 UTC 2021 - Stefan Schubert <schubi@suse.de>
|
||||
|
||||
- Use libalternatives instead of update-alternatives.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 27 00:06:09 UTC 2019 - William Brown <william.brown@suse.com>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package libdb-4_8
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -16,6 +16,12 @@
|
||||
#
|
||||
|
||||
|
||||
%if 0%{?suse_version} > 1500
|
||||
%bcond_without libalternatives
|
||||
%else
|
||||
%bcond_with libalternatives
|
||||
%endif
|
||||
|
||||
%define util_list archive checkpoint deadlock dump hotbackup load printlog recover sql stat upgrade verify
|
||||
%define generic_name db
|
||||
%define major 4
|
||||
@ -48,7 +54,12 @@ This package contains the necessary runtime libraries.
|
||||
%package -n db48-utils
|
||||
Summary: Command Line tools for Managing Berkeley DB Databases
|
||||
Group: Productivity/Databases/Tools
|
||||
%if %{with libalternatives}
|
||||
Requires: alts
|
||||
BuildRequires: alts
|
||||
%else
|
||||
Requires(post): update-alternatives
|
||||
%endif
|
||||
Provides: db-utils = %{version}
|
||||
Obsoletes: db-utils < %{version}
|
||||
|
||||
@ -164,6 +175,7 @@ mv %{buildroot}/%{_docdir}/%{name}/collections/tutorial %{buildroot}/%{_docdir}/
|
||||
# Remove crappy *.la files
|
||||
find %{buildroot} -type f -name "*.la" -delete -print
|
||||
|
||||
%if ! %{with libalternatives}
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||
|
||||
for i in %{util_list}; do
|
||||
@ -173,11 +185,29 @@ for i in %{util_list}; do
|
||||
mv "%{buildroot}/%{_bindir}/db_$i" "%{buildroot}/%{_bindir}/db48_$i"
|
||||
ln -s "%{_sysconfdir}/alternatives/db_$i" "%{buildroot}%{_bindir}/db_$i"
|
||||
done
|
||||
%else
|
||||
for i in %{util_list}; do
|
||||
mv "%{buildroot}/%{_bindir}/db_$i" "%{buildroot}/%{_bindir}/db48_$i"
|
||||
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/db_$i
|
||||
mkdir -p %{buildroot}%{_datadir}/libalternatives/db_$i
|
||||
echo "binary=%{_bindir}/db48_$i" >%{buildroot}%{_datadir}/libalternatives/db_$i/48.conf
|
||||
done
|
||||
%endif
|
||||
|
||||
%fdupes -s %{buildroot}
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%if %{with libalternatives}
|
||||
%pre
|
||||
# removing old update-alternatives entries
|
||||
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
|
||||
for i in %{util_list}; do
|
||||
update-alternatives --remove "db_$i" "%{_bindir}/db_$i"
|
||||
done
|
||||
fi
|
||||
%else
|
||||
%post -n db48-utils
|
||||
for i in %{util_list}; do
|
||||
update-alternatives --install "%{_bindir}/db_$i" \
|
||||
@ -188,6 +218,7 @@ done
|
||||
for i in %{util_list}; do
|
||||
update-alternatives --remove "db_$i" "%{_bindir}/db_$i"
|
||||
done
|
||||
%endif
|
||||
|
||||
%files
|
||||
%{_libdir}/libdb-%{major}.%{minor}.so
|
||||
@ -210,6 +241,7 @@ done
|
||||
|
||||
%files -n db48-utils
|
||||
%{_bindir}/db48_*
|
||||
%if ! 0%{with libalternatives}
|
||||
%ghost %{_sysconfdir}/alternatives/db_archive
|
||||
%ghost %{_sysconfdir}/alternatives/db_checkpoint
|
||||
%ghost %{_sysconfdir}/alternatives/db_deadlock
|
||||
@ -222,6 +254,33 @@ done
|
||||
%ghost %{_sysconfdir}/alternatives/db_stat
|
||||
%ghost %{_sysconfdir}/alternatives/db_upgrade
|
||||
%ghost %{_sysconfdir}/alternatives/db_verify
|
||||
%else
|
||||
%dir %{_datadir}/libalternatives
|
||||
%dir %{_datadir}/libalternatives/db_archive
|
||||
%dir %{_datadir}/libalternatives/db_checkpoint
|
||||
%dir %{_datadir}/libalternatives/db_deadlock
|
||||
%dir %{_datadir}/libalternatives/db_dump
|
||||
%dir %{_datadir}/libalternatives/db_hotbackup
|
||||
%dir %{_datadir}/libalternatives/db_load
|
||||
%dir %{_datadir}/libalternatives/db_printlog
|
||||
%dir %{_datadir}/libalternatives/db_recover
|
||||
%dir %{_datadir}/libalternatives/db_sql
|
||||
%dir %{_datadir}/libalternatives/db_stat
|
||||
%dir %{_datadir}/libalternatives/db_upgrade
|
||||
%dir %{_datadir}/libalternatives/db_verify
|
||||
%{_datadir}/libalternatives/db_archive/*
|
||||
%{_datadir}/libalternatives/db_checkpoint/*
|
||||
%{_datadir}/libalternatives/db_deadlock/*
|
||||
%{_datadir}/libalternatives/db_dump/*
|
||||
%{_datadir}/libalternatives/db_hotbackup/*
|
||||
%{_datadir}/libalternatives/db_load/*
|
||||
%{_datadir}/libalternatives/db_printlog/*
|
||||
%{_datadir}/libalternatives/db_recover/*
|
||||
%{_datadir}/libalternatives/db_sql/*
|
||||
%{_datadir}/libalternatives/db_stat/*
|
||||
%{_datadir}/libalternatives/db_upgrade/*
|
||||
%{_datadir}/libalternatives/db_verify/*
|
||||
%endif
|
||||
%{_bindir}/db_*
|
||||
|
||||
%files devel
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package libdb_java-4_8
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
|
Loading…
Reference in New Issue
Block a user