]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- no backslashing needed inside %()
[packages/rpm.git] / rpm.macros
index 0ccf2240e66951352db3409699085003710cfb06..96ad4d9d9b0d97264e3ad400cc0f90d9278aa5c6 100644 (file)
@@ -352,23 +352,28 @@ unset DISPLAY ||:\
        if [ -d "$RPM_BUILD_ROOT" ]; then \
        echo "Strip executable binaries, archives and shared object files."; \
        filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
-       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`; \
+       printf "Considering %d files\n" $(echo "$filelist" | wc -l); \
+       filetypes=`echo $filelist | xargs -r file` \
+       elfexelist=`echo "$filetypes" | awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
+       elfsharedlist=`echo "$filetypes" | awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
+       archiveslist=`echo "$filetypes" | awk '/current ar archive/ {print $1}' | cut -d: -f1`; \
        if [ -n "$elfexelist" ]; then \
+               printf "Stripping %d ELF executables..." $(echo "$elfexelist" | wc -l); \
                chmod u+w $elfexelist; \
                %{__strip} --remove-section=.note --remove-section=.comment $elfexelist; \
+               echo "DONE"; \
        fi; \
        if [ -n "$elfsharedlist" ]; then \
+               printf "Stripping %d ELF shared libraries..." $(echo "$elfsharedlist" | wc -l); \
                chmod u+w $elfsharedlist; \
                %{__strip} --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
+               echo "DONE"; \
        fi; \
-       if [ -n "$elfarchiveslist" ]; then \
-               chmod u+w $elfarchiveslist; \
-               %{__strip} --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \
+       if [ -n "$archiveslist" ]; then \
+               printf "Stripping %d ar archives..." $(echo "$elfsharedlist" | wc -l); \
+               chmod u+w $archiveslist; \
+               %{__strip} --strip-debug --remove-section=.note --remove-section=.comment $archiveslist; \
+               echo "DONE"; \
        fi; \
 fi; }; __spec_install_post_strip } } }
 
@@ -580,7 +585,7 @@ fi \
 # for using PHP post scripts. for PHP >= 5.0
 %php_webserver_restart \
 [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart \
-[ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart \
+[ ! -f /etc/httpd/conf.d/??_mod_php.conf ] || %service -q httpd restart \
 if [ -f /etc/rc.d/init.d/php-fcgi ]; then \
        PHP_FCGI_BINARY=; . /etc/sysconfig/php-fcgi 2>/dev/null \
        if [[ ${PHP_FCGI_BINARY:-php.fcgi} = *php.fcgi* ]]; then \
@@ -592,7 +597,7 @@ fi \
 # for using php post scripts. for PHP >= 4.0 && PHP < 5.0
 %php4_webserver_restart \
 [ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service -q apache restart \
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service -q httpd restart \
+[ ! -f /etc/httpd/conf.d/??_mod_php4.conf ] || %service -q httpd restart \
 if [ -f /etc/rc.d/init.d/php-fcgi ]; then \
        PHP_FCGI_BINARY=; . /etc/sysconfig/php-fcgi 2>/dev/null \
        if [[ ${PHP_FCGI_BINARY:-php.fcgi} = *php4.fcgi* ]]; then \
@@ -1185,6 +1190,13 @@ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}
        ln -sf %{_kernelsrcdir}/config-$cfg o/.config                                   \
        ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers    \
        ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h \
+%ifarch ppc ppc64                                                                                                      \
+       install -d o/include/asm                                                                                \
+       [ ! -d %{_kernelsrcdir}/include/asm-powerpc ] || ln -sf %{_kernelsrcdir}/include/asm-powerpc/* o/include/asm    \
+       [ ! -d %{_kernelsrcdir}/include/asm-%{_target_base_arch} ] || ln -snf %{_kernelsrcdir}/include/asm-%{_target_base_arch}/* o/include/asm \
+%else                                                                                                                          \
+       ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} o/include/asm \
+%endif                                                                                                                         \
                                                                                                                                        \
        set +x                                                                                                                  \
        [ -z "$PATCH_SH" ] || echo "$PATCH_SH" | %__spec_build_shell    \
@@ -1260,4 +1272,43 @@ for MODULE in {%{-m*},}; do                                                                                      \
 done                                                                                                                           \
 %{nil}
 
+# patchset macros
+# Author: Elan Ruusamäe <glen@pld-linux.org>
+#
+# Usage:
+#   %patchset_source -f <seq(1) format> <start> [<end>]
+#   %patchset_patch <start> [<end>]
+#
+# If <end> is omited, it is assumed to be <start>.
+#
+# For example in preamble:
+#  %patchset_source -f ftp://ftp.vim.org/pub/editors/vim/patches/7.0/7.0.%03g 33 44
+# and in %prep:
+#  %patchset_patch 33 44
+
+# generate SourceX urls from range START STOP
+# Format can be SINGLE format char of %e, %f, %g, see seq(1)
+# The sources start from 10000
+%patchset_source(f:b:) %(
+       base=%{-b*}%{!-b*:10000};
+       start=$((%1 + $base));
+       end=$((%{?2}%{!?2:%{1}} + $base));
+       # we need to call seq twice as it doesn't allow two formats
+       seq -f 'Patch%g:' $start $end > %{tmpdir}/__ps1;
+       seq -f '%{-f*}' %1 %{?2}%{!?2:%{1}} > %{tmpdir}/__ps2;
+       paste %{tmpdir}/__ps{1,2};
+       rm -f %{tmpdir}/__ps{1,2};
+) %{nil}
+
+# apply sources from %patchset_source
+# -p specify -pX for %patch line
+# -b base offset: defaults to 10000
+%patchset_patch(f:p:b:) %(
+       base=%{-b*}%{!-b*:10000};
+       start=$((%1 + $base));
+       end=$((%{?2}%{!?2:%{1}} + $base));
+       echo ": patchset_patch %1%{?2: to %2}";
+       seq -f 'patch%g %{-p*:-p%{-p*}}' $start $end | sed -e s,^,%%,;
+) %{nil}
+
 # vim:ts=4 sw=4 noet syn=spec
This page took 0.047082 seconds and 4 git commands to generate.