From 9774b98f69836dde7927e407c9ef927369b0999e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 30 Jul 2011 13:22:34 +0000 Subject: [PATCH 1/1] - compress docs: if man link is in other section than current, we need to preserve subdirs in .so link: # man drm-device-added fopen: No such file or directory Cannot open man page /usr/share/man/man7/upstart-udev-bridge.8.gz No manual entry for drm-device-added # cat /usr/share/man/man7/drm-device-added.7 .so upstart-udev-bridge.8 this fix works with relative links in same dir and symlinks with full path, relative symlinks likely break. Changed files: rpm.macros -> 1.614 --- rpm.macros | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rpm.macros b/rpm.macros index f8dd3b5..2312b8b 100644 --- a/rpm.macros +++ b/rpm.macros @@ -503,16 +503,19 @@ CXXFLAGS="%{rpmcxxflags}" \ #%no_install_post_compress_docs 1 %__spec_install_post_compress_docs { \ %{!?no_install_post_compress_docs:__spec_install_post_compress_docs() { \ + %{!?debug:set +x}; \ for i in /usr/share/man /usr/X11R6/man; do \ if [ -d "$RPM_BUILD_ROOT$i" ]; then \ echo "Compress man pages: $i"; \ find "$RPM_BUILD_ROOT$i" -name '*.bz2' -print | xargs -r %{__bzip2} -df; \ find "$RPM_BUILD_ROOT$i" -name '*.gz' -print | xargs -r %{__gzip} -dnf; \ find $RPM_BUILD_ROOT$i -type l | while read a; do \ - m=$(readlink $a); \ + m=$(readlink "$a"); \ rm -f $a; \ - echo .so ${m##*/} > $a; \ - echo >&2 "Converted ${a#$RPM_BUILD_ROOT} from symlink to man link: ${m##*/}"; \ + l=${m#/usr/share/man/}; \ + l=${l#/usr/X11R6/man/}; \ + echo ".so $l" > $a; \ + echo >&2 "Converted ${a#$RPM_BUILD_ROOT} from symlink to man link: $l"; \ done; \ find "$RPM_BUILD_ROOT$i" -type f -size +%{_min_compress_bytes}c -print | xargs -r %{__gzip} -9nf; \ fi; \ -- 2.44.0