From: TizenOpenSource Date: Tue, 27 Dec 2022 07:42:09 +0000 (+0900) Subject: Bump to 2.2.1 X-Git-Tag: accepted/tizen/8.0/base/20231005.044701^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb09b8f6c0cf808fa9b84a88ecfaffdfb9b5a262;p=platform%2Fupstream%2Ffdupes.git Bump to 2.2.1 Signed-off-by: TizenOpenSource --- diff --git a/packaging/fdupes.manifest b/packaging/fdupes.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/fdupes.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/fdupes.spec b/packaging/fdupes.spec new file mode 100644 index 0000000..6742dad --- /dev/null +++ b/packaging/fdupes.spec @@ -0,0 +1,35 @@ +Name: fdupes +Version: 2.2.1 +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 +%{reconfigure} --without-ncurses +%{__make} %{?_smp_mflags} CFLAGS=" -fPIC -pie %{optflags}" + +%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 index 0000000..9ec8e78 --- /dev/null +++ b/packaging/macros.fdupes @@ -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} +