[elfutils: 20/20] Add back private Makefile rules for generating patches.

roland roland at fedoraproject.org
Thu Jul 29 23:57:52 UTC 2010


commit 8890358f17acaf2b5a1444fe2045221a8496550b
Author: Roland McGrath <roland at redhat.com>
Date:   Thu Jul 29 16:41:54 2010 -0700

    Add back private Makefile rules for generating patches.
    
    Signed-off-by: Roland McGrath <roland at redhat.com>

 Makefile |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..afa5440
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+patches := $(patsubst %,elfutils-%.patch,robustify portability)
+
+.PHONY: patches
+patches: $(patches)
+
+branch-portability = portable
+
+FORCE:;
+
+elfutils.git ?= ${HOME}/redhat/stock-elfutils/.git
+git-heads := $(wildcard $(elfutils.git)/refs/heads/*)
+ifneq (,$(git-heads))
+git-dir = git --git-dir=$(elfutils.git)
+git-archive = $(git-dir) archive
+get-master = master=`$(git-dir) merge-base origin/master $$branch` && \
+	     master=`$(git-dir) describe --tags --always $$master`
+else
+git-heads = FORCE
+git-archive = git archive --remote=git://git.fedorahosted.org/git/elfutils.git
+get-master = master=master
+endif
+
+git-%/configure: Makefile $(git-heads)
+	@rm -rf $(@D)
+	$(git-archive) --prefix=$(@D)/ $(firstword $(branch-$*) $*) | tar xf -
+	cd $(@D) && autoreconf -i && rm -rf autom4te.cache
+
+elfutils-%.patch: git-%/configure
+	branch=$(firstword $(branch-$*) $*); \
+	$(get-master) && \
+	(set -x; $(MAKE) git-$$master/configure) && \
+	(set -x; diff --exclude='.gitignore' -Nrpu git-$$master $(<D)) | \
+	filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new
+	mv $@.new $@
+
+elfutils-portable.spec: elfutils.spec
+	(echo '%define _with_compat 1'; sed 's/ check$$/& || :/' $<) > $@.new
+	mv -f $@.new $@
+
+rpmbuild-dirs = $(foreach what,source spec srcrpm,--define '_$(what)dir .')
+
+.PHONY: portable-srpm
+portable-srpm: elfutils-portable.spec $(patches) sources
+	rpmbuild-md5 $(rpmbuild-dirs) -bs $<


More information about the scm-commits mailing list