packages: rpm-build-macros/rpm.macros - compress docs: if man link is in ot...

glen glen at pld-linux.org
Sat Jul 30 15:22:40 CEST 2011


Author: glen                         Date: Sat Jul 30 13:22:40 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- 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.

---- Files affected:
packages/rpm-build-macros:
   rpm.macros (1.613 -> 1.614) 

---- Diffs:

================================================================
Index: packages/rpm-build-macros/rpm.macros
diff -u packages/rpm-build-macros/rpm.macros:1.613 packages/rpm-build-macros/rpm.macros:1.614
--- packages/rpm-build-macros/rpm.macros:1.613	Fri Jul 15 20:07:34 2011
+++ packages/rpm-build-macros/rpm.macros	Sat Jul 30 15:22:34 2011
@@ -503,16 +503,19 @@
 #%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; \
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpm-build-macros/rpm.macros?r1=1.613&r2=1.614&f=u



More information about the pld-cvs-commit mailing list