# - should unmount /proc/fs/nfsd and /var/lib/nfs/rpc_pipefs at package
# uninstall (or in service nfs stop)
#
+# Conditional build:
+%bcond_with heimdal # build with Heimdal Kerberos instead of MIT
+#
Summary: Kernel NFS server
Summary(pl.UTF-8): Działający na poziomie jądra serwer NFS
Summary(pt_BR.UTF-8): Os utilitários para o cliente e servidor NFS do Linux
Summary(uk.UTF-8): Утиліти для NFS та демони підтримки для NFS-сервера ядра
Name: nfs-utils
Version: 1.2.0
-Release: 0.1
+Release: 2
License: GPL v2
Group: Networking/Daemons
Source0: http://www.kernel.org/pub/linux/utils/nfs/%{name}-%{version}.tar.bz2
Patch1: %{name}-statdpath.patch
Patch2: %{name}-keytab-path.patch
Patch3: %{name}-subsys.patch
-Patch4: %{name}-git-cel.patch
-Patch5: %{name}-union-mount.patch
+Patch4: %{name}-union-mount.patch
+Patch5: %{name}-kerberos-ac.patch
+Patch6: %{name}-no_libgssapi.patch
+Patch7: %{name}-pkgconfig_ac.patch
+Patch8: %{name}-heimdal_functions.patch
URL: http://nfs.sourceforge.net/
BuildRequires: autoconf >= 2.59
BuildRequires: automake
BuildRequires: cpp
+%if %{with heimdal}
+BuildRequires: heimdal-devel >= 1.0
+%else
BuildRequires: krb5-devel >= 1.6
+BuildRequires: libgssglue-devel >= 0.1
+%endif
BuildRequires: libblkid-devel
BuildRequires: libevent-devel >= 1.2
-BuildRequires: libgssglue-devel >= 0.1
BuildRequires: libnfsidmap-devel >= 0.21-3
BuildRequires: librpcsecgss-devel >= 0.16
BuildRequires: libtirpc-devel >= 1:0.1.10-4
%setup -q -a1
%patch0 -p1
%patch1 -p1
-%patch2 -p1
+%{!?with_heimdal:%patch2 -p1}
%patch3 -p1
%patch4 -p1
+%if %{with heimdal}
%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p0
+%endif
# conflict with GNU stdio extension
sed -i -e 's/dprintf/dbgprintf/' support/include/ha-callout.h utils/statd/*.[ch]
--with-statduser=rpcstatd \
--with-start-statd=%{_sbindir}/start-statd \
--with-tcp-wrappers \
+%if %{with heimdal}
+ --with-krb5-config=%{_bindir}/krb5-config
+%else
--with-krb5=%{_prefix}
+%endif
%{__make} all