]> git.pld-linux.org Git - packages/nss_db.git/commitdiff
- enable db on package install and removal (rfc which dbs exactly?); remove all when...
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 9 Feb 2012 20:11:46 +0000 (20:11 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    nss_db.spec -> 1.44

nss_db.spec

index 52523d4db6008f974ad4dfde30ca3d785fb9c79c..54ad328ddcc99dc1724ec93684be473282d13fa9 100644 (file)
@@ -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
+               /\<db\>/ 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
This page took 0.099188 seconds and 4 git commands to generate.