summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-07 09:31:38 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-07 09:31:38 -0800
commite3be307574f38bf46aee071578edaf0c32d5a71f (patch)
treef1acf632d270b95c5d730c680b8fd19b4ee883ef
parentd96e01ed10509a717f392d704e1e04fc7df040e6 (diff)
downloadfdupes-e3be307574f38bf46aee071578edaf0c32d5a71f.tar.gz
fdupes-e3be307574f38bf46aee071578edaf0c32d5a71f.tar.bz2
fdupes-e3be307574f38bf46aee071578edaf0c32d5a71f.zip
-rw-r--r--packaging/fdupes.diff45
-rw-r--r--packaging/fdupes.spec14
-rw-r--r--packaging/macros.fdupes23
3 files changed, 23 insertions, 59 deletions
diff --git a/packaging/fdupes.diff b/packaging/fdupes.diff
deleted file mode 100644
index 3e8ffdb..0000000
--- a/packaging/fdupes.diff
+++ /dev/null
@@ -1,45 +0,0 @@
---- Makefile
-+++ Makefile
-@@ -2,13 +2,13 @@
- # INSTALLDIR indicates directory where program is to be installed.
- # Suggested values are "/usr/local/bin" or "/usr/bin".
- #
--INSTALLDIR = /usr/local/bin
-+INSTALLDIR = /usr/bin
-
- #
- # MANPAGEDIR indicates directory where the fdupes man page is to be
- # installed. Suggested values are "/usr/local/man" or "/usr/man".
- #
--MANPAGEDIR = /usr/local/man
-+MANPAGEDIR = /usr/share/man
-
- #
- # VERSION determines the program's version number.
-@@ -35,7 +35,7 @@
- #####################################################################
-
- fdupes: fdupes.c md5/md5.c
-- gcc fdupes.c md5/md5.c -Wall -o fdupes -DVERSION=\"$(VERSION)\" $(EXTERNAL_MD5) $(EXPERIMENTAL_RBTREE)
-+ gcc fdupes.c md5/md5.c $(RPM_OPT_FLAGS) -o fdupes -DVERSION=\"$(VERSION)\" $(EXTERNAL_MD5) $(EXPERIMENTAL_RBTREE)
-
- install: fdupes
- cp fdupes $(INSTALLDIR)
---- md5/md5.c
-+++ md5/md5.c
-@@ -39,6 +39,7 @@
- */
-
- #include "md5.h"
-+#include <string.h>
-
- #ifdef TEST
- /*
-@@ -46,7 +47,6 @@
- * The test program should print out the same values as given in section
- * A.5 of RFC 1321, reproduced below.
- */
--#include <string.h>
- main()
- {
- static const char *const test[7] = {
diff --git a/packaging/fdupes.spec b/packaging/fdupes.spec
index abca243..43c981c 100644
--- a/packaging/fdupes.spec
+++ b/packaging/fdupes.spec
@@ -1,14 +1,3 @@
-#
-# spec file for package fdupes (Version 1.40)
-#
-# 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.
-#
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
-#
-
-
Name: fdupes
Version: 1.40
Release: 42.66
@@ -18,8 +7,6 @@ Url: http://premium.caribe.net/~adrian2/fdupes.html
Group: Productivity/Archiving/Compression
Source0: %{name}-%{version}.tar.bz2
Source1: macros.fdupes
-Patch0: %{name}.diff
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
FDUPES is a program for identifying or deleting duplicate files
@@ -27,7 +14,6 @@ residing within specified directories
%prep
%setup -q
-%patch0
%build
make
diff --git a/packaging/macros.fdupes b/packaging/macros.fdupes
new file mode 100644
index 0000000..e99f1f2
--- /dev/null
+++ b/packaging/macros.fdupes
@@ -0,0 +1,23 @@
+
+%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}
+