-BuildRequires: db3-devel
-BuildRequires: pam-devel
-%{!?_without_ldap:BuildRequires: openldap-devel}
-%{!?_without_tls:BuildRequires: openssl-devel}
+%{?with_db3:BuildRequires: db3-devel}
+%{!?with_db3:BuildRequires: db-devel >= 4.1.25}
+BuildRequires: man
+%{?with_ldap:BuildRequires: openldap-devel}
+%{?with_tls:BuildRequires: openssl-devel >= 0.9.7d}
+%{?with_pgsql:BuildRequires: postgresql-devel}
+BuildRequires: rpmbuild(macros) >= 1.159
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires(post): awk
+Requires(post): textutils
+Requires(post,preun):/sbin/chkconfig
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
+%{!?with_db3:Requires: db >= 4.1.25}