#
# Conditional build:
%bcond_without tests # testsuite on build
+%bcond_without dirmngr # dirmngr packages build
%bcond_with default_gpg # install as gpg/gpgv instead of gpg2/gpgv2
%bcond_with gnutls # GnuTLS instead of NTBTLS
%bcond_with selinux # "SELinux hacks"
BuildRequires: libusb-devel >= 1.0
BuildRequires: npth-devel >= 1.2
%{!?with_gnutls:BuildRequires: ntbtls-devel >= 0.1.0}
-# only for dirmngr, which is not built here
-#BuildRequires: openldap-devel
+%{?with_dirmngr:BuildRequires: openldap-devel >= 2.4.6}
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: rpmbuild(macros) >= 1.177
%description -n gnupg-smime -l pl.UTF-8
Rozszerzenie GnuPG - obsługa S/MIME.
+%package -n dirmngr
+Summary: X509/LDAP certificate and revocation list client
+Summary(pl.UTF-8): Klient certyfikatów i list anulujących X509/LDAP
+Group: Applications
+Requires: %{name}-common = %{version}-%{release}
+
+%description -n dirmngr
+DirMngr is a client for managing and downloading certificate
+revocation lists (CRLs) for X509 certificates and for downloading the
+certificates themselves. DirMngr is usually invoked by gpgsm and in
+general not used directly.
+
+%description -n dirmngr -l pl.UTF-8
+DirMngr to klient do zarządzania i pobierania list anulujących
+certyfikaty (CRLs - certificate revocation lists) dla certyfikatów
+X509 oraz do pobierania samych certyfikatów. DirMngr jest zwykle
+wywoływany przez gpgsm i nie używany bezpośrednio.
+
%prep
%setup -q -n gnupg-%{version}
%patch0 -p1
%{__automake}
%configure \
--libexecdir=%{pkglibexecdir} \
- --disable-dirmngr \
+ %{!?with_dirmngr:--disable-dirmngr} \
--enable-g13 \
%{!?with_default_gpg:--enable-gpg-is-gpg2} \
%{?with_gnutls:--disable-ntbtls} \
install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/profile.d/gnupg-agent.sh
install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/X11/xinit/xinitrc.d/gnupg-agent.sh
+%if %{without dirmngr}
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/{man1/dirmngr-client.1,man8/dirmngr.8}
+%endif
+
+%{__rm} -f $RPM_BUILD_ROOT%{_datadir}/info/dir
+
+# files useful for users packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/gnupg
+
%find_lang gnupg2
rm -f $RPM_BUILD_ROOT%{_datadir}/info/dir
%files -n gnupg-agent-xinitrc
%defattr(644,root,root,755)
%attr(755,root,root) /etc/X11/xinit/xinitrc.d/gnupg-agent.sh
+
+%if %{with dirmngr}
+%files -n dirmngr
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/dirmngr
+%attr(755,root,root) %{_bindir}/dirmngr-client
+%attr(755,root,root) %{pkglibexecdir}/dirmngr_ldap
+%{_mandir}/man1/dirmngr-client.1*
+%{_mandir}/man8/dirmngr.8*
+%endif