Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 1 | %define kernelversion %(uname -r) |
| 2 | %define fusemoduledir /lib/modules/%{kernelversion}/kernel/fs/fuse |
| 3 | |
Miklos Szeredi | 8483847 | 2003-06-02 06:12:27 +0000 | [diff] [blame] | 4 | %define kernelrel %(uname -r | sed -e s/-/_/g) |
| 5 | %define real_release 6 |
Miklos Szeredi | a9b2f26 | 2003-03-04 09:37:20 +0000 | [diff] [blame] | 6 | |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 7 | Name: fuse |
Miklos Szeredi | c0226bb | 2003-02-19 16:05:06 +0000 | [diff] [blame] | 8 | Version: 1.0 |
Miklos Szeredi | 941ae4c | 2003-03-05 08:29:58 +0000 | [diff] [blame] | 9 | Release: kernel_%{kernelrel}_%{real_release} |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 10 | Summary: Filesystem in Userspace |
| 11 | Source: %{name}-%{version}.tar.gz |
| 12 | Copyright: GPL |
| 13 | Group: Utilities/System |
| 14 | URL: http://sourceforge.net/projects/avf |
| 15 | Buildroot: %{_tmppath}/%{name}-root |
| 16 | Prefix: /usr |
Miklos Szeredi | a9b2f26 | 2003-03-04 09:37:20 +0000 | [diff] [blame] | 17 | Packager: Achim Settelmeier <fuse-rpm@sirlab.de> |
Miklos Szeredi | 941ae4c | 2003-03-05 08:29:58 +0000 | [diff] [blame] | 18 | # some parts of this specfile are taken from Ian Pilcher's specfile |
| 19 | |
| 20 | # don't restrict to RedHat kernels but also allow compilation with |
| 21 | # vanilla kernels, too. |
| 22 | #Requires: kernel = %{kernelrel}, redhat-release >= 7 |
| 23 | #BuildRequires: kernel-source = %{kernelrel} |
| 24 | |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 25 | |
| 26 | %description |
| 27 | FUSE (Filesystem in Userspace) is a simple interface for userspace |
| 28 | programs to export a virtual filesystem to the linux kernel. FUSE |
| 29 | also aims to provide a secure method for non privileged users to |
| 30 | create and mount their own filesystem implementations. |
| 31 | |
| 32 | |
| 33 | %clean |
| 34 | case "$RPM_BUILD_ROOT" in *-root) rm -rf $RPM_BUILD_ROOT ;; esac |
| 35 | |
| 36 | %prep |
| 37 | %setup |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 38 | |
| 39 | %build |
Miklos Szeredi | 21c282b | 2003-05-26 07:12:57 +0000 | [diff] [blame] | 40 | # invoke configure with the --with-kernel option in case we attempt to |
| 41 | # compile for a different kernel and hope the path is right :-) |
| 42 | if [ "%{kernelversion}" != $(uname -r) ]; then |
Miklos Szeredi | 8483847 | 2003-06-02 06:12:27 +0000 | [diff] [blame] | 43 | for dir in /lib/modules/%{kernelversion}/build \ |
| 44 | /usr/src/linux-%{kernelversion} \ |
| 45 | /usr/local/src/linux-%{kernelversion} ; do |
| 46 | if [ -d "$dir" ]; then |
| 47 | WITH_KERNEL="--with-kernel=$dir" |
| 48 | break |
| 49 | fi |
| 50 | done |
Miklos Szeredi | 21c282b | 2003-05-26 07:12:57 +0000 | [diff] [blame] | 51 | fi |
| 52 | |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 53 | ./configure \ |
Miklos Szeredi | 21c282b | 2003-05-26 07:12:57 +0000 | [diff] [blame] | 54 | --prefix=%{prefix} \ |
| 55 | $WITH_KERNEL |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 56 | make |
Miklos Szeredi | a9b2f26 | 2003-03-04 09:37:20 +0000 | [diff] [blame] | 57 | make check |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 58 | |
Miklos Szeredi | 941ae4c | 2003-03-05 08:29:58 +0000 | [diff] [blame] | 59 | ## Now build the library as a shared object |
| 60 | #cd lib |
| 61 | #gcc -fPIC -DHAVE_CONFIG_H -I../include -Wall -W -g -O2 -c *.c |
| 62 | #gcc -shared -Wl,-soname,libfuse.so.%{major_ver} -o libfuse.so.%{version} *.o |
| 63 | #cd .. |
| 64 | |
| 65 | |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 66 | %install |
| 67 | case "$RPM_BUILD_ROOT" in *-root) rm -rf $RPM_BUILD_ROOT ;; esac |
| 68 | make install \ |
| 69 | prefix=$RPM_BUILD_ROOT%{prefix} \ |
| 70 | fusemoduledir=$RPM_BUILD_ROOT%{fusemoduledir} |
| 71 | |
Miklos Szeredi | a9b2f26 | 2003-03-04 09:37:20 +0000 | [diff] [blame] | 72 | install -d $RPM_BUILD_ROOT%{prefix}/lib/fuse/example |
| 73 | install -s -m 755 example/{fusexmp,hello,null} $RPM_BUILD_ROOT%{prefix}/lib/fuse/example/ |
| 74 | |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 75 | # remove binaries form example folder so we can include it |
| 76 | # as a form of documentation into the package |
| 77 | make -C example clean |
Miklos Szeredi | a9b2f26 | 2003-03-04 09:37:20 +0000 | [diff] [blame] | 78 | rm -rf example/.deps/ |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 79 | |
| 80 | %post |
Miklos Szeredi | 941ae4c | 2003-03-05 08:29:58 +0000 | [diff] [blame] | 81 | /sbin/depmod -aq |
| 82 | |
| 83 | %preun |
| 84 | /sbin/modprobe -r fuse |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 85 | |
| 86 | %postun |
Miklos Szeredi | 941ae4c | 2003-03-05 08:29:58 +0000 | [diff] [blame] | 87 | /sbin/depmod -aq |
| 88 | |
| 89 | |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 90 | |
| 91 | %files |
| 92 | %defattr(-,root,root) |
Miklos Szeredi | a9b2f26 | 2003-03-04 09:37:20 +0000 | [diff] [blame] | 93 | %doc README TODO NEWS INSTALL ChangeLog AUTHORS COPYING COPYING.LIB |
Miklos Szeredi | 941ae4c | 2003-03-05 08:29:58 +0000 | [diff] [blame] | 94 | %doc example/ |
| 95 | %doc patch/ |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 96 | |
| 97 | %{fusemoduledir} |
| 98 | %{prefix}/lib/libfuse.a |
| 99 | %{prefix}/include/fuse.h |
Miklos Szeredi | a9b2f26 | 2003-03-04 09:37:20 +0000 | [diff] [blame] | 100 | %{prefix}/lib/fuse/ |
Miklos Szeredi | f782fc4 | 2002-01-14 08:48:46 +0000 | [diff] [blame] | 101 | |
| 102 | # you want to install fusermount SUID root? |
| 103 | # Then uncomment the "%attr()"-line in favour of the line after it. |
| 104 | #%attr(4500,root,root) %{prefix}/bin/fusermount |
| 105 | %{prefix}/bin/fusermount |
Miklos Szeredi | a9b2f26 | 2003-03-04 09:37:20 +0000 | [diff] [blame] | 106 | |
Miklos Szeredi | 941ae4c | 2003-03-05 08:29:58 +0000 | [diff] [blame] | 107 | |
| 108 | |
| 109 | %changelog |
| 110 | |
Miklos Szeredi | 21c282b | 2003-05-26 07:12:57 +0000 | [diff] [blame] | 111 | * Sun May 25 2003 Achim Settelmeier <fuse-rpm@sirlab.de> |
| 112 | - don't add --with-kernel in case we compile for the standard kernel |
| 113 | |
Miklos Szeredi | 941ae4c | 2003-03-05 08:29:58 +0000 | [diff] [blame] | 114 | * Tue Mar 04 2003 Achim Settelmeier <fuse-rpm@sirlab.de> |
| 115 | - "Merged" the specfile by Ian Pilcher (Ian Pilcher <pilchman@attbi.com>) |
| 116 | and this specfile into one. Both are provided by fuse-1.0.tar.gz. |
| 117 | |
| 118 | * Mon Mar 03 2003 Achim Settelmeier <fuse-rpm@sirlab.de> |
| 119 | - Updated specfile for RedHat 8.0 systems |
| 120 | |