+ Check if the compiled module matches the currently running kernel.
[lufs.git] / lufs.spec.in
index 302d04d..d0209f1 100644 (file)
@@ -1,22 +1,16 @@
-# Your kernel version, tries to auto-detect here
-%define kernelversion %(uname -r)
-
 Summary:       lufs - Linux Userland File System
 Name:          @PACKAGE@
-Version:       @VERSION@
-Release:       1
+Version:       @VERSION_BASE@
+Release:       1@VERSION_EXT@
 License:       GPL
 Group:         Base
-Source0:       @PACKAGE@-@VERSION@.tar.gz
-Patch1:                @PACKAGE@-@VERSION@-captive.patch
-
+Source0:       @PACKAGE@-@VERSION_BASE@.tar.gz
+Patch1:                @PACKAGE@-@VERSION_BASE@-@VERSION_EXT@.patch
 BuildRequires: autoconf
-BuildRequires: automake
+BuildRequires: automake >= 1.6
 BuildRequires: libtool
-#BuildRequires:        kernel-source = %{kernelversion}
-
-#Requires:   kernel = %{kernelversion}
-
+BuildRequires: perl
+Requires:      perl
 BuildRoot:     /tmp/buildroot-@PACKAGE@-@VERSION@
 
 %description
@@ -25,11 +19,12 @@ sshfs, ftpfs, localfs, locasefs, gvfs, cardfs, cefs, etc.  Lots of other
 "exotic" filesystems are in the planning phase: socketfs, httpfs, freenetfs
 and others.
 
-
 %prep
 %setup -q
 
 %patch1 -p1
+# Permissions are not restored by patch(1):
+chmod +x kernel/Linux/prepmod.in
 
 %build
 %{__aclocal}
@@ -37,67 +32,73 @@ and others.
 %{__autoheader}
 %{__automake} --add-missing
 %{__autoconf}
+patch configure <<CONFIGURE_SUBST_X_EOF
+--- configure-orig     Wed Aug 20 12:10:37 2003
++++ configure  Wed Aug 20 13:22:51 2003
+@@ -21590,6 +21590,11 @@
+   rm -f \$tmp/stdin
+   if test x"\$ac_file" != x-; then
+     mv \$tmp/out \$ac_file
++    for f in \$ac_file_inputs; do
++      if test -x \$f; then
++        chmod +x \$ac_file
++      fi
++    done
+   else
+     cat \$tmp/out
+     rm -f \$tmp/out
+CONFIGURE_SUBST_X_EOF
 %configure
-#      --with-kernel=%{kernelversion} \
-#      --with-kheaders=/lib/modules/%{kernelversion}/build/include 
 %{__make}
+%{__make} -C kernel/Linux/modbin/ modbin
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
-%{__make} install \
-       DESTDIR=$RPM_BUILD_ROOT
+%{__make} install DESTDIR=$RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-
-ln -s /usr/bin/auto.sshfs /etc/auto.sshfs
-ln -s /usr/bin/auto.ftpfs /etc/auto.ftpfs
-ln -s /usr/bin/lufsd /sbin/mount.lufs
-
-depmod -a
-
-if [ "`lsmod | grep lufs`" ]; then rmmod lufs; fi
-
-modprobe lufs
+depmod -aq
 
 %preun
-
-if [ "`lsmod | grep lufs`" ]; then rmmod lufs; fi
+rmmod 2>/dev/null lufs
+rm -f %{_localstatedir}/lib/lufs/*.o
+rm -f %{_localstatedir}/lib/lufs/*.ko
 
 %postun
+depmod -aq
 
-depmod -a
-
-rm -f /etc/auto.sshfs
-rm -f /etc/auto.ftpfs
-rm -f /sbin/mount.lufs
-
-
+# We need 'devel' files for kernel module compilation of the standard package.
 %files
+%defattr(-,root,root)
+%doc NEWS NEWS.captive README TODO AUTHORS Contributors THANKS
+%{_datadir}/lufs
+%{_includedir}/lufs
 %defattr(644,root,root)
-
-/lib/modules/%{kernelversion}/kernel/fs/lufs/lufs.o
 /etc/lufsd.conf
-
+%{_libdir}/lib*.la
 %defattr(755,root,root)
-
-/usr/bin/lufsd
-/usr/bin/lussh
-/usr/bin/lufsmount
-
-/usr/bin/auto.sshfs
-/usr/bin/auto.ftpfs
-
+%{_bindir}/lufsd
+%{_bindir}/lufsd-bin
+%{_bindir}/lussh
+%{_bindir}/lufsmount
+%{_bindir}/auto.sshfs
+%{_bindir}/auto.ftpfs
+%{_libdir}/lib*.so*
+%{_mandir}/man*/lufs*
+%{_localstatedir}/lib/lufs
+/etc/auto.sshfs
+/etc/auto.ftpfs
+/sbin/mount.lufs
 # These are SUID root...
-
 %defattr(4755,root,root)
-/usr/bin/lufsmnt
-/usr/bin/lufsumount
-
+%{_bindir}/lufsmnt
 
 %changelog
+* Wed Aug 20 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+- rewritten for AutoGen as a support subsystem of Captive project
+
 * Sun Nov 24 2002 Dave Wilson <dave@...>
 - initial version