summaryrefslogtreecommitdiff
path: root/packaging/macros.fdupes
blob: e99f1f28aa906bbdcc1b957ba2e32ef1821471b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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}