]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- rewrited %__spec_install_post_compress_docs:
authorkloczek <kloczek@pld-linux.org>
Thu, 14 Sep 2000 00:58:52 +0000 (00:58 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  resignate lookup to %{_mandir} for man pages because we have two root
  directories for man pages: /usr/share/man, and /usr/X11R6/man and some
  packages have man pages in both locations,
- finished implementation %__spec_install_post_strip,
- added handling verbose mode in %__spec_install_post_strip and
  %__spec_install_post_compress_docs (this can be enambled during building
  package in standard way using -v command line switch),
- uncomment %{__spec_install_post_strip},
  %{__spec_install_post_compress_docs} in %__spec_install_post.

Seems all is ready but please carefully verify above.

Changed files:
    rpm.macros -> 1.26

rpm.macros

index eaa33eae16da6181cee7ddc95dca3c5790b2db88..d5d5f33ece22e221f127419ab7cc4524056d70c6 100644 (file)
@@ -107,24 +107,34 @@ done \
 # Requires: xargs, find
 #
 %__spec_install_post_compress_docs { \
-%{verbose:set -x}%{!verbose:exec > /dev/null}; \
-if [ -d "$RPM_BUILD_ROOT%{_mandir}" ]; then \
-       find "$RPM_BUILD_ROOT%{_mandir}" -type f -print | xargs %{__gzip} -9nf; \
-fi; \
-if [ -d "$RPM_BUILD_ROOT%{_infodir}" ]; then \
-       find $RPM_BUILD_ROOT%{_infodir} -type f -print | xrgs %{__gzip} -9nf; \
-fi; \
+echo "Compress man and info pages."; \
+%{?verbose:set -x;} \
+for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
+       if [ -d "$RPM_BUILD_ROOT$i" ]; then \
+               find "$RPM_BUILD_ROOT$i" -type f -print | xargs %{__gzip} -9nf; \
+       fi; \
+done; \
 }
 
 #-----------------------------------------------------------------
 # find and gzip all files in %{_mandir} and %{infodir}
 #
-# Requires: find, awk, strip
+# Requires: find, awk, strip, cut, xargs
 #
-%__spec_install_post_strip { \
-%{?debug:#}if [ -x /usr/lib/rpm/remove-unneeded-elf-sections ]; then \
-       /usr/lib/rpm/remove-unneeded-elf-sections %{buildroot}; \
-fi; \
+%__spec_install_post_strip {%{!?debug: \
+       %{?verbose:set -x;} \
+       echo "Strip executable binaries and shared object files."; \
+       filelist=`find $RPM_BUILD_ROOT -type f`; \
+       elfexelist=`echo $filelist | xargs -r file | \
+               awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
+       elfsharedlist=`echo $filelist | xargs -r file | \
+               awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
+       if [ -n "$elfexelist" ]; then \
+               strip --remove-section=.note  --remove-section=.comment $elfexelist; \
+       fi; \
+       if [ -n "$elfsharedlist" ]; then \
+               strip --strip-unneeded --remove-section=.note  --remove-section=.comment $elfsharedlist; \
+       fi; } \
 }
 
 #-----------------------------------------------------------------
@@ -133,6 +143,6 @@ fi; \
 # - strip all ELF executables and ELF shared objects if not %debug.
 #
 %__spec_install_post { \
-#%{__spec_install_post_strip} \
-#%{__spec_install_post_compress_docs} \
+%{__spec_install_post_strip} \
+%{__spec_install_post_compress_docs} \
 }
This page took 0.03797 seconds and 4 git commands to generate.