# Supported rpmbuild --define and --with options include: # # --without userland # Build without the userland packages # (i.e. only build the kernel-module packages). # # --with modules # Force the building of a kernel-module package, # even if the kernel has support built in. # # --without modules # Disable the building of a kernel-module package. # # --define "ksrc " # Build with kernel header files found in . # By default, the build script will try to find the kernel headers # matching the specified kernel or, if no kernel was specified, the # current kernel. # # --define "kernel " # Specify kernel version to build the module for. # By default, the version is derived from the kernel source files, or # failing that, from "uname -r". %{!?ksrc: %{expand: %%define ksrc %(cd /lib/modules/`uname -r`/build && /bin/pwd)}} %{!?kernel: %{expand: %%define kernel %(cat %{ksrc}/include/config/kernel.release)}} %define fusemodule /lib/modules/%{kernel}/kernel/fs/fuse/fuse.ko %{?_with_modules: %{?_without_modules: %{error: both _with_modules and _without_modules defined}}} %if 0%{?_with_modules:1} %define buildmodule 1 %else %if 0%{?_without_modules:1} %define buildmodule 0 %else %{expand: %%define buildmodule %({ test -f %{fusemodule} && ! fgrep -q "fuse distribution version: " %{fusemodule}; }; echo $?)} %endif %endif %if %{buildmodule} %{!?ksrc: %{expand: %%define ksrc %(cd /lib/modules/%{kernel}/build && /bin/pwd)}} %{!?_with_modules: %{?ksrc: %{expand: %%define buildmodule %(egrep -q "^#define CONFIG_FUSE_FS(_MODULE)? 1" %{ksrc}/include/linux/autoconf.h; echo $?)}}} %endif Name: fuse Version: 2.7.2glfs8 Release: 1 Epoch: 2 Summary: File System in Userspace (FUSE) utilities Group: System Environment/Base License: GPL URL: http://fuse.sourceforge.net/ Packager: Harshavardhana Source: http://dl.sf.net/fuse/%{name}-%{version}.tar.gz Patch0: fuse-udev_rules.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: kernel >= 2.6 Requires(post): /sbin/MAKEDEV %if %{buildmodule} Requires: kernel-module-%{name} >= %{epoch}:%{version}-%{release} %endif %description With FUSE it is possible to implement a fully functional filesystem in a userspace program. This package contains the FUSE userspace tools to mount a FUSE filesystem. %package libs Summary: File System in Userspace (FUSE) libraries Group: System Environment/Libraries License: LGPL %description libs With FUSE it is possible to implement a fully functional filesystem in a userspace program. This package contains the FUSE libraries. %package devel Summary: File System in Userspace (FUSE) devel files Group: Development/Libraries Requires: %{name}-libs = %{epoch}:%{version}-%{release} Requires: pkgconfig License: LGPL %description devel With FUSE it is possible to implement a fully functional filesystem in a userspace program. This package contains development files (headers, pgk-config) to develop FUSE based applications/filesystems. %package -n kernel-module-%{name}-%{kernel} Summary: File System in Userspace (FUSE) kernel module Group: System Environment/Kernel License: GPL Provides: kernel-module-%{name} = %{epoch}:%{version}-%{release} Requires: /sbin/depmod %if %{buildmodule} && 0%{!?ksrc:1} BuildRequires: kernel-devel = %{kernel} %endif %description -n kernel-module-%{name}-%{kernel} With FUSE it is possible to implement a fully functional filesystem in a userspace program. This package contains the FUSE kernel module for kernel %{kernel} and architecture %{_target_cpu}. %prep %setup -q #disable device creation during build/install sed -i.mknod 's|\|echo Disabled: mknod |g' util/Makefile.in #disable depmod during kernel-module build/install sed -i.depmod 's|\(/[a-z/]*/\)\?\|echo Disabled: \0 |g' kernel/Makefile.in %patch0 -b .patch0 %build %configure \ %if 0%{?_without_userland:1} --disable-lib --disable-util --disable-example \ %endif --disable-static \ %if %{buildmodule} --enable-kernel-module %{?ksrc:--with-kernel=%{ksrc}} %else --disable-kernel-module %endif make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT %if 0%{!?_without_userland:1} find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' # change from 4755 to 0755 to allow stripping -- fixed later in files chmod 0755 $RPM_BUILD_ROOT/%{_bindir}/fusermount %else # without userland # Without removing these directories rpmbuild will stop and complain about unpackaged files. rm -rf "$RPM_BUILD_ROOT/%{_includedir}" "$RPM_BUILD_ROOT/%{_libdir}" %endif # userland %clean rm -rf $RPM_BUILD_ROOT %post /sbin/MAKEDEV fuse /sbin/ldconfig -n %{_libdir} %postun /sbin/ldconfig %post -n kernel-module-%{name}-%{kernel} if [ -f /boot/System.map-%{kernel} ]; then /sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} || : else /sbin/depmod -a || : fi %postun -n kernel-module-%{name}-%{kernel} if [ -f /boot/System.map-%{kernel} ]; then /sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} || : else /sbin/depmod -a || : fi %if 0%{!?_without_userland:1} %files %doc AUTHORS ChangeLog COPYING FAQ Filesystems NEWS README README.NFS /sbin/mount.fuse %defattr(-,root,root) %{_bindir}/fusermount %{_bindir}/ulockmgr_server %{_sysconfdir}/udev/rules.d/99-fuse.rules %{_sysconfdir}/init.d/fuse %files libs %doc COPYING.LIB %{_libdir}/libfuse.so.* %{_libdir}/libulockmgr.so* %files devel %defattr(-,root,root,-) %{_libdir}/libfuse.so %{_libdir}/libulockmgr.so %{_libdir}/pkgconfig/*.pc %{_includedir}/fuse.h %{_includedir}/ulockmgr.h %{_includedir}/fuse %endif # userland %if %{buildmodule} %files -n kernel-module-%{name}-%{kernel} %defattr(0644,root,root,0755) %dir /lib/modules/%{kernel}/kernel/fs/fuse %{fusemodule} %endif # kernel module %changelog * Sun Mar 16 2008 Harshavardhana - 2.7.2glfs8 - Initial Commit