Add RPM macro.

epel9
Richard M. Shaw 13 years ago
parent 6ad5e37839
commit a8b6c2fefe

@ -1,62 +1,66 @@
Summary: Finds duplicate files in a given set of directories Name: fdupes
Name: fdupes Summary: Finds duplicate files in a given set of directories
Version: 1.50 Version: 1.50
Release: 0.4.PR2%{?dist} Release: 0.5.PR2%{?dist}
License: MIT License: MIT
Group: Applications/File Group: Applications/File
URL: http://netdial.caribe.net/~adrian2/fdupes.html URL: http://netdial.caribe.net/~adrian2/fdupes.html
Source0: http://netdial.caribe.net/~adrian2/programs/fdupes/beta/%{name}-%{version}-PR2.tar.gz Source0: http://netdial.caribe.net/~adrian2/programs/fdupes/beta/%{name}-%{version}-PR2.tar.gz
Source1: macros.fdupes
Patch0: %{name}-%{version}-destdir.patch
Patch0: %{name}-%{version}-destdir.patch
# http://bugs.debian.org/213385 # http://bugs.debian.org/213385
Patch1: %{name}-%{version}-compare-file.patch Patch1: %{name}-%{version}-compare-file.patch
# http://bugs.debian.org/447601 # http://bugs.debian.org/447601
Patch2: %{name}-%{version}-lfs.patch Patch2: %{name}-%{version}-lfs.patch
# http://bugs.debian.org/353789 # http://bugs.debian.org/353789
Patch3: %{name}-%{version}-typo.patch Patch3: %{name}-%{version}-typo.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description %description
FDUPES is a program for identifying duplicate files residing within specified FDUPES is a program for identifying duplicate files residing within specified
directories. directories.
%prep %prep
%setup -q -n %{name}-%{version}-PR2 %setup -q -n %{name}-%{version}-PR2
%patch0 -p1 %patch0 -p1 -b .destdir
%patch1 -p1 %patch1 -p1 -b .cmp
%patch2 -p1 %patch2 -p1 -b .lfs
%patch3 -p1 %patch3 -p1 -b .typo
%build %build
make %{?_smp_mflags} COMPILER_OPTIONS="$RPM_OPT_FLAGS" make %{?_smp_mflags} COMPILER_OPTIONS="%{optflags}"
%check %check
./%{name} testdir ./%{name} testdir
./%{name} --omitfirst testdir ./%{name} --omitfirst testdir
./%{name} --recurse testdir ./%{name} --recurse testdir
./%{name} --size testdir ./%{name} --size testdir
# ... etc..
%install %install
rm -rf $RPM_BUILD_ROOT make install INSTALL="%{__install} -p" \
BIN_DIR=%{_bindir} \
MAN_BASE_DIR=%{_mandir} \
DESTDIR=%{buildroot}
make install INSTALL="%{__install} -p" BIN_DIR=%{_bindir} \ mkdir -p %{buildroot}%{_sysconfdir}/rpm
MAN_BASE_DIR=%{_mandir} DESTDIR=$RPM_BUILD_ROOT install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/
%clean
rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-) %doc CHANGES CONTRIBUTORS README TODO
%doc CHANGES
%doc CONTRIBUTORS
%doc README
%doc TODO
%doc %{_mandir}/man1/%{name}.1* %doc %{_mandir}/man1/%{name}.1*
%{_bindir}/%{name} %{_bindir}/%{name}
%{_sysconfdir}/rpm/macros.fdupes
%changelog %changelog
* Tue May 15 2012 Richard Shaw <hobbes1069@gmail.com> - 1.50-0.5.PR2
- Add RPM macro.
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.50-0.4.PR2 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.50-0.4.PR2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

@ -0,0 +1,21 @@
%fdupes(s) \
_target=""; \
_symlinks=0; \
%{-s:_symlinks=1;} \
fdupes -q -n -r %1 | \
while read _file; do \
if test -z "$_target" ; then \
_target="$_file"; \
else \
if test -z "$_file" ; then \
_target=""; \
continue ; \
fi ; \
if test "$_symlinks" = 1; then \
ln -sf "${_target#%{buildroot}}" "$_file"; \
else \
ln -f "$_target" "$_file"; \
fi ;\
fi ; \
done \
%{nil}
Loading…
Cancel
Save