%define __spec_install_post /usr/lib/rpm/brp-compress || :
%define __spec_install_post %{nil}

Name		: ecryptfs
Version		: 20070208
Release		: 0%{?dist}
Summary		: eCryptfs Kernel Module
License		: GPL
Group		: System Environment/Kernel
URL		: http://ecryptfs.sourceforge.net/
Source0		: http://downloads.sourceforge.net/ecryptfs/ecryptfs-20070208.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
eCryptfs is a stacked cryptographic filesystem.

%package -n kernel-module-%{name}
Summary         : eCryptfs Kernel Module
Release         : %{__kernel_pkgrelease}_0%{?dist}
Group           : System Environment/Kernel
Requires        : kernel = %{__kernel_release}
Provides        : kernel-module-%{name}
Buildrequires   : kernel-devel
%description -n kernel-module-%{name}
This package contains the eCryptfs kernel module.

%prep
test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%setup -q 

%build
CFLAGS="%{?cflags:%{cflags}}%{!?cflags:$RPM_OPT_FLAGS}"
CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cflags:$RPM_OPT_FLAGS}"
export CFLAGS CXXFLAGS

%configure %{?acflags}
%{__make} %{?mflags}
%{__make} install DESTDIR=$RPM_BUILD_ROOT %{?mflags_install}
%{__make} clean

%clean
test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT

%post -n kernel-module-%{name}
if [ -f /boot/System.map-%{__kernel_release} ]; then
  %__depmod

fi

%postun -n kernel-module-%{name}
if [ "$1" -eq 1 ] ; then
 echo "An upgrade has been detected"
else
  echo "An uninstall has been detected"
  if [ -f /boot/System.map-%{__kernel_release} ]; then
    %__depmod

  fi
fi

%files
%files -n kernel-module-%{name}
%defattr(-,root,root,-)
/lib/modules/%{__kernel_release}/kernel/fs/ecryptfs/ecryptfs.ko

%changelog
* Thu Feb 08 2007 - Michael Halcrow <mhalcrow@us.ibm.com> 20070208-0
- Initial package.
