#
+# TODO:
+# - define CONFIG_ option directly
+#
# Conditional build:
%bcond_without dist_kernel # allow non-distribution kernel
%bcond_without kernel # don't build kernel modules
%bcond_without userspace # don't build userspace programs
%bcond_with verbose # verbose build (V=1)
-%bcond_without vserver # kernel build without vserver & grsecurity
%if %{without kernel}
%undefine with_dist_kernel
%endif
-%define _cvsdate 20070914
-%define _rel 0.%{_cvsdate}.2
+%define subver 20080527
+%define prel 0.%{subver}.%{rel}
+
+%define rel 6
Summary: aufs - Another Unionfs
Summary(pl.UTF-8): aufs (Another Unionfs) - inny unionfs
Name: aufs
Version: 0
-Release: %{_rel}
+Release: %{prel}
License: GPL v2
Group: Base/Kernel
-Source0: %{name}-%{_cvsdate}.tar.bz2
-# Source0-md5: e40a80a7b93af168cae7f5b3499531e3
+Source0: %{name}-%{subver}.tar.bz2
+# Source0-md5: aeb6880930a8abcb60947e96b310d3df
Patch0: %{name}-vserver.patch
+Patch1: %{name}-disable-security_inode_permission.patch
+Patch2: %{name}-fixes.patch
+Patch3: %{name}-spin_lock.patch
URL: http://aufs.sourceforge.net/
%if %{with kernel}
-%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
+%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.25.2}
BuildRequires: rpmbuild(macros) >= 1.379
%endif
BuildRequires: sed >= 4.0
%package -n kernel%{_alt_kernel}-fs-aufs
Summary: Linux driver for aufs
Summary(pl.UTF-8): Sterownik dla Linuksa do aufs
-Release: %{_rel}@%{_kernel_ver_str}
+Release: %{prel}@%{_kernel_ver_str}
Group: Base/Kernel
Requires(post,postun): /sbin/depmod
%if %{with dist_kernel}
%prep
%setup -qn %{name}
-%if %{with vserver}
%patch0 -p1
-%endif
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+# we should make it better
sed '
s/$(CONFIG_AUFS)/m/;
%{!?debug:s/$(CONFIG_AUFS_DEBUG.*)/n/};
s/$(CONFIG_AUFS_EXPORT)/y/;
s/$(CONFIG_AUFS_SYSAUFS)/n/
' -i fs/aufs/Makefile
-cp -a include/linux fs/aufs
+cp -a include/linux fs/aufs25
%build
%if %{with kernel}
-%build_kernel_modules -C fs/aufs -m aufs \
- EXTRA_CFLAGS=" \
+if [ -f %{_kernelsrcdir}/include/linux/vs_base.h ]; then
+ isvserver="-DVSERVER"
+fi
+export CONFIG_AUFS=m
+export CONFIG_AUFS_BR_XFS=y
+%build_kernel_modules -C fs/aufs25 -m aufs \
+ EXTRA_CFLAGS+=" \
-DCONFIG_AUFS_BRANCH_MAX_127 \
-DCONFIG_AUFS_BRANCH_MAX_CHAR \
-DCONFIG_AUFS_FAKE_DM \
-DCONFIG_AUFS_MODULE \
-UCONFIG_AUFS_KSIZE_PATCH \
+ -UCONFIG_AUFS_DLGT \
%{?debug:-DCONFIG_AUFS_DEBUG} \
- %{?with_vserver:-DVSERVER} \
- "
+ $isvserver"
%endif
%if %{with userspace}
%endif
%if %{with kernel}
-%install_kernel_modules -m fs/aufs/aufs -d kernel/fs/aufs
+%install_kernel_modules -m fs/aufs25/aufs -d kernel/fs/aufs
%endif
%clean