cvsdist 32b7b0
# Makefile for source rpm: elfutils
cvsdist 32b7b0
# $Id$
cvsdist 32b7b0
NAME := elfutils
9136b0
SPECFILE = elfutils.spec
cvsdist 32b7b0
5c16b0
all:
5c16b0
fa1a8e
UPSTREAM_CHECKS := sig
28fe4d
UPSTREAM_FILES = $(NAME)-$(VERSION).tar.bz2
fa1a8e
upstream:;
fa1a8e
847481
define find-makefile-common
d5215f
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
847481
endef
847481
847481
MAKEFILE_COMMON := $(shell $(find-makefile-common))
847481
847481
ifeq ($(MAKEFILE_COMMON),)
847481
# attept a checkout
847481
define checkout-makefile-common
847481
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
847481
endef
847481
847481
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
847481
endif
847481
847481
include $(MAKEFILE_COMMON)
5fa386
d3f439
ifneq (,$(CURL))
fa1a8e
CURL += -k
d2249a
endif
fa1a8e
5c16b0
patches := $(patsubst %,elfutils-%.patch,robustify portability)
5c16b0
all: $(patches)
5c16b0
fa1a8e
branch-portability = portable
5c16b0
d0b89e
git-%/configure: .git/refs/heads/* Makefile
5c16b0
	@rm -rf $(@D)
5c16b0
	git archive --prefix=$(@D)/ $(firstword $(branch-$*) $*) | tar xf -
5c16b0
	cd $(@D) && autoreconf -i && rm -rf autom4te.cache
fa1a8e
d0b89e
elfutils-%.patch: git-%/configure
d0b89e
	branch=$(firstword $(branch-$*) $*); \
d0b89e
	master=`git merge-base origin/master $$branch` && \
d0b89e
	master=`git describe --tags --always $$master` && \
d0b89e
	(set -x; $(MAKE) git-$$master/configure) && \
d0b89e
	(set -x; diff --exclude='.gitignore' -Nrpu git-$$master $(
570047
	filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new
5fa386
	mv $@.new $@
a0b693
a0b693
elfutils-portable.spec: elfutils.spec
9f4e62
	(echo '%define _with_compat 1'; sed 's/ check$$/& || :/' $<) > $@.new
a0b693
	mv -f $@.new $@
a0b693
3cda91
portable-r = 0.$(subst $(DIST),,$(RELEASE))
3cda91
portable-vr = $(VERSION)-$(portable-r)
7d6f19
portable.srpm = elfutils-$(portable-vr).src.rpm
5c16b0
$(portable.srpm): elfutils-portable.spec $(patches) \
28fe4d
		  elfutils-$(VERSION).tar.bz2
a0b693
	$(RPM_WITH_DIRS) --nodeps -bs $<
7d6f19
3025be
portable-srpm: $(portable.srpm)
3025be
7d6f19
portable-dist = 3.0E-scratch
3cda91
portable-build = \
3cda91
	$(redhat)/brewroot/packages/elfutils/$(VERSION)/$(portable-r)
7d6f19
a254d1
ifeq (,$(wildcard /mnt/redhat/brewroot/packages/elfutils))
7d6f19
redhat = datadump.devel.redhat.com::redhat
7d6f19
rsync-to = devserv.devel.redhat.com:dist/elfutils/devel/systemtap-dist/
3cda91
build-dep = $(portable.srpm)
7d6f19
else
7d6f19
redhat = /mnt/redhat
3cda91
$(portable-build): $(portable.srpm)
36b69f
	brew build $(BUILD_FLAGS) dist-$(portable-dist) $<
7d6f19
rsync-to = $(public)
3cda91
build-dep = $(portable-build)/src/$(portable.srpm)
3cda91
portable-build: $(portable-build)
96ce8e
$(build-dep): $(portable-build)
7d6f19
endif
7d6f19
3cda91
dist-files = README.elfutils systemtap-elfutils.repo
3cda91
rsync-files = --exclude=tests --exclude=data $(portable-build)/
7d6f19
public = sources.redhat.com:/sourceware/ftp/anonftp/pub/systemtap/elfutils/
7d6f19
7d6f19
RSYNC = RSYNC_RSH=ssh rsync
7d6f19
3cda91
systemtap-dist: $(build-dep) $(dist-files)
7d6f19
	@mkdir -p $@
f212e3
	$(RSYNC) -a --delete --progress -v $(rsync-files) systemtap-dist/
7d6f19
	ln $(dist-files) systemtap-dist/
3cda91
	ln -v `rpm -qlp $<` systemtap-dist/
7d6f19
7d6f19
systemtap-dist-createrepo: systemtap-dist
7d6f19
ifneq ($(wildcard /usr/bin/createrepo),)
4293c8
	createrepo -q `cd $<; /bin/pwd`
7d6f19
endif
7d6f19
7d6f19
systemtap-sync: systemtap-dist-createrepo
f212e3
	$(RSYNC) -az --delete --progress -v systemtap-dist/ $(rsync-to)