From 5c10f18776f6e5c5d46ce05606dcfa78b935103a Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Sat, 24 Dec 2005 00:54:09 +0000 Subject: Make build a little cleaner --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ef9c338..6bfb38f 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ RELEASE = cvs$(shell date +"%Y%m%d") DATE = $(shell date +"%Y-%m-%d") NOW = $(shell date +"%a %b %e %Y") SPECIN = ../docs-common/packaging/$(DOCBASE).spec -DOCSPEC = $(PWD)/SPECS/$(DOCBASE).spec -DOCSRCTAR = $(PWD)/SOURCES/$(DOCBASE)-$(RELEASE).src.tar.gz +DOCSPEC = $(shell rpm ${RPMFLAGS} --eval '%{_specdir}')/$(DOCBASE).spec +DOCSRCTAR = $(shell rpm ${RPMFLAGS} --eval '%{_sourcedir}')/$(DOCBASE)-$(RELEASE).src.tar.gz TITLE = Fedora Documentation Project Shared Files ###################################################### # Some RPM flags... @@ -23,7 +23,9 @@ TITLE = Fedora Documentation Project Shared Files RPMFLAGS = --define "docbase $(DOCBASE)" \ --define "version $(VERSION)" \ --define "release $(RELEASE)" \ - --define "_topdir $(PWD)" + --define "_topdir $(PWD)/rpmbuild" + +RPM = rpm ${RPMFLAGS} ###################################################### @@ -48,7 +50,7 @@ rpm: update cpio -pamdv $(DOCBASE)-$(RELEASE) # # Make RPM build tree; don't rely on local user's setup - mkdir -p {BUILD,RPMS/noarch,SOURCES,SPECS,SRPMS} + mkdir -p rpmbuild/{BUILD,RPMS/noarch,SOURCES,SPECS,SRPMS} tar -zcvf $(DOCSRCTAR) $(DOCBASE)-$(RELEASE) cp $(SPECIN) $(DOCSPEC) rm -rf $(DOCBASE)-$(RELEASE)/ @@ -62,6 +64,6 @@ rpm: update # Do the build... # rpmbuild -bb $(RPMFLAGS) $(DOCSPEC) - mv RPMS/noarch/*.rpm . + mv $(shell ${RPM} --eval '%{_rpmdir}')/noarch/*.rpm . rpmbuild --clean --rmsource $(RPMFLAGS) $(DOCSPEC) - rm -rf {BUILD,RPMS,SOURCES,SPECS,SRPMS} + rm -rf $(shell ${RPM} --eval '%{_topdir}') -- cgit