Name: libtrash
Version: 2.2
Release: 1%{?_dist_release}
Vendor: Project Vine
Distribution: Vine Linux
Packager: USAMI Kosuke <usami-k@yc5.so-net.ne.jp>
License: GPL
Group: System Environment/Libraries
URL: http://m-arriaga.net/software/libtrash/
Source0: http://m-arriaga.net/software/libtrash/%{name}-%{version}.tgz
Patch0: libtrash-Makefile.patch
Patch1: libtrash-bash_profile.patch
BuildRoot: %{_tmppath}/%{name}-root
Summary: A trash can library to use with LD_PRELOAD

%description
libtrash is a shared library which, when preloaded, implements a trash
can under GNU/Linux. This way, your mistakes (at least those of the
"rm -rf dir /" class :-)) will no longer cause the loss of a week's
work or your system's binaries.

%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
%__make

%install
%__rm -rf %{buildroot}
%__mkdir_p %{buildroot}%{_bindir}
%__mkdir_p %{buildroot}%{_libdir}/%{name}
%__mkdir_p %{buildroot}%{_sysconfdir}
%__mkdir_p %{buildroot}%{_mandir}/man8

%makeinstall DESTDIR=%{buildroot} INSTLIBDIR=%{_libdir}/%{name}

%__install cleanTrash/cleanTrash %{buildroot}%{_bindir}
%__install cleanTrash/ct2.pl %{buildroot}%{_bindir}
%__tar xzf cleanTrash/strash-0.9.tar.gz
%__install strash-0.9/strash %{buildroot}%{_bindir}
%__install -m 644 strash-0.9/strash.8 %{buildroot}%{_mandir}/man8

%clean
%__rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc CHANGE.LOG COPYING README TODO WARNING.GLIBC config.txt
%doc cleanTrash
%doc example.bash_profile
%{_bindir}/*
%{_libdir}/%{name}
%{_sysconfdir}/*
%{_mandir}/man8/*

%changelog
* Fri Oct 03 2008 Shu KONNO <owa@bg.wakwak.com> 2.2-1vl5
- applied new versioning policy

* Thu Feb 12 2004 USAMI Kosuke <usami-k@yc5.so-net.ne.jp> - 2.2-0vl1
- new upstream version
- change install directory (libdir -> libdir/libtrash)
- add ct2.pl and strash

* Sun Sep 28 2003 USAMI Kosuke <usami-k@yc5.so-net.ne.jp> - 2.1-0vl1
- Initial build.