Summary:        File System in Userspace (FUSE) utilities
Summary(ja):	ユーザスペースファイルシステム(FUSE)用のユーティリティ
Name:           fuse
Version:        2.9.3
Release:        1%{?_dist_release}

Group:          System Environment/Base
License:        GPL
URL:            http://fuse.sf.net

Source0:        http://dl.sourceforge.net/sourceforge/fuse/%{name}-%{version}.tar.gz
Source1:	fuse-udev.nodes
Source2:	fuse-makedev.d-fuse
Patch0:		fuse-udev_rules.patch
Patch1:		fuse-openfix.patch
Patch10:	fuse-2.8.3-chkconfig.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-root
Requires(pre):	shadow-utils
Requires(post): MAKEDEV
Requires(postun): shadow-utils

Vendor: Project Vine
Distribution: Vine Linux
Packager: daisuke, shaolin


%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.

%description -l ja
FUSE を用いることでユーザ空間のプログラムでファイルシステムを実装することが
可能になります。このパッケージには FUSEファイルシステムをマウントするための
ユーザ空間ツールが含まれています。


%package devel
Summary:        File System in Userspace (FUSE) devel files
Group:          Development/Libraries
Requires:	%{name} = %{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.


%prep
%setup -q
#disable device creation during build/install
sed -i 's|mknod|echo Disabled: mknod |g' util/Makefile.in
%patch0 -b .udev-rules
%patch1 -b .openfix
%patch10 -p1 -b .chkconfig

%build
%configure \
 --bindir=/bin \
 --libdir=/%{_lib} \
 --exec-prefix=/ \
 --disable-static \
 --disable-kernel-module 
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'

# FIXME change from 60 to 99
install -D -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/udev/makedev.d/99-fuse.nodes
install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/makedev.d/z-fuse
# change from 4755 to 0755 to allow stripping -- fixed later in files
chmod 0755 $RPM_BUILD_ROOT/bin/fusermount
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mv $RPM_BUILD_ROOT/%{_lib}/pkgconfig $RPM_BUILD_ROOT%{_libdir}

# copmat symlinks
mkdir -p $RPM_BUILD_ROOT%{_bindir}
cd $RPM_BUILD_ROOT%{_bindir}
ln -s /bin/fusermount fusermount
ln -s /bin/ulockmgr_server ulockmgr_server

# drop unneeded initscript
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/fuse

%clean
rm -rf $RPM_BUILD_ROOT


%preun
if [ -f /etc/init.d/fuse ] ; then
    /sbin/service fuse stop >/dev/null 2>&1 ||:
    /sbin/chkconfig --del fuse ||:
fi
	
%post
/sbin/ldconfig

%postun 
/sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING COPYING.LIB FAQ Filesystems NEWS README README.NFS
/sbin/mount.fuse
%attr(4755,root,root) /bin/fusermount
/bin/ulockmgr_server
%{_bindir}/fusermount
%{_bindir}/ulockmgr_server
%{_sysconfdir}/makedev.d/z-fuse
%config %{_sysconfdir}/udev/rules.d/99-fuse.rules
%{_sysconfdir}/udev/makedev.d/99-fuse.nodes
/%{_lib}/libfuse.so.*
/%{_lib}/libulockmgr.so.*
%{_mandir}/man1/fusermount.1.gz
%{_mandir}/man1/ulockmgr_server.1.gz
%{_mandir}/man8/mount.fuse.8.gz

%files devel
%defattr(-,root,root,-)
/%{_lib}/libfuse.so
/%{_lib}/libulockmgr.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/fuse.h
%{_includedir}/ulockmgr.h
%{_includedir}/fuse


%changelog
* Sun Dec 01 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.9.3-1
- new upstream release

* Mon Nov 05 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9.2-1
- new upstream release

* Sat Sep 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.9.1-1
- new upstream release

* Mon Jan 24 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.8.5-1
- new upstream release

* Sat Oct 09 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.8.4-1
- new upstream release
- drop fuse group, change fusermount mode to 4755
- move fusermount/ulockmgr_server to /bin
- move libs to /%%{_lib}
- drop unneeded initscript

* Thu Sep 30 2010 Shu KONNO <owa@bg.wakwak.com> 2.8.3-3
- rebuilt with rpm-4.8.1 for pkg-config

* Sat May 29 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.8.3-2
- fix Patch0 to avoid udev warning (NAME="%k" is superfluous etc.)
- add Patch1 to fix open issue (rhbz #265321)
- add Patch2 for CVE-2009-3297 (rhbz #558833)

* Wed Apr 14 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.8.3-1
- new upstream release
- remove upstreamed patch10
- add patch10 to support chkconfig

* Mon Mar  1 2010 IWAI, Masaharu <iwai@alib.jp> 2.7.4-3
- SECURITY FIX: CVE-2009-3297
  - patch from Debian 5.0 fuse_2.7.4-1.1+lenny1 (Patch10)

* Mon Jun 15 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7.4-2
- update Source2 and Patch0
  - change udev rules to create /dev/fuse with mode 0666, group root.
- do not create fuse group in %%pre
- stop and delete fuse service in %%preun

* Wed Apr 01 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7.4-1
- new upstream release
- spec in utf-8

* Thu Apr 24 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7.3-1
- new upstream release

* Tue May 29 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.5-0vl1
- new upstream release

* Mon Apr 02 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.3-0vl1
- initial build for Vine Linux based on ATrpms package

* Sun Feb  4 2007 Axel Thimm <Axel.Thimm@ATrpms.net> - 2.6.3-0_3
- Update to 2.6.3.

* Thu Feb  1 2007 Axel Thimm <Axel.Thimm@ATrpms.net> - 2.6.2-0_2
- Update to 2.6.2.

* Sun Jan 07 2007 Paulo Roma <roma@lcg.ufrj.br> 2.6.1-1_1
- Adapted for building kernel module.

* Tue Dec 26 2006 Peter Lemenkov <lemenkov@gmail.com> 2.6.1-1
- Ver. 2.6.1

* Sat Nov 25 2006 Peter Lemenkov <lemenkov@gmail.com> 2.6.0-2
- fixed nasty typo (see bug #217075)

* Fri Nov  3 2006 Peter Lemenkov <lemenkov@gmail.com> 2.6.0-1
- Ver. 2.6.0

* Sun Oct 29 2006 Peter Lemenkov <lemenkov@gmail.com> 2.5.3-5
- Fixed udev-rule again

* Sat Oct  7 2006 Peter Lemenkov <lemenkov@gmail.com> 2.5.3-4
- Fixed udev-rule

* Tue Sep 12 2006 Peter Lemenkov <lemenkov@gmail.com> 2.5.3-3%{?dist}
- Rebuild for FC6

* Wed May 03 2006 Peter Lemenkov <lemenkov@newmail.ru> 2.5.3-1%{?dist}
- Update to 2.5.3

* Thu Mar 30 2006 Peter Lemenkov <lemenkov@newmail.ru> 2.5.2-4%{?dist}
- rebuild

* Mon Feb 13 2006 Peter Lemenkov <lemenkov@newmail.ru> - 2.5.2-3
- Proper udev rule

* Mon Feb 13 2006 Peter Lemenkov <lemenkov@newmail.ru> - 2.5.2-2
- Added missing requires

* Tue Feb 07 2006 Peter Lemenkov <lemenkov@newmail.ru> - 2.5.2-1
- Update to 2.5.2
- Dropped fuse-mount.fuse.patch

* Wed Nov 23 2005 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.4.2-1
- Use dist

* Wed Nov 23 2005 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.4.2-1
- Update to 2.4.2 (solves CVE-2005-3531)
- Update README.fedora

* Sat Nov 12 2005 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.4.1-3
- Add README.fedora
- Add hint to README.fedora and that you have to be member of the group "fuse"
  in the description
- Use groupadd instead of fedora-groupadd

* Fri Nov 04 2005 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.4.1-2
- Rename packages a bit
- use makedev.d/40-fuse.nodes
- fix /sbin/mount.fuse
- Use a fuse group to restict access to fuse-filesystems

* Fri Oct 28 2005 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.4.1-1
- Initial RPM release.
