From 5acbb529e15e000bef01453a728f86e53a72372b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 9 Feb 2012 20:11:46 +0000 Subject: [PATCH] - enable db on package install and removal (rfc which dbs exactly?); remove all when pkg removed Changed files: nss_db.spec -> 1.44 --- nss_db.spec | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/nss_db.spec b/nss_db.spec index 52523d4..54ad328 100644 --- a/nss_db.spec +++ b/nss_db.spec @@ -1,3 +1,6 @@ +# TODO +# - new usptream: http://sourceforge.net/projects/nssdb/ +# see http://www.linux-archive.org/development-discussions-related-fedora-devel-lists-fedoraproject-org/546891-nss_db.html # 4.8 makes libpthread a hard requirement # 4.7 has a heavier footprint %define db_version 4.6.21 @@ -36,14 +39,15 @@ Patch104: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21 BuildRequires: autoconf BuildRequires: automake >= 1.4 BuildRequires: db-devel -# because of broken configure -BuildRequires: gcc-c++ BuildRequires: gettext-devel BuildRequires: glibc-devel >= 2.3 BuildRequires: libselinux-devel +# because of broken configure +BuildRequires: libstdc++-devel BuildRequires: libtool Requires: glibc >= 6:2.3 Requires: make +Requires: sed >= 4.0 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) # private symbols @@ -171,6 +175,23 @@ rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig +%post +if [ -f %{_sysconfdir}/nsswitch.conf ]; then + %{__sed} -i -e ' + /^\(passwd\|group\|hosts\):/ !b + /\/ b + s/[[:blank:]]*$/ db/ + ' %{_sysconfdir}/nsswitch.conf +fi + +%preun +if [ "$1" -eq 0 -a -f %{_sysconfdir}/nsswitch.conf ] ; then + %{__sed} -i -e ' + /^\(passwd\|group\|ethers\|protocols\|rpc\|services\|shadow\|netgroup\|hosts\):/ !b + s/[[:blank:]]\+db\>// + ' %{_sysconfdir}/nsswitch.conf +fi + %files -f %{name}.lang %defattr(644,root,root,755) %doc AUTHORS ChangeLog NEWS README THANKS -- 2.44.0