]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- come cleanups to make it closer to rpm.macros from HEAD, applied more
authorPaweł Gołaszewski <blues@pld-linux.org>
Sat, 13 Sep 2003 17:39:17 +0000 (17:39 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  stripping in postinstall

Changed files:
    rpm.macros -> 1.85.2.11

rpm.macros

index 8b5744f393ee986bb4e1dfda646536798cc55af3..b30b1c221c16a618213310756c824f4b2e48effe 100644 (file)
@@ -3,6 +3,7 @@
 %_defaultdocdir  %{_usr}/share/doc
 %_fixowner       [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root.@ROOT_GROUP@
 %_fixgroup       true
+%_fixperms      %{__chmod} -Rf @FIXPERMS@
 %_topdir         %(echo $HOME)/rpm
 %_exec_prefix    %{_prefix}
 %_bindir         %{_exec_prefix}/bin
@@ -21,7 +22,7 @@
 #-----------------------------------------------------------------
 # CFLAGS and LDFLAGS used to build
 
-%debugcflags   -O0 -g
+%debugcflags   -O0 -g -Wall
 %rpmcflags     %{?debug:%debugcflags}%{!?debug:%optflags}
 %rpmldflags    %{!?debug:-s}
 
@@ -61,7 +62,7 @@
  CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
  %{?__cc:CC=%{__cc} ; export CC ; } \
  %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
- %{?configuredir:%{configuredir}}%{?!configuredir:.}/configure \
+ %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
        --host=%{_target_platform} \
        --prefix=%{_prefix} \
        --exec-prefix=%{_exec_prefix} \
        --infodir=%{_infodir} \
 }
 
+# ------------------------------------------------------------------------
+# Conditional build stuff.
+
+# Check if symbol is defined.
+# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
+%defined()     %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
+%undefined()   %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
+
+# Shorthand for %{defined with_...}
+%with()                %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
+%without()     %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
+
+# Handle conditional builds. %bcond_with is for case when feature is
+# default off and needs to be activated with --with ... command line 
+# switch. %bcond_without is for the dual case.
+#
+# %bcond_with foo defines symbol with_foo if --with foo was specified on
+# command line.
+# %bcond_without foo defines symbol with_foo if --without foo was *not* 
+# specified on command line.
+#
+# For example:
+#
+# %bcond_with extra_fonts
+# %bcond_without static
+# %if %{with extra_fonts}
+# ...
+# %endif
+# %ifdef %{with static}
+# ...
+# %endif
+# %{?with_static: ... }
+# %{!?with_static: ... }
+# %{?with_extra_fonts: ... }
+# %{!?with_extra_fonts: ... }
+# 
+# The bottom line: never use without_foo, _with_foo nor _without_foo, only
+# with_foo. This way changing default set of bconds for given spec is just
+# a matter of changing single line in it and syntax is more readable.
+%bcond_with()          %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
+%bcond_without()       %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
+# ------------------------------------------------------------------------
+
+
 # Location of autoconf macros
 %_aclocaldir   %(aclocal --print-ac-dir)
 
 %xmms_general_plugindir                %(xmms-config --general-plugin-dir)
 
 # If non-empty "debug" macro defined, add "dbg" suffix to release number
-%_rpmfilename  %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
+%_rpmfilename          %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
 
 # requires name = version-release
 %requires_releq()              %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}-%%{RELEASE}' %1| grep -v "is not")
 ; do echo $l; done >> %1 \
 }
 
-#-----------------------------------------------------------------
-# Update all GConf2 schemas
-#
-# Requires: GConf2
-#
-%gconf_schema_install { umask 022; \
-    GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" \
-    /usr/bin/gconftool-2 --makefile-install-rule \
-    /etc/gconf/schemas/*.schemas > /dev/null \
-}
-
 #-----------------------------------------------------------------
 # find and gzip all files in %{_mandir} and %{infodir}
 #
@@ -229,17 +263,22 @@ echo "Compress man and info pages."; \
 %__spec_install_post_strip {%{!?debug: \
 %{!?no_install_post_strip: \
        %{?verbose:set -x;} \
-       echo "Strip executable binaries and shared object files."; \
+       echo "Strip executable binaries, archives and shared object files."; \
        filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
        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`; \
+       elfarchiveslist=`echo $filelist | xargs -r file | \
+               awk '/current ar archive/ {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; \
+       if [ -n "$elfarchiveslist" ]; then \
+               strip --strip-debug --remove-section=.note  --remove-section=.comment $elfarchiveslist; \
        fi; } \
 } }
 #-----------------------------------------------------------------
@@ -287,19 +326,31 @@ echo "Compress kernel modules if any."; \
     if test -d $RPM_BUILD_ROOT/lib/modules ; then \
        find $RPM_BUILD_ROOT/lib/modules -name \*.o -type f -print | \
        xargs -r %{__gzip} -9nf; \
-       find $RPM_BUILD_ROOT/lib/modules -name \*.o -type l -printf "%p %l\n" | \
-       while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
+          find $RPM_BUILD_ROOT/lib/modules -name \*.o -type l -printf "%p %l\n" | \
+          while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
     fi; \
 } }
 
 %_source_payload        w9.gzdio
 %_binary_payload        w9.bzdio
 
+#-----------------------------------------------------------------
+# Update all GConf2 schemas
+#
+# Requires: GConf2
+#
+%gconf_schema_install { umask 022; \
+    GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" \
+    /usr/bin/gconftool-2 --makefile-install-rule \
+    /etc/gconf/schemas/*.schemas > /dev/null \
+}
+
 #-----------------------------------------------------------------
 # post %install sequence:
 # - autodeps exceptions
 # - compress all man and info pages,
 # - strip all ELF executables and ELF shared objects if not %debug.
+# - compress kernel modules if any
 
 ###################################################################
 # Requires/Provides automation
@@ -373,45 +424,3 @@ else \
 fi; \
 }
 
-# ------------------------------------------------------------------------
-# Conditional build stuff.
-
-# Check if symbol is defined.
-# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
-%defined()     %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
-%undefined()   %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
-
-# Shorthand for %{defined with_...}
-%with()                %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
-%without()     %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
-
-# Handle conditional builds. %bcond_with is for case when feature is
-# default off and needs to be activated with --with ... command line 
-# switch. %bcond_without is for the dual case.
-#
-# %bcond_with foo defines symbol with_foo if --with foo was specified on
-# command line.
-# %bcond_without foo defines symbol with_foo if --without foo was *not* 
-# specified on command line.
-#
-# For example:
-#
-# %bcond_with extra_fonts
-# %bcond_without static
-# %ifdef with_extra_fonts
-# ...
-# %endif
-# %ifdef with_static
-# ...
-# %endif
-# %{?with_static: ... }
-# %{!?with_static: ... }
-# %{?with_extra_fonts: ... }
-# %{!?with_extra_fonts: ... }
-# 
-# The bottom line: never use without_foo, _with_foo nor _without_foo, only
-# with_foo. This way changing default set of bconds for given spec is just
-# a matter of changing single line in it and syntax is more readable.
-%bcond_with()          %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
-%bcond_without()       %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
-# ------------------------------------------------------------------------
This page took 0.040576 seconds and 4 git commands to generate.