cvsdist 32b7b0
# Makefile for source rpm: elfutils
roland 5b8137
# $Id: Makefile,v 1.23 2007/05/03 22:49:17 roland Exp $
cvsdist 32b7b0
NAME := elfutils
roland 88db6a
SPECFILE = elfutils.spec
cvsdist 32b7b0
roland 3193ac
define find-makefile-common
roland 3193ac
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 3193ac
endef
roland 3193ac
roland 3193ac
MAKEFILE_COMMON := $(shell $(find-makefile-common))
roland 3193ac
roland 3193ac
ifeq ($(MAKEFILE_COMMON),)
roland 3193ac
# attept a checkout
roland 3193ac
define checkout-makefile-common
roland 3193ac
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 3193ac
endef
roland 3193ac
roland 3193ac
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
roland 3193ac
endif
roland 3193ac
roland 3193ac
include $(MAKEFILE_COMMON)
roland 76905f
roland 7b4e27
MONOTONE = mtn
roland f9d2e4
roland f9d2e4
elfutils-portability.patch: elfutils-$(VERSION).tar.gz
roland f9d2e4
	@rm -rf elfutils-master elfutils-portable
roland b60c5a
	$(MONOTONE) checkout -b com.redhat.elfutils elfutils-master
roland b60c5a
	$(MONOTONE) checkout -b com.redhat.elfutils.portable elfutils-portable
roland 2fa04c
	cd elfutils-master; autoreconf -i; rm -rf autom4te.cache _MTN
roland 2fa04c
	cd elfutils-portable; autoreconf -i; rm -rf autom4te.cache _MTN
roland f9d2e4
	diff -rpu elfutils-master elfutils-portable | \
roland 2c9c7d
	filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new
roland 76905f
	mv $@.new $@
roland 272810
roland 272810
elfutils-portable.spec: elfutils.spec
roland 975a08
	(echo '%define _with_compat 1'; sed 's/ check$$/& || :/' $<) > $@.new
roland 272810
	mv -f $@.new $@
roland 272810
roland 21a05c
portable-r = 0.$(subst $(DIST),,$(RELEASE))
roland 21a05c
portable-vr = $(VERSION)-$(portable-r)
roland b9eb28
portable.srpm = elfutils-$(portable-vr).src.rpm
roland 0e1f68
$(portable.srpm): elfutils-portable.spec elfutils-portability.patch \
roland 0e1f68
		  elfutils-$(VERSION).tar.gz
roland 272810
	$(RPM_WITH_DIRS) --nodeps -bs $<
roland b9eb28
roland 28d5fb
portable-srpm: $(portable.srpm)
roland 28d5fb
roland b9eb28
portable-dist = 3.0E-scratch
roland 21a05c
portable-build = \
roland 21a05c
	$(redhat)/brewroot/packages/elfutils/$(VERSION)/$(portable-r)
roland b9eb28
roland 78a550
ifeq (,$(wildcard /mnt/redhat/brewroot/packages/elfutils))
roland b9eb28
redhat = datadump.devel.redhat.com::redhat
roland b9eb28
rsync-to = devserv.devel.redhat.com:dist/elfutils/devel/systemtap-dist/
roland 21a05c
build-dep = $(portable.srpm)
roland b9eb28
else
roland b9eb28
redhat = /mnt/redhat
roland 21a05c
$(portable-build): $(portable.srpm)
roland 5b8137
	brew build $(BUILD_FLAGS) dist-$(portable-dist) $<
roland b9eb28
rsync-to = $(public)
roland 21a05c
build-dep = $(portable-build)/src/$(portable.srpm)
roland 21a05c
portable-build: $(portable-build)
roland 326459
$(build-dep): $(portable-build)
roland b9eb28
endif
roland b9eb28
roland 21a05c
dist-files = README.elfutils systemtap-elfutils.repo
roland 21a05c
rsync-files = --exclude=tests --exclude=data $(portable-build)/
roland b9eb28
public = sources.redhat.com:/sourceware/ftp/anonftp/pub/systemtap/elfutils/
roland b9eb28
roland b9eb28
RSYNC = RSYNC_RSH=ssh rsync
roland b9eb28
roland 21a05c
systemtap-dist: $(build-dep) $(dist-files)
roland b9eb28
	@mkdir -p $@
roland 01b73a
	$(RSYNC) -a --delete --progress -v $(rsync-files) systemtap-dist/
roland b9eb28
	ln $(dist-files) systemtap-dist/
roland 21a05c
	ln -v `rpm -qlp $<` systemtap-dist/
roland b9eb28
roland b9eb28
systemtap-dist-createrepo: systemtap-dist
roland b9eb28
ifneq ($(wildcard /usr/bin/createrepo),)
roland 99289b
	createrepo -q `cd $<; /bin/pwd`
roland b9eb28
endif
roland b9eb28
roland b9eb28
systemtap-sync: systemtap-dist-createrepo
roland 01b73a
	$(RSYNC) -az --delete --progress -v systemtap-dist/ $(rsync-to)