From 8890358f17acaf2b5a1444fe2045221a8496550b Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Jul 29 2010 23:41:54 +0000 Subject: Add back private Makefile rules for generating patches. Signed-off-by: Roland McGrath --- 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 $( $@.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 $<