Add support for quilt (ticket #54) and bzr to %autosetup/patch
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 25 Jun 2012 07:34:22 +0000 (10:34 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 25 Jun 2012 07:34:22 +0000 (10:34 +0300)
- These are both "appears to have roughly the intended effect" level
  tested, but I'm not really familiar with either bzr or quilt so
  any further refinements need to come from people actually familiar
  with these tools.

configure.ac
macros.in

index 55ba214..cd11d26 100644 (file)
@@ -144,6 +144,8 @@ AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
 
 AC_PATH_PROG(__GIT, git, /usr/bin/git, $MYPATH)
 AC_PATH_PROG(__HG, hg, /usr/bin/hg, $MYPATH)
+AC_PATH_PROG(__BZR, bzr, /usr/bin/bzr, $MYPATH)
+AC_PATH_PROG(__QUILT, quilt, /usr/bin/quilt, $MYPATH)
 
 AC_PATH_PROG(__FAKECHROOT, fakechroot, no, $MYPATH)
 AM_CONDITIONAL(HAVE_FAKECHROOT, [test "$__FAKECHROOT" != "no"])
index 31bb70c..4c77bbb 100644 (file)
--- a/macros.in
+++ b/macros.in
@@ -70,6 +70,8 @@
 %__unzip               @__UNZIP@
 %__git                 @__GIT@
 %__hg                  @__HG@
+%__bzr                 @__BZR@
+%__quilt               @__QUILT@
 
 #==============================================================================
 # ---- Build system path macros.
@@ -1033,6 +1035,7 @@ done \
 %__scm_author rpm-build <rpm-build>
 
 # Plain patch (-m is unused)
+%__scm_setup_patch(q) %{nil}
 %__scm_apply_patch(qp:m:)\
 %{__patch} %{-p:-p%{-p*}} %{-q:-s}
 
@@ -1056,6 +1059,23 @@ done \
 %{__git} apply %{-p:-p%{-p*}} -\
 %{__git} commit %{-q} -a -m %{-m*} --author "%{__scm_author}"
 
+# Quilt
+%__scm_setup_quilt(q) %{nil}
+%__scm_apply_quilt(qp:m:)\
+%{__quilt} import %{-p:-p%{-p*}} %{1} && %{__quilt} push
+
+# Bzr
+%__scm_setup_bzr(q)\
+%{__bzr} whoami "%{__scm_author}"\
+%{__bzr} init %{-q}\
+%{__bzr} add .\
+%{__bzr} commit %{-q} -m "%{name}-%{version} base"
+
+# bzr doesn't seem to have its own command to apply patches?
+%__scm_apply_bzr(qp:m:)\
+%{__patch} %{-p:-p%{-p*}} %{-q:-s}\
+%{__bzr} commit %{-q} -m %{-m*}
+
 # Single patch application
 %apply_patch(qp:m:)\
 %{uncompress:%{1}} | %{expand:%__scm_apply_%{__scm} %{-q} %{-p:-p%{-p*}} %{-m:-m%{-m*}}}