1 # 4.8 makes libpthread a hard requirement
2 # 4.7 has a heavier footprint
3 %define db_version 4.6.21
7 Summary: Berkeley DB Name Service Switch Module
8 Summary(pl.UTF-8): Moduł NSS do baz db
11 Release: 0.%{subver}.%{rel}
12 # DB is under the Sleepycat (Oracle) license.
13 # nss_db is under the LGPLv2+ license.
14 License: Sleepycat and LGPL v2+
16 Source0: ftp://sources.redhat.com/pub/glibc/old-releases/%{name}-%{version}%{subver}.tar.gz
17 # Source0-md5: b4440ba2865d28e9068e465426c19ede
18 Source1: http://download.oracle.com/berkeley-db/db-%{db_version}.tar.gz
19 # Source1-md5: 718082e7e35fc48478a2334b0bc4cd11
20 Patch0: %{name}-chmod_644.patch
21 Patch1: %{name}-amfix.patch
22 Patch2: %{name}-glibc23.patch
23 Patch3: %{name}-db41.patch
24 Patch4: %{name}-errno.patch
25 Patch5: %{name}-link.patch
26 Patch6: %{name}-enoent.patch
27 Patch7: %{name}-uniqdb.patch
28 Patch8: %{name}-initialize.patch
29 Patch9: %{name}-selinux.patch
30 Patch10: %{name}-makedb-atomic.patch
31 Patch101: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.1
32 Patch102: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.2
33 Patch103: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.3
34 Patch104: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.4
35 BuildRequires: autoconf
36 BuildRequires: automake >= 1.4
37 BuildRequires: db-devel
38 # because of broken configure
39 BuildRequires: gcc-c++
40 BuildRequires: gettext-devel
41 BuildRequires: glibc-devel >= 2.3
42 BuildRequires: libselinux-devel
43 BuildRequires: libtool
44 Requires: glibc >= 6:2.3
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 %define _noautoprov .*\(GLIBC_PRIVATE\)
50 %define _noautoreq .*\(GLIBC_PRIVATE\)
53 This is nss_db, a name service switch module that can be used with
56 %description -l pl.UTF-8
57 To jest nss_db, moduł do serwisu nazw, który może być używany z
61 %setup -q -n %{name}-%{version}%{subver} -a1
82 dbdir=$(pwd)/db-instroot
88 CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
89 LDFLAGS="%{rpmcflags} %{rpmldflags}"
90 export CC CXX CFLAGS CXXFLAGS LDFLAGS
92 echo db_cv_mutex=UNIX/fcntl > config.cache
93 ../db-%{db_version}/dist/configure -C \
96 --disable-diagnostic \
102 --disable-cryptography \
105 --disable-replication \
106 --disable-statistics \
109 --with-uniquename=_nssdb \
129 # Check for any problems, since we filter GLIBC_PRIVATE provs
130 # in glibc package and deps here
131 cat >> test-dlopen.c << _EOF
133 /* Simple program to see if dlopen() would succeed. */
134 int main(int argc, char **argv)
136 if (dlopen(argv[1], RTLD_NOW))
142 %{__cc} %{rpmcflags} -o test-dlopen test-dlopen.c -ldl
144 ./test-dlopen src/.libs/libnss_db.so.2.0.0
147 rm -rf $RPM_BUILD_ROOT
148 install -d $RPM_BUILD_ROOT{/%{_lib},/var/db}
152 DESTDIR=$RPM_BUILD_ROOT
154 rm $RPM_BUILD_ROOT%{_libdir}/libnss_db.so
155 cp -a db-Makefile $RPM_BUILD_ROOT/var/db/Makefile
157 cat << EOF -> $RPM_BUILD_ROOT%{_bindir}/create-db
159 %{__make} -sC /var/db
162 ln -sf create-db $RPM_BUILD_ROOT%{_bindir}/update-db
167 rm -rf $RPM_BUILD_ROOT
169 %post -p /sbin/ldconfig
170 %postun -p /sbin/ldconfig
172 %files -f %{name}.lang
173 %defattr(644,root,root,755)
174 %doc AUTHORS ChangeLog NEWS README THANKS
175 %attr(755,root,root) /%{_lib}/libnss_db-*.so
176 %attr(755,root,root) %ghost /%{_lib}/libnss_db.so.2
177 %attr(755,root,root) %{_bindir}/create-db
178 %attr(755,root,root) %{_bindir}/makedb
179 %attr(755,root,root) %{_bindir}/update-db
181 %config(noreplace) %verify(not md5 mtime size) /var/db/Makefile