# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2003-2006 The Trustees of Princeton University
#
-# $Id: Rules.mk,v 1.27 2007/01/29 19:18:45 thierry Exp $
+# $Id: Rules.mk,v 1.28 2007/02/09 01:16:19 thierry Exp $
#
# Base rpmbuild in the current directory
# Define cvstag for tagged builds
echo "%define cvstag $(TAG)" >> $@
endif
- cvs -d $(CVSROOT) checkout -r $(TAG) -p $(SPEC) >> $@
+ $(if $($(package)-SVNPATH),\
+ svn cat $($(package)-SVNPATH)/$(SPEC) >> $@,\
+ cvs -d $(CVSROOT) checkout -r $(TAG) -p $(SPEC) >> $@)
+
#
# Parse spec file into Makefile fragment
SOURCEDIRS := $(call stripext,$(SOURCES))
# Thierry - Jan 29 2007
-# Allow different modules to have different CVSROOT's
+# Allow different modules to have different CVSROOT
+# and/or to be extracted from their SVNPATH
#
# is there a single module ? to mimick cvs export -d behaviour
MULTI_MODULE := $(word 2,$(MODULE))
# single module: do as before
SOURCES/$(package):
mkdir -p SOURCES
- cd SOURCES && cvs -d $(CVSROOT) export -r $(TAG) -d $(package) $(MODULE)
+ $(if $($(package)-SVNPATH),\
+ cd SOURCES && svn export $($(package)-SVNPATH) $(package),\
+ cd SOURCES && cvs -d $(CVSROOT) export -r $(TAG) -d $(package) $(MODULE))
else
# multiple modules : iterate
SOURCES/$(package):
mkdir -p SOURCES/$(package) && cd SOURCES/$(package) && (\
$(foreach module,$(MODULE),\
- cvs -d $(if $($(module)-CVSROOT),$($(module)-CVSROOT),$(CVSROOT)) export -r $(TAG) $(module);\
- ))
+ $(if $($(module)-SVNPATH), \
+ svn export $($(module)-SVNPATH) $(module), \
+ cvs -d $(if $($(module)-CVSROOT),$($(module)-CVSROOT),$(CVSROOT)) export -r $(TAG) $(module);\
+ )))
endif
# Make a hard-linked copy of the exported directory for each Source