]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- compress docs: if man link is in other section than current, we need to preserve...
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 30 Jul 2011 13:22:34 +0000 (13:22 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
# 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

index f8dd3b500b2cc98fe79277dfb9262153423b56d9..2312b8baf4efc522afcfc83e2e862168c0eb2acf 100644 (file)
@@ -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; \
This page took 0.049909 seconds and 4 git commands to generate.