cvsdist 32b7b0c
# Makefile for source rpm: elfutils
cvsdist 32b7b0c
# $Id$
cvsdist 32b7b0c
NAME := elfutils
9136b0f
SPECFILE = elfutils.spec
cvsdist 32b7b0c
5c16b08
all:
5c16b08
fa1a8eb
UPSTREAM_CHECKS := sig
28fe4de
UPSTREAM_FILES = $(NAME)-$(VERSION).tar.bz2
fa1a8eb
upstream:;
fa1a8eb
8474812
define find-makefile-common
5f896cd
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
8474812
endef
8474812
8474812
MAKEFILE_COMMON := $(shell $(find-makefile-common))
8474812
8474812
ifeq ($(MAKEFILE_COMMON),)
8474812
# attept a checkout
8474812
define checkout-makefile-common
8474812
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
8474812
endef
8474812
8474812
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
8474812
endif
8474812
8474812
include $(MAKEFILE_COMMON)
5fa3867
d3f4391
ifneq (,$(CURL))
fa1a8eb
CURL += -k
d2249a3
endif
fa1a8eb
5c16b08
patches := $(patsubst %,elfutils-%.patch,robustify portability)
5c16b08
all: $(patches)
5c16b08
fa1a8eb
branch-portability = portable
5c16b08
e4d1f5c
git-%/configure: .git/refs/heads/* Makefile
5c16b08
	@rm -rf $(@D)
5c16b08
	git archive --prefix=$(@D)/ $(firstword $(branch-$*) $*) | tar xf -
5c16b08
	cd $(@D) && autoreconf -i && rm -rf autom4te.cache
fa1a8eb
e4d1f5c
elfutils-%.patch: git-%/configure
e4d1f5c
	branch=$(firstword $(branch-$*) $*); \
e4d1f5c
	master=`git merge-base origin/master $$branch` && \
e4d1f5c
	master=`git describe --tags --always $$master` && \
e4d1f5c
	(set -x; $(MAKE) git-$$master/configure) && \
e4d1f5c
	(set -x; diff --exclude='.gitignore' -Nrpu git-$$master $(
570047f
	filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new
5fa3867
	mv $@.new $@
a0b6935
a0b6935
elfutils-portable.spec: elfutils.spec
9f4e62e
	(echo '%define _with_compat 1'; sed 's/ check$$/& || :/' $<) > $@.new
a0b6935
	mv -f $@.new $@
a0b6935
3cda913
portable-r = 0.$(subst $(DIST),,$(RELEASE))
3cda913
portable-vr = $(VERSION)-$(portable-r)
7d6f194
portable.srpm = elfutils-$(portable-vr).src.rpm
5c16b08
$(portable.srpm): elfutils-portable.spec $(patches) \
28fe4de
		  elfutils-$(VERSION).tar.bz2
a0b6935
	$(RPM_WITH_DIRS) --nodeps -bs $<
7d6f194
3025beb
portable-srpm: $(portable.srpm)
3025beb
7d6f194
portable-dist = 3.0E-scratch
3cda913
portable-build = \
3cda913
	$(redhat)/brewroot/packages/elfutils/$(VERSION)/$(portable-r)
7d6f194
a254d19
ifeq (,$(wildcard /mnt/redhat/brewroot/packages/elfutils))
7d6f194
redhat = datadump.devel.redhat.com::redhat
7d6f194
rsync-to = devserv.devel.redhat.com:dist/elfutils/devel/systemtap-dist/
3cda913
build-dep = $(portable.srpm)
7d6f194
else
7d6f194
redhat = /mnt/redhat
3cda913
$(portable-build): $(portable.srpm)
36b69fb
	brew build $(BUILD_FLAGS) dist-$(portable-dist) $<
7d6f194
rsync-to = $(public)
3cda913
build-dep = $(portable-build)/src/$(portable.srpm)
3cda913
portable-build: $(portable-build)
96ce8ef
$(build-dep): $(portable-build)
7d6f194
endif
7d6f194
3cda913
dist-files = README.elfutils systemtap-elfutils.repo
3cda913
rsync-files = --exclude=tests --exclude=data $(portable-build)/
7d6f194
public = sources.redhat.com:/sourceware/ftp/anonftp/pub/systemtap/elfutils/
7d6f194
7d6f194
RSYNC = RSYNC_RSH=ssh rsync
7d6f194
3cda913
systemtap-dist: $(build-dep) $(dist-files)
7d6f194
	@mkdir -p $@
f212e3b
	$(RSYNC) -a --delete --progress -v $(rsync-files) systemtap-dist/
7d6f194
	ln $(dist-files) systemtap-dist/
3cda913
	ln -v `rpm -qlp $<` systemtap-dist/
7d6f194
7d6f194
systemtap-dist-createrepo: systemtap-dist
7d6f194
ifneq ($(wildcard /usr/bin/createrepo),)
4293c85
	createrepo -q `cd $<; /bin/pwd`
7d6f194
endif
7d6f194
7d6f194
systemtap-sync: systemtap-dist-createrepo
f212e3b
	$(RSYNC) -az --delete --progress -v systemtap-dist/ $(rsync-to)