]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- added %__spec_install_post_compress_docs macro (complet),
authorkloczek <kloczek@pld-linux.org>
Sun, 10 Sep 2000 00:23:17 +0000 (00:23 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- added %__spec_install_post_strip (lines moved from %__spec_install_post)
- place comment out %__spec_install_post_compress_docs and
  %__spec_install_post_strip in %__spec_install_post (please uncomment this
  if you want testt this).
TODO: rewrite %__spec_install_post_strip:
 - move remove-unneeded-elf-sections script inside %__spec_install_post_strip
   macro and remove remove-unneeded-elf-sections script,
 - simplify stripping/cutting .note/.comment sections by use awk instead
   xargs, egrep (cut also ?),
 - use directly strip instead objcopy for remove .comment and .note sections
   (stripping andremoving unnused sections can be performet in one command
   line).

Changed files:
    rpm.macros -> 1.25

rpm.macros

index 886dd6f43fab01b8b090406763fa973b50790e51..eaa33eae16da6181cee7ddc95dca3c5790b2db88 100644 (file)
@@ -5,7 +5,6 @@
  CFLAGS="${CFLAGS:-%optflags}%{?debug: -g -O}" ; export CFLAGS ; \
  CXXFLAGS="${CXXFLAGS:-%optflags}%{?debug: -g -O}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%optflags}%{?debug: -g -O}" ; export FFLAGS ; \
- unset LINGUAS || : ; \
  ./configure %{_target_platform} \
        --prefix=%{_prefix} \
        --exec-prefix=%{_exec_prefix} \
@@ -19,7 +18,8 @@
        --localstatedir=%{_localstatedir} \
        --sharedstatedir=%{_sharedstatedir} \
        --mandir=%{_mandir} \
-       --infodir=%{_infodir} }
+       --infodir=%{_infodir} \
+}
 
 #------------------------------------------------------------------------------
 # The GNUconfigure macro does the following:
@@ -101,9 +101,38 @@ done \
 # If non-empty "debug" macro defined, add "dbg" suffix to release number
 %_rpmfilename          %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
 
-# remove .comment and .note from ELFs 
-%__spec_install_post\
- %{__arch_install_post}\
- %{__os_install_post}\
- %{?debug:#}if [ -x /usr/lib/rpm/remove-unneeded-elf-sections ] ; then /usr/lib/rpm/remove-unneeded-elf-sections %{buildroot}; fi\
-%{nil}
+#-----------------------------------------------------------------
+# find and gzip all files in %{_mandir} and %{infodir}
+#
+# 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; \
+}
+
+#-----------------------------------------------------------------
+# find and gzip all files in %{_mandir} and %{infodir}
+#
+# Requires: find, awk, strip
+#
+%__spec_install_post_strip { \
+%{?debug:#}if [ -x /usr/lib/rpm/remove-unneeded-elf-sections ]; then \
+       /usr/lib/rpm/remove-unneeded-elf-sections %{buildroot}; \
+fi; \
+}
+
+#-----------------------------------------------------------------
+# post %install sequence:
+# - compress all man and info pages,
+# - strip all ELF executables and ELF shared objects if not %debug.
+#
+%__spec_install_post { \
+#%{__spec_install_post_strip} \
+#%{__spec_install_post_compress_docs} \
+}
This page took 0.073583 seconds and 4 git commands to generate.