%define name    @PACKAGE@
%define ver     @VERSION@
%define rel     1
%define ver_e2fsprogs 1.35
%define ver_progsreiserfs 0.3.1-rc8
%define ver_ntfsprogs 1.9.4

Summary:	Tool to check and undelete partition.
Summary(pl):	Narz�dzie sprawdzaj�ce i odzyskuj�ce partycje.
Summary(fr):	Outil pour v�rifier et restorer des partitions.
Name:		%{name}
Version:	%{ver}
Release:	%{rel}
License:	GPL
Group:		System/Kernel and hardware
Source0:	http://www.cgsecurity.org/%{name}-%{version}.tar.gz
Source1:	progsreiserfs-%ver_progsreiserfs.tar.gz
Source2:	ntfsprogs-%ver_ntfsprogs.tar.gz
#Source3:	e2fsprogs-%ver_e2fsprogs.tar.gz
Patch0:		progsreiserfs-journal.patch
URL:		http://www.cgsecurity.org/testdisk.html
Packager:	Christophe GRENIER <grenier@cgsecurity.org>
BuildRequires:	ncurses-devel >= 5.2
BuildRequires:  e2fsprogs-devel
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot


%description
Tool to check and undelete partition. Works with the following
partitions:
- FAT12 FAT16 FAT32
- Linux
- Linux SWAP (version 1 and 2)
- NTFS (Windows NT/W2K/XP)
- BeFS (BeOS)
- UFS (BSD)
- Netware
- ReiserFS

%description -l pl
Narz�dzie sprawdzaj�ce i odzyskujace partycje. Pracuje z partycjami:
- FAT12 FAT16 FAT32
- Linux
- Linux SWAP (version 1 and 2)
- NTFS (Windows NT/W2K/XP)
- BeFS (BeOS)
- UFS (BSD)
- Netware
- ReiserFS

%description -l fr
Outil pour v�rifier et restorer des partitions. Fonctionne avec les 
partitions suivantes :
- FAT12 FAT16 FAT32
- Linux
- Linux SWAP (version 1 et 2)
- NTFS (Windows NT/W2K/XP)
- BeFS (BeOS)
- UFS (BSD)
- Netware
- ReiserFS

%prep
%setup
%setup -a 1 -D
%setup -a 2 -D
#%setup -a 3 -D
%patch0

%build
(
cd progsreiserfs-%ver_progsreiserfs
%configure
make
)
(
cd ntfsprogs-%ver_ntfsprogs
%configure
make libs
)
#(
#cd e2fsprogs-%ver_e2fsprogs
#%configure
#make libs
#)
%configure --with-reiserfs-lib=${RPM_BUILD_DIR}/%{name}-%{version}/progsreiserfs-%ver_progsreiserfs/libreiserfs/.libs/ --with-reiserfs-includes=${RPM_BUILD_DIR}/%{name}-%{version}/progsreiserfs-%ver_progsreiserfs/include/ --with-dal-lib=${RPM_BUILD_DIR}/%{name}-%{version}/progsreiserfs-%ver_progsreiserfs/libdal/.libs/ --with-ntfs-lib=${RPM_BUILD_DIR}/%{name}-%{version}/ntfsprogs-%ver_ntfsprogs/libntfs/.libs/ --with-ntfs-includes=${RPM_BUILD_DIR}/%{name}-%{version}/ntfsprogs-%ver_ntfsprogs/include/
make
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR="$RPM_BUILD_ROOT" install-strip
#install -d $RPM_BUILD_ROOT%{_sbindir}
#install -d $RPM_BUILD_ROOT%{_mandir}/man1
#install src/testdisk	$RPM_BUILD_ROOT%{_sbindir}/
#install doc_src/testdisk.1  $RPM_BUILD_ROOT%{_mandir}/man1/testdisk.1

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS doc
%doc %{_mandir}/man1/testdisk.1*
%doc %{_mandir}/man1/photorec.1*
%attr(755,root,root) %{_sbindir}/testdisk
%attr(755,root,root) %{_sbindir}/photorec
%changelog
* Sun Jan 4 2004 Christophe Grenier <grenier@cgsecurity.org> 5.0
- 5.0

* Wed Oct 1 2003 Christophe Grenier <grenier@cgsecurity.org> 4.5
- 4.5

* Wed Apr 23 2003 Christophe Grenier <grenier@cgsecurity.org> 4.4-2

* Sat Mar 29 2003 Pascal Terjan <CMoi@tuxfamily.org> 4.4-1mdk
- 4.4

* Fri Dec 27 2002 Olivier Thauvin <thauvin@aerov.jussieu.fr> 4.2-2mdk
- rebuild for rpm and glibc

* Sun Oct 06 2002 Olivier Thauvin <thauvin@aerov.jussieu.fr> 4.2-1mdk
- 4.2

* Mon Sep 02 2002 Olivier Thauvin <thauvin@aerov.jussieu.fr> 4.1-1mdk 
- By Pascal Terjan <pascal.terjan@free.fr>
	- first mdk release, adapted from PLD.
	- gz to bz2 compression.
- fix %%tmppath
- %%make instead %%{__make}
