cvsdist 32b7b0c
# Makefile for source rpm: elfutils
3193ac1
# $Id: Makefile,v 1.22 2007/04/20 19:25:46 roland Exp $
cvsdist 32b7b0c
NAME := elfutils
88db6a6
SPECFILE = elfutils.spec
cvsdist 32b7b0c
3193ac1
define find-makefile-common
3193ac1
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
3193ac1
endef
3193ac1
3193ac1
MAKEFILE_COMMON := $(shell $(find-makefile-common))
3193ac1
3193ac1
ifeq ($(MAKEFILE_COMMON),)
3193ac1
# attept a checkout
3193ac1
define checkout-makefile-common
3193ac1
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
3193ac1
endef
3193ac1
3193ac1
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
3193ac1
endif
3193ac1
3193ac1
include $(MAKEFILE_COMMON)
76905ff
7b4e27b
MONOTONE = mtn
f9d2e4a
f9d2e4a
elfutils-portability.patch: elfutils-$(VERSION).tar.gz
f9d2e4a
	@rm -rf elfutils-master elfutils-portable
b60c5a7
	$(MONOTONE) checkout -b com.redhat.elfutils elfutils-master
b60c5a7
	$(MONOTONE) checkout -b com.redhat.elfutils.portable elfutils-portable
2fa04c0
	cd elfutils-master; autoreconf -i; rm -rf autom4te.cache _MTN
2fa04c0
	cd elfutils-portable; autoreconf -i; rm -rf autom4te.cache _MTN
f9d2e4a
	diff -rpu elfutils-master elfutils-portable | \
2c9c7d1
	filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new
76905ff
	mv $@.new $@
2728103
2728103
elfutils-portable.spec: elfutils.spec
975a083
	(echo '%define _with_compat 1'; sed 's/ check$$/& || :/' $<) > $@.new
2728103
	mv -f $@.new $@
2728103
21a05c7
portable-r = 0.$(subst $(DIST),,$(RELEASE))
21a05c7
portable-vr = $(VERSION)-$(portable-r)
b9eb285
portable.srpm = elfutils-$(portable-vr).src.rpm
0e1f68b
$(portable.srpm): elfutils-portable.spec elfutils-portability.patch \
0e1f68b
		  elfutils-$(VERSION).tar.gz
2728103
	$(RPM_WITH_DIRS) --nodeps -bs $<
b9eb285
28d5fbc
portable-srpm: $(portable.srpm)
28d5fbc
b9eb285
portable-dist = 3.0E-scratch
21a05c7
portable-build = \
21a05c7
	$(redhat)/brewroot/packages/elfutils/$(VERSION)/$(portable-r)
b9eb285
78a5501
ifeq (,$(wildcard /mnt/redhat/brewroot/packages/elfutils))
b9eb285
redhat = datadump.devel.redhat.com::redhat
b9eb285
rsync-to = devserv.devel.redhat.com:dist/elfutils/devel/systemtap-dist/
21a05c7
build-dep = $(portable.srpm)
b9eb285
else
b9eb285
redhat = /mnt/redhat
21a05c7
$(portable-build): $(portable.srpm)
21a05c7
	$(BUILD_CLIENT) $(BUILD_FLAGS) dist-$(portable-dist) $<
b9eb285
rsync-to = $(public)
21a05c7
build-dep = $(portable-build)/src/$(portable.srpm)
21a05c7
portable-build: $(portable-build)
326459b
$(build-dep): $(portable-build)
b9eb285
endif
b9eb285
21a05c7
dist-files = README.elfutils systemtap-elfutils.repo
21a05c7
rsync-files = --exclude=tests --exclude=data $(portable-build)/
b9eb285
public = sources.redhat.com:/sourceware/ftp/anonftp/pub/systemtap/elfutils/
b9eb285
b9eb285
RSYNC = RSYNC_RSH=ssh rsync
b9eb285
21a05c7
systemtap-dist: $(build-dep) $(dist-files)
b9eb285
	@mkdir -p $@
01b73a5
	$(RSYNC) -a --delete --progress -v $(rsync-files) systemtap-dist/
b9eb285
	ln $(dist-files) systemtap-dist/
21a05c7
	ln -v `rpm -qlp $<` systemtap-dist/
b9eb285
b9eb285
systemtap-dist-createrepo: systemtap-dist
b9eb285
ifneq ($(wildcard /usr/bin/createrepo),)
99289b5
	createrepo -q `cd $<; /bin/pwd`
b9eb285
endif
b9eb285
b9eb285
systemtap-sync: systemtap-dist-createrepo
01b73a5
	$(RSYNC) -az --delete --progress -v systemtap-dist/ $(rsync-to)