2 # - new usptream: http://sourceforge.net/projects/nssdb/
3 # see http://www.linux-archive.org/development-discussions-related-fedora-devel-lists-fedoraproject-org/546891-nss_db.html
4 # - think of how to install with glibc 2.15: rename to nss_bdb, use /var/bdb (latter not FHS compatible?)
5 # 4.8 makes libpthread a hard requirement
6 # 4.7 has a heavier footprint
7 %define db_version 4.6.21
9 Summary: Berkeley DB Name Service Switch Module
10 Summary(pl.UTF-8): Moduł NSS do baz db
14 # DB is under the Sleepycat (Oracle) license.
15 # nss_db is under the LGPLv2+ license.
16 License: Sleepycat and LGPL v2+
18 URL: http://sourceforge.net/projects/nssdb/
19 Source0: http://downloads.sourceforge.net/nssdb/%{name}-%{version}.tar.gz
20 # Source0-md5: 5216e844559cd5aad1823f8de2269bf6
21 Source1: http://download.oracle.com/berkeley-db/db-%{db_version}.tar.gz
22 # Source1-md5: 718082e7e35fc48478a2334b0bc4cd11
23 Patch0: %{name}-chmod_644.patch
24 Patch1: %{name}-amfix.patch
25 Patch2: %{name}-glibc23.patch
26 Patch3: %{name}-db41.patch
27 Patch4: %{name}-errno.patch
28 Patch5: %{name}-link.patch
29 Patch6: %{name}-enoent.patch
30 Patch7: %{name}-uniqdb.patch
31 Patch8: %{name}-initialize.patch
32 Patch9: %{name}-selinux.patch
33 Patch10: %{name}-makedb-atomic.patch
34 Patch11: %{name}-makedb-shared.patch
35 Patch101: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.1
36 Patch102: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.2
37 Patch103: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.3
38 Patch104: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.4
39 BuildRequires: autoconf
40 BuildRequires: automake >= 1.4
41 BuildRequires: db-devel
42 BuildRequires: gettext-tools
43 BuildRequires: glibc-devel >= 2.3
44 BuildRequires: libselinux-devel
45 # because of broken configure
46 BuildRequires: libstdc++-devel
47 BuildRequires: libtool
48 Requires: glibc >= 6:2.3
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 # glibc private symbols
54 %define _noautoreq .*(GLIBC_PRIVATE)
57 This is nss_db, a name service switch module that can be used with
60 %description -l pl.UTF-8
61 To jest nss_db, moduł do serwisu nazw, który może być używany z
68 #%patch2 -p1 # seems obsolete
69 #%patch3 -p1 # obsolete
87 dbdir=$(pwd)/db-instroot
93 CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
94 LDFLAGS="%{rpmcflags} %{rpmldflags}"
95 export CC CXX CFLAGS CXXFLAGS LDFLAGS
97 echo db_cv_mutex=UNIX/fcntl > config.cache
98 ../db-%{db_version}/dist/configure -C \
101 --disable-diagnostic \
107 --disable-cryptography \
110 --disable-replication \
111 --disable-statistics \
114 --with-uniquename=_nssdb \
134 # Check for any problems, since we filter GLIBC_PRIVATE provs
135 # in glibc package and deps here
136 cat >> test-dlopen.c << _EOF
138 /* Simple program to see if dlopen() would succeed. */
139 int main(int argc, char **argv)
141 if (dlopen(argv[1], RTLD_NOW))
147 %{__cc} %{rpmcflags} -o test-dlopen test-dlopen.c -ldl
149 ./test-dlopen src/.libs/libnss_db.so.2.0.0
152 rm -rf $RPM_BUILD_ROOT
153 install -d $RPM_BUILD_ROOT{/%{_lib},/var/db}
157 DESTDIR=$RPM_BUILD_ROOT
159 rm $RPM_BUILD_ROOT%{_libdir}/libnss_db.so
160 cp -a db-Makefile $RPM_BUILD_ROOT/var/db/Makefile
162 cat << EOF -> $RPM_BUILD_ROOT%{_bindir}/create-db
164 %{__make} -sC /var/db
167 ln -sf create-db $RPM_BUILD_ROOT%{_bindir}/update-db
172 rm -rf $RPM_BUILD_ROOT
174 %post -p /sbin/ldconfig
177 if [ "$1" -eq 0 -a -f %{_sysconfdir}/nsswitch.conf ] ; then
179 /^\(passwd\|group\|ethers\|protocols\|rpc\|services\|shadow\|netgroup\|hosts\):/ !b
180 s/[[:blank:]]\+db\>//
181 ' %{_sysconfdir}/nsswitch.conf
184 %postun -p /sbin/ldconfig
186 %files -f %{name}.lang
187 %defattr(644,root,root,755)
188 %doc AUTHORS ChangeLog NEWS README THANKS
189 %attr(755,root,root) /%{_lib}/libnss_db-*.so
190 %attr(755,root,root) %ghost /%{_lib}/libnss_db.so.2
191 %attr(755,root,root) %{_bindir}/create-db
192 %attr(755,root,root) %{_bindir}/makedb
193 %attr(755,root,root) %{_bindir}/update-db
195 %config(noreplace) %verify(not md5 mtime size) /var/db/Makefile