Requires: readline
%endif
BuildRequires: gcc >= 3.0
+Obsoletes: gnome-vfs-httpcaptive
%if %{static}
BuildRequires: fuse-devel
BuildRequires: ntfsprogs-devel >= 1.8.0
Obsoletes: @PACKAGE@
Obsoletes: @PACKAGE@-lufs
Obsoletes: @PACKAGE@-install
-Obsoletes: gnome-vfs-httpcaptive
# FIXME: ?: ntfsprogs-gnomevfs < 1.1
%else
Conflicts: @PACKAGE@-static
%clean
rm -rf $RPM_BUILD_ROOT
+%pre
+
+%if ! %{static}
+%pre fuse
+%endif
+%if %{static}
+/usr/sbin/groupadd -r fuse 2>/dev/null || \
+ /usr/sbin/groupadd fuse 2>/dev/null || \
+ true
+%endif
+
%post
/sbin/ldconfig
/usr/sbin/groupadd -r captive 2>/dev/null || \
/usr/sbin/groupadd captive 2>/dev/null || \
- true
+ true
/usr/sbin/useradd -r -c "Captive Sandbox" -s /sbin/nologin -g captive -d %{_var}/lib/@PACKAGE@ captive 2>/dev/null || \
/usr/sbin/useradd -c "Captive Sandbox" -s /sbin/nologin -g captive -d %{_var}/lib/@PACKAGE@ captive 2>/dev/null || \
true
%preun
%if ! %{static}
+%preun fuse
+%endif
+# Only on real erase, not on upgrade:
+if [ $1 = 0 ];then
+ /usr/lib/lsb/remove_initd @PACKAGE@ 2>/dev/null || \
+ /sbin/chkconfig --del @PACKAGE@
+ %{_initrddir}/@PACKAGE@ stop
+ rm -f %{_var}/lock/subsys/@PACKAGE@
+fi
+
+%if ! %{static}
%preun install
%endif
-%{_sbindir}/captive-install-fstab --remove
+# Only on real erase, not on upgrade:
+if [ $1 = 0 ];then
+ %{_sbindir}/captive-install-fstab --remove
+fi
%postun
/sbin/ldconfig
-# Remove stale sandbox chroot directories owned by 'captive.captive':
-rm -rf %{_var}/lib/@PACKAGE@/s-*
-rm -rf %{_var}/lib/@PACKAGE@/tmp/*
-
-%if ! %{static}
-%postun fuse
-%endif
-/usr/lib/lsb/remove_initd @PACKAGE@ 2>/dev/null || \
- /sbin/chkconfig --del @PACKAGE@
-%{_initrddir}/@PACKAGE@ stop
-rm -f %{_var}/lock/subsys/@PACKAGE@
+# Only on real erase, not on upgrade:
+if [ $1 = 0 ];then
+ # Remove stale sandbox chroot directories owned by 'captive.captive':
+ rm -rf %{_var}/lib/@PACKAGE@/s-*
+ rm -rf %{_var}/lib/@PACKAGE@/tmp/*
+fi
%files
%defattr(-,root,root)
/sbin/mount.@PACKAGE@
/sbin/mount.@PACKAGE@-*
%attr(644,root,root) %{_mandir}/man?/mount.@PACKAGE@.*
+%if %{static}
+%attr(4754,root,fuse) %{_libexecdir}/@PACKAGE@-fusermount
+%endif
%if ! %{static}
%files install