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 Patch101: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.1
31 Patch102: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.2
32 Patch103: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.3
33 Patch104: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.4
34 BuildRequires: autoconf
35 BuildRequires: automake >= 1.4
36 BuildRequires: gettext-devel
37 BuildRequires: glibc-devel >= 2.3
38 BuildRequires: libselinux-devel
39 BuildRequires: libtool
40 Requires: glibc >= 6:2.3
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 %define _noautoprov .*\(GLIBC_PRIVATE\)
46 %define _noautoreq .*\(GLIBC_PRIVATE\)
49 This is nss_db, a name service switch module that can be used with
52 %description -l pl.UTF-8
53 To jest nss_db, moduł do serwisu nazw, który może być używany z
57 %setup -q -n %{name}-%{version}%{subver} -a1
77 dbdir=$(pwd)/db-instroot
83 CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
84 LDFLAGS="%{rpmcflags} %{rpmldflags}"
85 export CC CXX CFLAGS CXXFLAGS LDFLAGS
87 echo db_cv_mutex=UNIX/fcntl > config.cache
88 ../db-%{db_version}/dist/configure -C \
91 --disable-diagnostic \
97 --disable-cryptography \
100 --disable-replication \
101 --disable-statistics \
104 --with-uniquename=_nssdb \
124 # Check for any problems, since we filter GLIBC_PRIVATE provs
125 # in glibc package and deps here
126 cat >> test-dlopen.c << _EOF
128 /* Simple program to see if dlopen() would succeed. */
129 int main(int argc, char **argv)
131 if (dlopen(argv[1], RTLD_NOW))
137 %{__cc} %{rpmcflags} -o test-dlopen test-dlopen.c -ldl
139 ./test-dlopen src/.libs/libnss_db.so.2.0.0
142 rm -rf $RPM_BUILD_ROOT
143 install -d $RPM_BUILD_ROOT{/%{_lib},/var/db}
147 DESTDIR=$RPM_BUILD_ROOT
149 rm $RPM_BUILD_ROOT%{_libdir}/libnss_db.so
150 cp -a db-Makefile $RPM_BUILD_ROOT/var/db/Makefile
152 cat << EOF -> $RPM_BUILD_ROOT%{_bindir}/create-db
154 %{__make} -sC /var/db
157 ln -sf create-db $RPM_BUILD_ROOT%{_bindir}/update-db
162 rm -rf $RPM_BUILD_ROOT
164 %post -p /sbin/ldconfig
165 %postun -p /sbin/ldconfig
167 %files -f %{name}.lang
168 %defattr(644,root,root,755)
169 %doc AUTHORS ChangeLog NEWS README THANKS
170 %attr(755,root,root) /%{_lib}/libnss_db-*.so
171 %attr(755,root,root) %ghost /%{_lib}/libnss_db.so.2
172 %attr(755,root,root) %{_bindir}/create-db
173 %attr(755,root,root) %{_bindir}/makedb
174 %attr(755,root,root) %{_bindir}/update-db
176 %config(noreplace) %verify(not md5 mtime size) /var/db/Makefile