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