# - fix make anyfs_module
# - make subpackage for libany.a ( -libany or just -static)
+#
+# Conditional build:
%bcond_without dist_kernel # allow non-distribution kernel
%bcond_without kernel # don't build 'any' kernel module
-
+%bcond_without userspace # don't build userspace utilities
+#
Summary: anyfs-tools - a unix-like toolset for recovering and converting filesystems
Summary(pl.UTF-8): anyfs-tools - uniksowy zestaw narzędzi do odzyskiwania i konwersji systemów plików
Name: anyfs-tools
Source0: http://dl.sourceforge.net/anyfs-tools/%{name}-%{version}.tar.bz2
# Source0-md5: c5d13e636b0097386f5aebf4c445d627
Patch0: %{name}-DFL_RTEXTSIZE.patch
+Patch1: %{name}-blksize.patch
URL: http://anyfs-tools.sourceforge.net/
BuildRequires: e2fsprogs-devel >= 1.38
%if %{with kernel}
-%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.9}
+%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
BuildRequires: rpmbuild(macros) >= 1.379
%endif
BuildRequires: libfuse-devel >= 2.5
BuildRequires: mjpegtools-devel
BuildRequires: mpeg2dec-devel
-BuildRequires: xfsprogs-devel
+BuildRequires: xfsprogs-devel >= 2.8.11
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
tabeli i-węzłów przy odmontowywaniu systemu plików, bez zmiany danych
na urządzeniu blokowym.
+%package devel
+Summary: Header files for anyfs-tools
+Summary(pl.UTF-8): Pliki nagłówkowe anyfs-tools
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header files for anyfs-tools.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe anyfs-tools.
+
%package -n kernel%{_alt_kernel}-misc-any
-Summary: AnyFS kernel module
-Summary(pl.UTF-8): Modul AnyFS
+Summary: AnyFS Linux kernel module
+Summary(pl.UTF-8): Moduł jądra Linuksa AnyFS
Release: %{_rel}@%{_kernel_ver_str}
License: GPL v2
Group: Base/Kernel
%endif
%description -n kernel%{_alt_kernel}-misc-any
-This package contains the AnyFS kernel module.
-
-%package devel
-Summary: Header files for anyfs-tools
-Summary(pl.UTF-8): Pliki nagłówkowe anyfs-tools
-Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
-
-%description devel
-Header files for anyfs-tools.
+This package contains the AnyFS Linux kernel module.
-%description devel -l pl.UTF-8
-Pliki nagłówkowe anyfs-tools.
+%description -n kernel%{_alt_kernel}-misc-any -l pl.UTF-8
+Ten pakiet zawiera moduł jądra Linuksa AnyFS.
%prep
%setup -q
%patch0 -p0
+%patch1 -p0
+
+%if %{with kernel}
cat > anyfs/Makefile <<'EOF'
obj-m += any.o
any-objs := inode.o file.o dir.o namei.o symlink.o
EOF
+%endif
%build
+%if %{with userspace}
%configure
%{__make} libany
%{__make} progs
+%endif
+
%if %{with kernel}
%build_kernel_modules -C anyfs -m any
%endif
%install
rm -rf $RPM_BUILD_ROOT
+%if %{with userspace}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%endif
%if %{with kernel}
%install_kernel_modules -m anyfs/any -d kernel/fs -n any -s current
%clean
rm -rf $RPM_BUILD_ROOT
+%post -n kernel%{_alt_kernel}-misc-any
+%depmod %{_kernel_ver}
+
+%postun -n kernel%{_alt_kernel}-misc-any
+%depmod %{_kernel_ver}
+
+%if %{with userspace}
%files -f %{name}.lang
%defattr(644,root,root,755)
%doc README THANKS
%{_mandir}/man5/*
%{_mandir}/man8/*
%lang(ru) %{_mandir}/ru/man3/*
-%lang(ru) %{_mandir}/ru/man3/*
%lang(ru) %{_mandir}/ru/man5/*
%lang(ru) %{_mandir}/ru/man8/*
-%if %{with kernel}
-%files -n kernel%{_alt_kernel}-misc-any
+%files devel
%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/kernel/fs/any.ko*
+%{_includedir}/anyfs-tools
%endif
-%files devel
+%if %{with kernel}
+%files -n kernel%{_alt_kernel}-misc-any
%defattr(644,root,root,755)
-%{_includedir}/anyfs-tools
+/etc/modprobe.d/%{_kernel_ver}/any.conf
+/lib/modules/%{_kernel_ver}/kernel/fs/any-current.ko*
+%endif