# Conditional build:
%bcond_without dist_kernel # without distribution kernel
%bcond_without kernel # don't build kernel modules
-%bcond_without smp # don't build SMP module
%bcond_with verbose # verbose build (V=1)
%bcond_without userspace # don't build userspace tools
-#
+
+%ifarch sparc
+%undefine with_smp
+%endif
+
+%if %{without kernel}
+%undefine with_dist_kernel
+%endif
+%if "%{_alt_kernel}" != "%{nil}"
+%undefine with_userspace
+%endif
+
+%define rel 20
Summary: (Secure) SHell FileSystem utilities
-Summary(pl): Narzêdzia obs³uguj±ce system plików przez ssh
+Summary(pl.UTF-8): Narzędzia obsługujące system plików przez ssh
Name: shfs
Version: 0.35
-%define _rel 1
-Release: %{_rel}
+Release: %{rel}
License: GPL v2
Group: Applications/System
-Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+Source0: http://dl.sourceforge.net/shfs/%{name}-%{version}.tar.gz
# Source0-md5: 016f49d71bc32eee2b5d11fc1600cfbe
Patch0: %{name}-opt.patch
+Patch1: %{name}-df.patch
+Patch2: %{name}-space_chars.patch
+Patch3: %{name}-uidgid32.patch
+Patch4: %{name}-gcc4.patch
+Patch5: %{name}-inode_oops.patch
+Patch6: %{name}-d_entry.patch
+Patch7: %{name}-shfs_get_sb.patch
+Patch8: %{name}-2.6.19.patch
+Patch9: %{name}-kmem_cache.patch
URL: http://shfs.sourceforge.net/
%if %{with kernel}
-%{?with_dist_kernel:BuildRequires: kernel-module-build >= 2.6.7}
-BuildRequires: %{kgcc_package}
+%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
+BuildRequires: rpmbuild(macros) >= 1.379
%endif
-BuildRequires: rpmbuild(macros) >= 1.153
+%{?with_dist_kernel:Requires: kernel(shfs)}
Obsoletes: shfsmount
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-SHFS is a simple and easy to use Linux kernel (2.4) module which
-allows you to mount remote filesystems using plain shell (ssh/rsh)
-connection. It supports some nice features like number of different
-caches for access speedup, target system optimisations, etc.
+SHFS is a simple and easy to use Linux kernel 2.4.10+ and 2.6 module
+which allows you to mount remote filesystems using plain shell
+(ssh/rsh) connection. It supports some nice features like number of
+different caches for access speedup, target system optimisations, etc.
This package contains utilities for SHFS.
-%description -l pl
-SHFS to prosty i ³atwy w u¿yciu modu³ j±dra Linuksa (2.4) pozwalaj±cy
-montowaæ zdalne systemy plików przy u¿yciu zwyk³ego po³±czenia ze
-zdaln± pow³ok± (ssh lub rsh). Obs³uguje pewne mi³e cechy, takie jak
-ró¿ne sposoby buforowania dla przyspieszenia dostêpu, optymalizacje
-pod k±tem zdalnego systemu itp.
+%description -l pl.UTF-8
+SHFS to prosty i łatwy w użyciu moduł jądra Linuksa 2.4.10+ i 2.6
+pozwalający montować zdalne systemy plików przy użyciu zwykłego
+połączenia ze zdalną powłoką (ssh lub rsh). Obsługuje pewne miłe
+cechy, takie jak różne sposoby buforowania dla przyspieszenia dostępu,
+optymalizacje pod kątem zdalnego systemu itp.
-Ten pakiet zawiera programy narzêdziowe dla SHFS.
+Ten pakiet zawiera programy narzędziowe dla SHFS.
-%package -n kernel-fs-shfs
+%package -n kernel%{_alt_kernel}-fs-shfs
Summary: SHell File System Linux kernel module
-Summary(pl): Modu³ j±dra Linuksa obs³uguj±cy pow³okowy system plików
-Release: %{_rel}@%{_kernel_ver_str}
+Summary(pl.UTF-8): Moduł jądra Linuksa obsługujący powłokowy system plików
+Release: %{rel}@%{_kernel_ver_str}
Group: Base/Kernel
-%{?with_dist_kernel:%requires_releq_kernel_up}
Requires(post,postun): /sbin/depmod
+%if %{with dist_kernel}
+%requires_releq_kernel
+Requires(postun): %releq_kernel
+%endif
+Provides: kernel(shfs)
+%if "%{_alt_kernel}" == "%{nil}"
Obsoletes: kernel-misc-shfs
+%endif
-%description -n kernel-fs-shfs
-SHell File System Linux kernel module.
-
-%description -n kernel-fs-shfs -l pl
-Modu³ j±dra Linuksa obs³uguj±cy pow³okowy system plików.
-
-%package -n kernel-smp-fs-shfs
-Summary: SHell File System Linux SMP kernel module
-Summary(pl): Modu³ j±dra Linuksa SMP obs³uguj±cy pow³okowy system plików
-Release: %{_rel}@%{_kernel_ver_str}
-Group: Base/Kernel
-%{?with_dist_kernel:%requires_releq_kernel_smp}
-Requires(post,postun): /sbin/depmod
-Obsoletes: kernel-smp-misc-shfs
-
-%description -n kernel-fs-shfs
+%description -n kernel%{_alt_kernel}-fs-shfs
SHell File System Linux kernel module.
-%description -n kernel-smp-fs-shfs -l pl
-Modu³ j±dra Linuksa obs³uguj±cy pow³okowy system plików.
+%description -n kernel%{_alt_kernel}-fs-shfs -l pl.UTF-8
+Moduł jądra Linuksa obsługujący powłokowy system plików.
%prep
%setup -q
-%patch -p1
+%patch0 -p1
+%patch1 -p0
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+
+cat > shfs/Linux-2.6/Makefile <<'EOF'
+obj-m := shfs.o
+shfs-objs := dcache.o dir.o fcache.o file.o inode.o \
+ ioctl.o proc.o shell.o symlink.o
+EOF
%build
%if %{with kernel}
-cd shfs/Linux-2.6
-for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
- if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
- exit 1
- fi
- %{__make} -C %{_kernelsrcdir} clean \
- %{?with_verbose:V=1} \
- RCS_FIND_IGNORE="-name '*.ko' -o" \
- M=$PWD O=$PWD
- rm -rf include
- install -d include/{linux,config}
- ln -sf %{_kernelsrcdir}/config-$cfg .config
- ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
- ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
- touch include/config/MARKER
- echo "obj-m := shfs.o" > Makefile
- echo "shfs-objs := dcache.o dir.o fcache.o file.o inode.o ioctl.o proc.o shell.o symlink.o" >> Makefile
- %{__make} -C %{_kernelsrcdir} modules \
- %{?with_verbose:V=1} \
- RCS_FIND_IGNORE="-name '*.ko' -o" \
- M=$PWD O=$PWD
- mv shfs.ko shfs-$cfg.ko
-done
-cd -
+%build_kernel_modules -C shfs/Linux-2.6 -m shfs
%endif
%if %{with userspace}
%{__make} -C shfsmount \
- CC="%{__cc}" \
- OPT="%{rpmcflags}" \
+ SHFS_VERSION="\"%{version}\"" \
+ CC="%{__cc} %{rpmcflags}" \
+ LINKER="%{__cc}" \
LDFLAGS="%{rpmldflags}"
%{__make} docs
%endif
rm -rf $RPM_BUILD_ROOT
%if %{with kernel}
-cd shfs/Linux-2.6
-install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/fs/shfs
-install shfs-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
- $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/fs/shfs/shfs.ko
-%if %{with smp} && %{with dist_kernel}
-install shfs-smp.ko \
- $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/fs/shfs/shfs.ko
-%endif
-cd -
+%install_kernel_modules -m shfs/Linux-2.6/shfs -d kernel/fs/shfs
%endif
%if %{with userspace}
%clean
rm -rf $RPM_BUILD_ROOT
-%post -n kernel-fs-shfs
+%post -n kernel%{_alt_kernel}-fs-shfs
%depmod %{_kernel_ver}
-%postun -n kernel-fs-shfs
+%postun -n kernel%{_alt_kernel}-fs-shfs
%depmod %{_kernel_ver}
-%post -n kernel-smp-fs-shfs
-%depmod %{_kernel_ver}smp
-
-%postun -n kernel-smp-fs-shfs
-%depmod %{_kernel_ver}smp
-
%if %{with userspace}
%files
%defattr(644,root,root,755)
%doc COPYRIGHT Changelog TODO docs/html
-%attr(755,root,root) %{_bindir}/*
+%attr(4754,root,wheel) %{_bindir}/shfsmount
+%attr(4754,root,wheel) %{_bindir}/shfsumount
%attr(755,root,root) /sbin/*
%{_mandir}/man8/*
%endif
%if %{with kernel}
-%files -n kernel-fs-shfs
+%files -n kernel%{_alt_kernel}-fs-shfs
%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/kernel/fs/shfs
-
-%if %{with smp} && %{with dist_kernel}
-%files -n kernel-smp-fs-shfs
-%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}smp/kernel/fs/shfs
-%endif
+%dir /lib/modules/%{_kernel_ver}/kernel/fs/shfs
+/lib/modules/%{_kernel_ver}/kernel/fs/shfs/shfs.ko*
%endif