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} \
--localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} \
--mandir=%{_mandir} \
- --infodir=%{_infodir} }
+ --infodir=%{_infodir} \
+}
#------------------------------------------------------------------------------
# The GNUconfigure macro does the following:
# 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} \
+}