[csw-devel] SF.net SVN: gar:[2994] csw/mgar/gar
dmichelsen at users.sourceforge.net
dmichelsen at users.sourceforge.net
Thu Feb 5 11:29:10 CET 2009
Revision: 2994
http://gar.svn.sourceforge.net/gar/?rev=2994&view=rev
Author: dmichelsen
Date: 2009-02-05 10:29:10 +0000 (Thu, 05 Feb 2009)
Log Message:
-----------
mGAR v2: Add branch for dynamic license and gspec
Modified Paths:
--------------
csw/mgar/gar/v2-dynamiclicense/gar.conf.mk
csw/mgar/gar/v2-dynamiclicense/gar.mk
csw/mgar/gar/v2-dynamiclicense/gar.pkg.mk
Added Paths:
-----------
csw/mgar/gar/v2-dynamiclicense/
Modified: csw/mgar/gar/v2-dynamiclicense/gar.conf.mk
===================================================================
--- csw/mgar/gar/v2/gar.conf.mk 2009-02-04 21:12:03 UTC (rev 2993)
+++ csw/mgar/gar/v2-dynamiclicense/gar.conf.mk 2009-02-05 10:29:10 UTC (rev 2994)
@@ -12,6 +12,9 @@
# Pick up user information
-include $(HOME)/.garrc
+# This is the prefix for every generated package
+PKGPREFIX ?= CSW
+
MODULATION ?= global
FILEDIR ?= files
DOWNLOADDIR ?= download
Modified: csw/mgar/gar/v2-dynamiclicense/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk 2009-02-04 21:12:03 UTC (rev 2993)
+++ csw/mgar/gar/v2-dynamiclicense/gar.mk 2009-02-05 10:29:10 UTC (rev 2994)
@@ -34,6 +34,8 @@
DISTNAME ?= $(GARNAME)-$(GARVERSION)
+DISTFILES ?=
+
ALLFILES ?= $(DISTFILES) $(PATCHFILES)
ifeq ($(MAKE_INSTALL_DIRS),1)
@@ -94,9 +96,11 @@
# ========================= MODULATIONS ========================
# The default is to modulate over ISAs
-MODULATORS ?= ISA $(EXTRA_MODULATORS) $(EXTRA_MODULATORS_$(GARCH))
+MODULATORS ?= ISA $(if $(LEGACY_VERSIONS),GARVERSION) $(EXTRA_MODULATORS) $(EXTRA_MODULATORS_$(GARCH))
MODULATIONS_ISA = $(NEEDED_ISAS)
+MODULATIONS_GARVERSION ?= $(LEGACY_VERSIONS)
+
tolower = $(shell echo $(1) | tr '[A-Z]' '[a-z]')
expand_modulator_1 = $(addprefix $(call tolower,$(1))-,$(MODULATIONS_$(1)))
# This expands to the list of all modulators with their respective modulations
@@ -475,11 +479,12 @@
# default: relocate to ISA subdirs if more than one ISA, use isaexec-wrapper for bin/, etc.
# NO_ISAEXEC = 1: ISA_DEFAULT gets installed in bin/..., all others in bin/$ISA/
#
-# Automatic merging is only possible if you have the default modulation "ISA"
+# Automatic merging is only possible if you have the default modulation "ISA" or
+# alternatively "GARVERSION"
# Otherwise you *must* specify merge scripts for all modulations.
ifeq ($(NEEDED_ISAS),$(ISA_DEFAULT))
-MERGE_SCRIPTS_isa-$(ISA_DEFAULT) ?= copy-all $(EXTRA_MERGE_SCRIPTS_$(ISA_DEFAULT)) $(EXTRA_MERGE_SCRIPTS)
+MERGE_SCRIPTS_isa-$(ISA_DEFAULT) ?= copy-all $(EXTRA_MERGE_SCRIPTS_isa-$(ISA_DEFAULT)) $(EXTRA_MERGE_SCRIPTS)
else
ISAEXEC_DIRS ?= $(if $(NO_ISAEXEC),,$(bindir) $(sbindir) $(libexecdir))
MERGE_DIRS_isa-$(ISA_DEFAULT) ?=
@@ -488,6 +493,8 @@
MERGE_SCRIPTS_isa-$(ISA) ?= copy-relocated-only $(EXTRA_MERGE_SCRIPTS_isa-$(ISA)) $(EXTRA_MERGE_SCRIPTS)
endif
+
+
# These directories get relocated into their ISA subdirectories
MERGE_DIRS ?= $(MERGE_DIRS_$(MODULATION))
Modified: csw/mgar/gar/v2-dynamiclicense/gar.pkg.mk
===================================================================
--- csw/mgar/gar/v2/gar.pkg.mk 2009-02-04 21:12:03 UTC (rev 2993)
+++ csw/mgar/gar/v2-dynamiclicense/gar.pkg.mk 2009-02-05 10:29:10 UTC (rev 2994)
@@ -21,7 +21,12 @@
PKGINFO ?= /usr/bin/pkginfo
-SPKG_SPECS ?= $(basename $(filter %.gspec,$(DISTFILES)))
+# You can use either PACKAGES with dynamic gspec-files or explicitly add gspec-files to DISTFILES.
+# Do "PACKAGES = " when you build a package whose GARNAME is not the package name.
+# The whole processing is done from SPKG_SPECS, which includes all packages to be build.
+# DO NOT USE $(PACKAGES) IN RULES!
+PACKAGES ?= CSW$(GARNAME)
+SPKG_SPECS ?= $(sort $(basename $(filter %.gspec,$(DISTFILES))) $(PACKAGES))
_PKG_SPECS = $(filter-out $(NOPACKAGE),$(SPKG_SPECS))
# Set this to your svn binary
@@ -200,7 +205,41 @@
) \
)) >$@)
+define catalogname
+$(if $(CATALOGNAME_$(1)),$(CATALOGNAME_$(1)),$(patsubst CSW%,%,$(1)))
+endef
+# This rule dynamically generates gspec-files
+.PRECIOUS: $(WORKDIR)/%.gspec
+$(WORKDIR)/%.gspec: CATALOGNAME_$* ?= $(CATALOGNAME)
+$(WORKDIR)/%.gspec: ARCHALL_$* ?= $(ARCHALL)
+$(WORKDIR)/%.gspec:
+ $(_DBG)(echo "%var bitname $(call catalogname,$*)"; \
+ echo "%var pkgname $*"; \
+ $(if $(ARCHALL_$*),echo "%var arch all";) \
+ echo "%include url file://%{PKGLIB}/csw_dyndepend.gspec") >$@
+
+# This rule dynamically generates copyright files
+.PRECIOUS: $(WORKDIR)/copyright $(WORKDIR)/%.copyright
+$(WORKDIR)/copyright:
+ $(_DBG)$(if $(LICENSE),cp $(WORKDIR)/$(LICENSE) $@,true)
+
+
+$(WORKDIR)/%.copyright: LICENSEDIR=$(docdir)/$(call catalogname,$*)
+$(WORKDIR)/%.copyright: | $(WORKDIR)/copyright
+ $(_DBG)$(if $(LICENSE_$*),\
+ mkdir -p $(PKGROOT)$(LICENSEDIR) && \
+ cp $(WORKDIR)/$(LICENSE_$*) $(PKGROOT)$(LICENSEDIR)/license; \
+ (echo "This software is copyrighted. Please see the full license at"; \
+ echo " $(LICENSEDIR)/license") > $@, \
+ if [ -f $(WORKDIR)/copyright ]; then \
+ mkdir -p $(PKGROOT)$(LICENSEDIR) && \
+ cp $(WORKDIR)/copyright $(PKGROOT)$(LICENSEDIR)/license; \
+ (echo "This software is copyrighted. Please see the full license at"; \
+ echo " $(LICENSEDIR)/license") > $@ \
+ fi \
+ )
+
# package - Use the mkpackage utility to create Solaris packages
#
@@ -225,7 +264,7 @@
package: extract merge $(SPKG_DESTDIRS) pre-package $(PACKAGE_TARGETS) post-package
$(DONADA)
-package-%: $(WORKDIR)/%.prototype-$(GARCH) $(WORKDIR)/%.depend
+package-%: $(WORKDIR)/%.gspec $(WORKDIR)/%.copyright $(WORKDIR)/%.prototype-$(GARCH) $(WORKDIR)/%.depend
@echo " ==> Processing $*.gspec"
$(_DBG)( $(call _PKG_ENV,$*) mkpackage --spec $(WORKDIR)/$*.gspec \
--spooldir $(SPKG_SPOOLDIR) \
@@ -287,11 +326,11 @@
#
define _pkglist_pkgname
-$(shell perl -F'\s+' -ane 'print "$$F[2]" if( $$F[0] eq "%var" && $$F[1] eq "pkgname")' files/$(1).gspec)
+$(if $(filter $(1),$(PACKAGES)),$(filter $(1),$(PACKAGES)),$(shell perl -F'\s+' -ane 'print "$$F[2]" if( $$F[0] eq "%var" && $$F[1] eq "pkgname")' files/$(1).gspec))
endef
define _pkglist_catalogname
-$(shell perl -F'\s+' -ane 'print "$$F[2]" if( $$F[0] eq "%var" && $$F[1] eq "bitname")' files/$(1).gspec)
+$(if $(filter $(1),$(PACKAGES)),$(call catalogname,$(1)),$(shell perl -F'\s+' -ane 'print "$$F[2]" if( $$F[0] eq "%var" && $$F[1] eq "bitname")' files/$(1).gspec))
endef
define _pkglist_one
@@ -299,4 +338,5 @@
endef
pkglist:
+ @echo $(GARDIR)
@$(foreach SPEC,$(SPKG_SPECS),echo "$(call _pkglist_one,$(SPEC))";)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list