From a85915a780bcf3b97f5d84d235050daec93a392359507e5c4a8a823cf8c0fd59 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 17 May 2007 09:34:40 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fdupes?expand=0&rev=2 --- fdupes.changes | 5 +++++ fdupes.spec | 11 ++++++++--- macros.fdupes | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 macros.fdupes diff --git a/fdupes.changes b/fdupes.changes index f25552c..989946d 100644 --- a/fdupes.changes +++ b/fdupes.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 15 22:53:03 CEST 2007 - coolo@suse.de + +- add an RPM macro to make use of it in spec files + ------------------------------------------------------------------- Thu Nov 16 13:16:07 CET 2006 - dmueller@suse.de diff --git a/fdupes.spec b/fdupes.spec index 970789b..8a1f92e 100644 --- a/fdupes.spec +++ b/fdupes.spec @@ -1,7 +1,7 @@ # # spec file for package fdupes (Version 1.40) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -15,9 +15,10 @@ URL: http://premium.caribe.net/~adrian2/fdupes.html Group: Productivity/Archiving/Compression Summary: Identifying or deleting duplicate files Version: 1.40 -Release: 2 +Release: 19 License: X11/MIT Source0: %name-%{version}.tar.bz2 +Source1: macros.fdupes Patch0: %name.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -41,6 +42,7 @@ make %install install -D -m755 fdupes $RPM_BUILD_ROOT/usr/bin/fdupes install -D -m644 fdupes.1 $RPM_BUILD_ROOT/usr/share/man/man1/fdupes.1 +install -D -m644 %{SOURCE1} $RPM_BUILD_ROOT/etc/rpm/macros.fdupes %clean rm -rf $RPM_BUILD_ROOT @@ -50,7 +52,10 @@ rm -rf $RPM_BUILD_ROOT %doc CHANGES %{_prefix}/bin/fdupes %{_mandir}/*/* +/etc/rpm -%changelog -n fdupes +%changelog +* Tue May 15 2007 - coolo@suse.de +- add an RPM macro to make use of it in spec files * Thu Nov 16 2006 - dmueller@suse.de - Initial package (1.40) diff --git a/macros.fdupes b/macros.fdupes new file mode 100644 index 0000000..0b5a4e7 --- /dev/null +++ b/macros.fdupes @@ -0,0 +1,16 @@ + +%fdupes(s) \ + symlinks=0; \ + %{-s:symlinks=1;} \ + fdupes -q -r -1 %1 | \ + while read target rest; do \ + for f in $rest; do \ + if test "$symlinks" = 1; then \ + ln -sf "${target/$RPM_BUILD_ROOT/}" "$f"; \ + else \ + ln -f "$target" "$f"; \ + fi ;\ + done ;\ +done \ +%{nil} +