]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- no backslashing needed inside %()
[packages/rpm.git] / rpm.macros
index a5d7eccc7264be82925d809d83029a92c32c5138..96ad4d9d9b0d97264e3ad400cc0f90d9278aa5c6 100644 (file)
@@ -1190,7 +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    \
@@ -1266,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.032176 seconds and 4 git commands to generate.