- set %_tmppath to current directory so that buildroots don't conflict
authorMark Huang <mlhuang@cs.princeton.edu>
Wed, 18 May 2005 15:18:43 +0000 (15:18 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Wed, 18 May 2005 15:18:43 +0000 (15:18 +0000)
- clean: remove all subpackage rpms

Makerules
Rules.mk

index 0f21906..6e0da0c 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2003-2005 The Trustees of Princeton University
 #
-# $Id: Makefile,v 1.63 2005/04/11 14:46:16 mlhuang Exp $
+# $Id: Makerules,v 1.14 2005/05/04 19:13:14 mlhuang Exp $
 #
 
 # Base cvsps and rpmbuild in the current directory
@@ -142,7 +142,8 @@ endif
 ifeq ($(TAG),HEAD)
 RPMFLAGS += --define "date $(DATE)"
 endif
-NVR := $(shell rpmquery $(RPMFLAGS) --specfile SPECS/$(notdir $(SPEC)).in 2>/dev/null | head -1)
+PACKAGES := $(shell rpmquery $(RPMFLAGS) --specfile SPECS/$(notdir $(SPEC)).in 2>/dev/null)
+NVR := $(word 1,$(PACKAGES))
 ARCH := $(shell rpmquery $(RPMFLAGS) --queryformat '%{ARCH}\n' --specfile SPECS/$(notdir $(SPEC)).in 2>/dev/null | head -1)
 
 all: RPMS/$(ARCH)/$(NVR).$(ARCH).rpm SRPMS/$(NVR).src.rpm
@@ -160,15 +161,17 @@ SRPMS/$(NVR).src.rpm: SPECS/$(notdir $(SPEC)) $(SOURCES) .rpmmacros
 # Base rpmbuild in the current directory
 .rpmmacros:
        echo "%_topdir $(HOME)" > $@
+       echo "%_tmppath $(HOME)/tmp" >> $@
 
 # Remove files generated by this package
 clean:
        rm -rf \
        BUILD/$(Base0) \
-       RPMS/$(ARCH)/$(NVR).$(ARCH).rpm \
+       $(foreach subpackage,$(PACKAGES),RPMS/*/$(subpackage)*) \
        SOURCES/$(Base0)* SOURCES/$(package)* \
        SPECS/$(notdir $(SPEC)).in SPECS/$(notdir $(SPEC)) $(MK) \
        SRPMS/$(NVR).src.rpm \
+       tmp \
        .cvsps/$(subst /,#,$(CVSROOT)/$(MODULE))
 
 .PHONY: all clean
index 0f21906..6e0da0c 100644 (file)
--- a/Rules.mk
+++ b/Rules.mk
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2003-2005 The Trustees of Princeton University
 #
-# $Id: Makefile,v 1.63 2005/04/11 14:46:16 mlhuang Exp $
+# $Id: Makerules,v 1.14 2005/05/04 19:13:14 mlhuang Exp $
 #
 
 # Base cvsps and rpmbuild in the current directory
@@ -142,7 +142,8 @@ endif
 ifeq ($(TAG),HEAD)
 RPMFLAGS += --define "date $(DATE)"
 endif
-NVR := $(shell rpmquery $(RPMFLAGS) --specfile SPECS/$(notdir $(SPEC)).in 2>/dev/null | head -1)
+PACKAGES := $(shell rpmquery $(RPMFLAGS) --specfile SPECS/$(notdir $(SPEC)).in 2>/dev/null)
+NVR := $(word 1,$(PACKAGES))
 ARCH := $(shell rpmquery $(RPMFLAGS) --queryformat '%{ARCH}\n' --specfile SPECS/$(notdir $(SPEC)).in 2>/dev/null | head -1)
 
 all: RPMS/$(ARCH)/$(NVR).$(ARCH).rpm SRPMS/$(NVR).src.rpm
@@ -160,15 +161,17 @@ SRPMS/$(NVR).src.rpm: SPECS/$(notdir $(SPEC)) $(SOURCES) .rpmmacros
 # Base rpmbuild in the current directory
 .rpmmacros:
        echo "%_topdir $(HOME)" > $@
+       echo "%_tmppath $(HOME)/tmp" >> $@
 
 # Remove files generated by this package
 clean:
        rm -rf \
        BUILD/$(Base0) \
-       RPMS/$(ARCH)/$(NVR).$(ARCH).rpm \
+       $(foreach subpackage,$(PACKAGES),RPMS/*/$(subpackage)*) \
        SOURCES/$(Base0)* SOURCES/$(package)* \
        SPECS/$(notdir $(SPEC)).in SPECS/$(notdir $(SPEC)) $(MK) \
        SRPMS/$(NVR).src.rpm \
+       tmp \
        .cvsps/$(subst /,#,$(CVSROOT)/$(MODULE))
 
 .PHONY: all clean