%define	name	ntfsprogs
%define	ver	2.0.0
%define	rel	2%{?_dist_release}

Summary: NTFS filesystem libraries and utilities
Summary(ja): NTFS ファイルシステム用ライブラリおよびユーティリティ
Name:      %{name}
Version:   %{ver}
Release:   %{rel}
Source:    http://prdownloads.sf.net/linux-ntfs/ntfsprogs-%{ver}.tar.bz2
Patch0:		ntfsprogs-2.0.0-build-extras-by-default.patch
Patch1:		ntfsprogs-2.0.0-mbonly-info.patch
Patch2:		ntfsprogs-2.0.0-check_volume.patch
Patch3:		ntfsprogs-2.0.0-undelete-segfault-fix.patch
Patch4:		ntfsprogs-2.0.0-avoid_crash_on_failed_readall_attr.patch
Patch5:		ntfsprogs-2.0.0-implicit-DSO-libgcrypt.patch

BuildRequires: libuuid-devel
BuildRequires: libgcrypt-devel
Buildroot: %{_tmppath}/%{name}-root
License:   GPL
Group:     System Environment/Base

%description
The Linux-NTFS project (http://www.linux-ntfs.org/) aims to bring full support
for the NTFS filesystem to the Linux operating system.  The ntfsprogs package
currently consists of a static library and utilities such as mkntfs, ntfscat,
ntfsls, ntfsresize, and ntfsundelete (for a full list of included utilities
see man 8 ntfsprogs after installation).

%package gnomevfs
Summary: NTFS GNOME virtual filesystem module
Group: System Environment/Base
Requires: ntfsprogs = %{ver}-%{rel}
Requires: glib2 gnome-vfs2
BuildRequires: glib2-devel gnome-vfs2-devel

%description gnomevfs
This package contains the NTFS GNOME virtual filesystem (VFS) module which
allows GNOME VFS clients to seamlessly utilize the NTFS library (libntfs).

#%package fuse
#Summary: NTFS FUSE module (ntfsmount)
#Group: System Environment/Base
#Requires: ntfsprogs = %{ver}-%{rel}
#Requires: fuse >= 2.3.0
#
#%description fuse
#This package contains the ntfsmount utility which is an NTFS filesystem in
#userspace (FUSE) module allowing users to mount an ntfs filesystem from
#userspace and accessing it using the functionality provided by the NTFS
#library (libntfs).


%package devel
Summary: files required to compile software that uses libntfs
Group: Development/Libraries
Requires: ntfsprogs = %{ver}-%{rel}

%description devel
This package includes the header files and libraries needed to link software
with libntfs.


%prep
%setup
%patch0 -p1
%patch1 -p1
%patch2 -p1 -b .check_volume
%patch3 -p1 -b .undelete-segfault-fix
%patch4 -p1 -b .avoid_crash_on_failed_readall_attr
%patch5 -p1 -b .DSO

%build
autoreconf -if
if [ -n "$LINGUAS" ]; then unset LINGUAS; fi
%configure --enable-gnome-vfs --disable-static
make %{?_smp_mflags}

%install
rm -rf "$RPM_BUILD_ROOT"
make DESTDIR="$RPM_BUILD_ROOT" install-strip

## remove unuse files
rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
rm -rf $RPM_BUILD_ROOT%{_libdir}/gnome-vfs-2.0/modules/*.la


%clean
rm -rf "$RPM_BUILD_ROOT"


%files
%defattr(-,root,root)
%doc AUTHORS COPYING CREDITS ChangeLog INSTALL NEWS README TODO.include TODO.libntfs TODO.ntfsprogs doc/CodingStyle doc/attribute_definitions doc/attributes.txt doc/compression.txt doc/tunable_settings doc/template.c doc/template.h doc/system_files.txt doc/system_security_descriptors.txt
# %{_bindir}/ntfs[^m][^o]*
%{_bindir}/*
%{_sbindir}/*
/sbin/mkfs.ntfs
%{_mandir}/man8/mkntfs.8*
%{_mandir}/man8/mkfs.ntfs.8*
%{_mandir}/man8/ntfs[^m][^o]*.8*
%{_mandir}/man8/libntfs*
%{_libdir}/libntfs.*so*

%files gnomevfs
%defattr(-,root,root)
%{_mandir}/man8/libntfs-gnomevfs.8*
%{_libdir}/gnome-vfs-2.0/modules/libntfs-gnomevfs.*so*
%config %{_sysconfdir}/gnome-vfs-2.0/modules/libntfs.conf

%files devel
%defattr(-,root,root)
%{_includedir}/*
# %{_libdir}/libntfs.*a*
# %{_libdir}/gnome-vfs-2.0/modules/libntfs-gnomevfs.*a*

%changelog
* Sat Dec 04 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0.0-2
- add BuildRequires: libgcrypt-devel

* Wed Nov 10 2010 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 2.0.0-1
- new upstream release
- remove *.a files from -devel pkg
- fix files list

* Sat Sep 20 2008 Shu KONNO <owa@bg.wakwak.com> 1.13.0-1vl5
- applied new versioning policy, spec in utf-8
- removed *.la

* Sat Apr 29 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.13.0-0vl1
- added gnomevfs module
- updated to 1.13.0
  * Fri Oct 7 2005 Anton Altaparmakov <aia21@cantab.net>
  - Fix the file distribution after new binaries have been added as they were
    ending up in the wrong rpms.
  * Mon Aug 15 2005 Szabolcs Szakacsits <szaka@sienet.hu>
  - Add mkfs.ntfs.
  * Wed Mar 10 2004 Anton Altaparmakov <aia21@cantab.net>
  - Cleanup descriptions ready for 1.9.0 release.
  * Mon Jan 19 2004 Anton Altaparmakov <aia21@cantab.net>
  - Add %config to tell rpm that libntfs.conf is a config file.
  * Thu Nov 6 2003 Anton Altaparmakov <aia21@cantab.net>
  - merge libntfs-gnomevfs
  * Fri Oct 19 2003 Richard Russon <ntfs@flatcap.org>
  - added the new utility ntfscat
  * Tue Sep 30 2003 Anton Altaparmakov <aia21@cantab.net>
  - added the new utilities, ntfsclone, ntfscluster, ntfsinfo, ntfsls.

* Thu Jul 17 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 1.7.1-0vl1
- initial build for Vine Linux

* Sat Jan 18 2003 Anton Altaparmakov <aia21@cantab.net>
- renamed to ntfsprogs.spec.in
- change source tar ball name to ntfsprogs

* Tue Dec 10 2002 Anton Altaparmakov <aia21@cantab.net>
- added ntfsresize

* Wed Jul 18 2002 Richard Russon <ntfs@flatcap.org>
- added ntfsundelete
- change TODO names

* Wed Jul 3 2002 Anton Altaparmakov <aia21@cantab.net>
- update my email address

* Mon Jun 3 2002 Anton Altaparmakov <aia21@cam.ac.uk>
- update %doc with new TODO files

* Tue Apr 12 2002 Anton Altaparmakov <aia21@cam.ac.uk>
- update %description text for ntfslabel

* Tue Mar 12 2002 Anton Altaparmakov <aia21@cam.ac.uk>
- update %description text

* Sat Jan 26 2002 Anton Altaparmakov <aia21@cam.ac.uk>
- update %description text
- make dependencies pick the right version automatically

* Thu Jan 10 2002 Anton Altaparmakov <aia21@cam.ac.uk>
- add dependency on linux-ntfs to linux-ntfs-devel
- update %description text

* Fri Nov 09 2001 Anton Altaparmakov <aia21@cam.ac.uk>
- update %description text
- (re)enable installation of shared libraries

* Wed Aug 22 2001 Anton Altaparmakov <aia21@cam.ac.uk>
- update %description text

* Thu Aug 2 2001 Anton Altaparmakov <aia21@cam.ac.uk>
- update %description text

* Wed Jul 25 2001 Anton Altaparmakov <aia21@cam.ac.uk>
- include sbin install path (mkntfs now is in sbin)

* Tue Jul 24 2001 Anton Altaparmakov <aia21@cam.ac.uk>
- update %description text

* Mon Jun 11 2001 Anton Altaparmakov <aia21@cam.ac.uk>
- remove duplicate %configure options
- remove shared library installation as shared libraries are disabled by
default

* Sun Jun 10 2001 Anton Altaparmakov <aia21@cam.ac.uk>
- add man pages stuff
- update info text
- add new doc/ stuff
- modify installation to do install-strip instead of install followed by manual
stripping
- update download URL to be the fast sourceforge http download server

* Fri Feb 2 2001 Anton Altaparmakov <aia21@cam.ac.uk>
- started changelog

