- png-fix-too-far-back was actually renamed to pngfix. Adjusted rpm

macro names accordingly, %png_fix and %png_fix_dir.

OBS-URL: https://build.opensuse.org/package/show/graphics/libpng16?expand=0&rev=33
This commit is contained in:
Petr Gajdos 2013-08-08 15:21:08 +00:00 committed by Git OBS Bridge
parent 5b397eb2af
commit f73866b052
2 changed files with 23 additions and 24 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Aug 8 15:19:27 UTC 2013 - pgajdos@suse.com
- png-fix-too-far-back was actually renamed to pngfix. Adjusted rpm
macro names accordingly, %png_fix and %png_fix_dir.
-------------------------------------------------------------------
Tue Aug 6 08:53:22 UTC 2013 - pgajdos@suse.com

View File

@ -1,41 +1,34 @@
# macro: %png_fix_too_far_back path/to/name-of.png
# for given png, fixes 'IDAT: invalid distance too far back'
# macro: %png_fix path/to/name-of.png
# for given png, fixes 'IDAT: invalid distance too far back', etc.,
# see pngfix --help
#
# -v output if macro fixed something or find unrecoverable error
# -q do not output if macro fixed something or find unrecoverable error
#
%png_fix_too_far_back(v) \
# this macro fails only if there is an unrecoverable error in the png
# -- pngfix returns nonzero and $png.fixed doesn't exist; run pngfix
# on that file, see return code and compare with pngfix --help output
%png_fix(q) \
if test "x%1" == "x%%1"; then \
echo "Missing argument in call to %%png_fix_too_far_back: path and name of png file." \
echo "Missing argument in call to %%png_fix: path and name of png file." \
exit 1 \
fi \
/usr/bin/png-fix-too-far-back "%1" \
case $? in \
0) # no need to fix \
;; \
1) /usr/bin/png-fix-too-far-back -i "%1" \
%{-v: echo "fixed: %1" } \
;; \
2) %{-v: echo "unrecoverable error: %1" } \
;; \
3) echo "%1 not found" \
;; \
esac \
/usr/bin/pngfix %{-q: -qq} --suffix='.fixed' "%1" || mv "%1.fixed" "%1" \
%nil
#
# macro: %png_fix_too_far_back dir
# macro: %png_fix_dir
# for given directory, search *.png (recursively) and potentionaly
# fix 'IDAT: invalid distance too far back'
# fix 'IDAT: invalid distance too far back', etc., see pngfix --help
#
# -v output if macro fixed something or find unrecoverable error
# -q do not output if pngfix fixed something or find unrecoverable error
#
%png_fix_too_far_back_dir(v) \
%png_fix_dir(q) \
if test "x%1" == "x%%1"; then \
echo "Missing argument in call to %%png_fix_too_far_back_dir: dir where to search png files." \
echo "Missing argument in call to %%png_fix_dir: dir where to search png files." \
exit 1 \
fi \
for png in `find "%1" -iname '*.png'`; do \
# -v will be propagated \
%png_fix_too_far_back $png \
# -q will be propagated \
%png_fix $png \
done \
%nil