Bump to fdupes 2.1.2 47/265747/1 sandbox/dh0128.kwak/fdupes-2.1.2-20211025 accepted/tizen/base/tool/20211115.010748 submit/tizen_base/20211111.052732
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 28 Oct 2021 03:58:30 +0000 (12:58 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 28 Oct 2021 03:59:44 +0000 (12:59 +0900)
Change-Id: I5836426a47f9403f948fabd400d09a0c31fddd80
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
packaging/fdupes.manifest [new file with mode: 0644]
packaging/fdupes.spec [new file with mode: 0644]
packaging/macros.fdupes [new file with mode: 0644]

diff --git a/packaging/fdupes.manifest b/packaging/fdupes.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/fdupes.spec b/packaging/fdupes.spec
new file mode 100644 (file)
index 0000000..f27fd57
--- /dev/null
@@ -0,0 +1,37 @@
+Name:           fdupes
+Version:        2.1.2
+Release:        0
+License:        MIT
+Summary:        Identifying or deleting duplicate files
+Url:            http://premium.caribe.net/~adrian2/fdupes.html
+Group:          Base/Compression
+Source0:        %{name}-%{version}.tar.bz2
+Source1:        macros.fdupes
+Source1001:     fdupes.manifest
+
+%description
+FDUPES is a program for identifying or deleting duplicate files
+residing within specified directories
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+export CFLAGS+=" -fPIC"
+export LDFLAGS+=" -pie"
+%{reconfigure} --without-ncurses
+%{make_build}
+
+%install
+install -D -m755 fdupes %{buildroot}%{_bindir}/fdupes
+install -D -m644 fdupes.1 %{buildroot}%{_mandir}/man1/fdupes.1
+install -D -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.fdupes
+
+%{remove_docs}
+
+%files
+%manifest %{name}.manifest
+%license README
+%{_bindir}/fdupes
+%config %{_sysconfdir}/rpm
diff --git a/packaging/macros.fdupes b/packaging/macros.fdupes
new file mode 100644 (file)
index 0000000..9ec8e78
--- /dev/null
@@ -0,0 +1,27 @@
+
+%fdupes(s) \
+ _target=""; \
+ _symlinks=0; \
+ _files=(); \
+ %{-s:_symlinks=1;} \
+ fdupes -q -n -r %1 | \
+  while read _file; do \
+   if test -z $_file; then \
+    _sorted_files=($(for i in ${_files[*]}; do echo $i; done | sort)); \
+    _target=${_sorted_files[0]}; \
+    for i in $(seq 1 $((${#_sorted_files[@]}-1))); do \
+     symlink_file=${_sorted_files[$i]}; \
+     rm $symlink_file;\
+     if test "$_symlinks" = 1; then \
+      ln -sf "${_target#%{buildroot}}" "$symlink_file"; \
+     else \
+      ln -f "$_target" "$symlink_file"; \
+     fi ;\
+    done; \
+    _files=(); \
+   else \
+    _files+=($_file); \
+   fi; \
+ done \
+%{nil}
+