--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic git-r3 toolchain-funcs
+
+MY_P="${PN}-${PV/_pre/-PR}"
+
+DESCRIPTION="Identify/delete duplicate files residing within specified directories"
+HOMEPAGE="https://github.com/adrianlopezroche/fdupes https://code.google.com/p/fdupes/"
+SRC_URI=""
+EGIT_REPO_URI="https://github.com/adrianlopezroche/fdupes.git"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-makefile.patch
+
+ append-lfs-flags
+ tc-export CC
+}
+
+src_install() {
+ dobin fdupes
+ doman fdupes.1
+ dodoc CHANGES CONTRIBUTORS README TODO
+}
+++ /dev/null
-diff -urNp fdupes-1.50-PR2.orig/fdupes.c fdupes-1.50-PR2/fdupes.c
---- fdupes-1.50-PR2.orig/fdupes.c 2009-01-31 20:11:49.577968848 +0530
-+++ fdupes-1.50-PR2/fdupes.c 2009-01-31 20:29:17.103220311 +0530
-@@ -643,7 +643,7 @@ void printmatches(file_t *files)
- while (files != NULL) {
- if (files->hasdupes) {
- if (!ISFLAG(flags, F_OMITFIRST)) {
-- if (ISFLAG(flags, F_SHOWSIZE)) printf("%ld byte%seach:\n", files->size,
-+ if (ISFLAG(flags, F_SHOWSIZE)) printf("%lld byte%seach:\n", files->size,
- (files->size != 1) ? "s " : " ");
- if (ISFLAG(flags, F_DSAMELINE)) escapefilename("\\ ", &files->d_name);
- printf("%s%c", files->d_name, ISFLAG(flags, F_DSAMELINE)?' ':'\n');
-@@ -796,7 +796,7 @@ void deletefiles(file_t *files, int prom
- do {
- printf("Set %d of %d, preserve files [1 - %d, all]",
- curgroup, groups, counter);
-- if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%ld byte%seach)", files->size,
-+ if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%lld byte%seach)", files->size,
- (files->size != 1) ? "s " : " ");
- printf(": ");
- fflush(stdout);
+++ /dev/null
---- fdupes-1.50-PR2/Makefile.orig 2010-11-19 19:05:18.152330536 -0800
-+++ fdupes-1.50-PR2/Makefile 2010-11-19 19:06:00.998659992 -0800
-@@ -72,9 +72,9 @@
- # Make Configuration
- #
- CC = gcc
--COMPILER_OPTIONS = -Wall -O -g
-+COMPILER_OPTIONS = -Wall
-
--CFLAGS= $(COMPILER_OPTIONS) -I. -DVERSION=\"$(VERSION)\" $(EXTERNAL_MD5) $(EXPERIMENTAL_RBTREE) $(OMIT_GETOPT_LONG)
-+CFLAGS += $(COMPILER_OPTIONS) -I. -DVERSION=\"$(VERSION)\" $(EXTERNAL_MD5) $(EXPERIMENTAL_RBTREE) $(OMIT_GETOPT_LONG)
-
- INSTALL_PROGRAM = $(INSTALL) -c -m 0755
- INSTALL_DATA = $(INSTALL) -c -m 0644
-@@ -94,7 +94,7 @@
- all: fdupes
-
- fdupes: $(OBJECT_FILES)
-- $(CC) $(CFLAGS) -o fdupes $(OBJECT_FILES)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -o fdupes $(OBJECT_FILES)
-
- installdirs:
- test -d $(BIN_DIR) || -$(MKDIR) $(BIN_DIR)
--- /dev/null
+ Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 921d910..67576f9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -78,9 +78,9 @@ MKDIR = mkdir -p
+ # Make Configuration
+ #
+ CC ?= gcc
+-COMPILER_OPTIONS = -Wall -O -g
++CFLAGS ?= -Wall -O -g
+
+-CFLAGS= $(COMPILER_OPTIONS) -I. -DVERSION=\"$(VERSION)\" $(EXTERNAL_MD5) $(OMIT_GETOPT_LONG) $(FILEOFFSET_64BIT)
++CFLAGS += -I. -DVERSION=\"$(VERSION)\" $(EXTERNAL_MD5) $(OMIT_GETOPT_LONG) $(FILEOFFSET_64BIT)
+
+ INSTALL_PROGRAM = $(INSTALL) -c -m 0755
+ INSTALL_DATA = $(INSTALL) -c -m 0644
+@@ -100,7 +100,7 @@ OBJECT_FILES = fdupes.o md5/md5.o $(ADDITIONAL_OBJECTS)
+ all: fdupes
+
+ fdupes: $(OBJECT_FILES)
+- $(CC) $(CFLAGS) -o fdupes $(OBJECT_FILES)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o fdupes $(OBJECT_FILES)
+
+ installdirs:
+ test -d $(DESTDIR)$(BIN_DIR) || $(MKDIR) $(DESTDIR)$(BIN_DIR)