[csw-devel] SF.net SVN: gar:[19814] csw/mgar/gar
dmichelsen at users.sourceforge.net
dmichelsen at users.sourceforge.net
Tue Dec 4 19:29:18 CET 2012
Revision: 19814
http://gar.svn.sourceforge.net/gar/?rev=19814&view=rev
Author: dmichelsen
Date: 2012-12-04 18:29:17 +0000 (Tue, 04 Dec 2012)
Log Message:
-----------
mGAR bts: Make new branch for world-bootstrappable bratislava-release
Modified Paths:
--------------
csw/mgar/gar/bts/gar.conf.mk
csw/mgar/gar/bts/gar.mk
csw/mgar/gar/bts/gar.pkg.mk
Added Paths:
-----------
csw/mgar/gar/bts/
csw/mgar/gar/bts/bin/cswproto
Removed Paths:
-------------
csw/mgar/gar/bts/bin/cswproto
Deleted: csw/mgar/gar/bts/bin/cswproto
===================================================================
--- csw/mgar/gar/v2/bin/cswproto 2012-12-04 16:19:05 UTC (rev 19812)
+++ csw/mgar/gar/bts/bin/cswproto 2012-12-04 18:29:17 UTC (rev 19814)
@@ -1,176 +0,0 @@
-#!/opt/csw/bin/perl -lw
-#
-# $Id$
-#
-# Copyright 2006 Cory Omand <comand at blastwave.org>
-# All rights reserved. Use is subject to license terms.
-#
-# Redistribution and/or use, with or without modification, is
-# permitted. This software is without warranty of any kind. The
-# author(s) shall not be liable in the event that use of the
-# software causes damage.
-#
-# cswproto - Create package prototypes which adhere to CSW standards.
-#
-
-use strict;
-use File::Basename;
-use File::Spec::Functions qw/catfile/;
-use Getopt::Long qw/:config no_ignore_case/;
-use POSIX;
-
-use vars qw/
- @XFORMS $Common $StdOwn $StdGrp $StdDirPerm $common $stamp $root
- /;
-
-# atime=8,mtime=9,ctime=10
-use constant TIME_FIELD => 10;
-
-# Prototype defaults
-$StdOwn = 'root';
-$StdGrp = 'bin';
-$StdDirPerm = '0755';
-
-# Path transforms
- at XFORMS = (
- [ qr{^/opt/csw/man$}, q{/opt/csw/share/man} ],
- [ qr{^/opt/csw/doc$}, q{/opt/csw/share/doc} ],
- [ qr{^/opt/csw/info$}, q{/opt/csw/share/info} ],
-);
-
-# Print usage information and exit
-sub usage {
- print join(" ", @_) if @_;
-
- my $program = basename $0;
- print <<"_USAGE_";
-Usage: $program [-c <commonpathes>] [-h] [-s <timestamp>] path1[=path1] ... pathN[=pathN]
-
- -c Filename containing common pathes not to include in the package
-
- -s Timestamp source.
- The path to a file to be used as the base timestamp for prototype
- operations. If this is specified, all source file creation times
- are compared to the creation time of this file. Files created
- *before* this time will be excluded from the prototype.
-
- -h Display brief usage.
-
- pathN The remainder of arguments to this command will be specified
- directly to pkgproto. These arguments specify which paths are to
- be included in the prototype. This can be specified as
- pathX=pathY to use a different prefix for files in the prototype
- than were present on the build system.
-_USAGE_
-
- exit 1;
-}
-
-# Check whether a path is a 'common' file, defined in __DATA__
-sub is_common {
- my $path = shift;
- return 1 if $path =~ /$Common/;
- return 0;
-}
-
-# Returns true if the file should be excluded, false otherwise.
-sub exclude {
- my $path = shift;
-
- return 0 unless $stamp;
- return 1 unless $path;
-
- die "Path $path is not readable by current user!\n" unless -r $path or -l $path;
-
- my $time = (lstat($path))[TIME_FIELD];
- return ($time >= $stamp) ? 0 : 1;
-}
-
-#
-# MAIN EXECUTION
-#
-
-# Process command line arguments
-my $test;
-GetOptions(
- 'root=s' => \$root,
- 'stamp=s' => \$stamp,
- 'common=s' => \$common,
- 'help' => \&usage,
-) or usage;
-
-usage "Error: timestamp '$stamp' not readable" if $stamp and not -r $stamp;
-usage "Error: one or more pkgproto patterns required" unless @ARGV;
-
-$stamp = $stamp ? (stat($stamp))[TIME_FIELD] : 0;
-
-if( $common ) {
- # Load common path contents
- my %alldirs = ('/' => 1);
- open F, $common || die "Couldn't open $common";
- while (<F>) {
- chomp; next if /^\s*$/ or /^#/;
- s/\+/\\+/g;
- s/\-/\\-/g;
- my @c = split( m!/! );
- my @pc = map { join( '/', @c[0..$_] ) } 1..$#c;
- $alldirs{$_} = 1 foreach (@pc);
- }
- close F;
- my $re = '^(' . join( '|', keys %alldirs ) . ')$';
- $Common = qr /$re/;
-}
-
-my @prototype;
-
-foreach my $protopat (@ARGV) {
- my ($actual, $virtual) = split /=/, $protopat;
-
- my @pproto = `/usr/bin/pkgproto $protopat`;
- die "Failed to generate prototype"
- unless WIFEXITED($?) and WEXITSTATUS($?) == 0;
-
-SPECLINE:
- foreach my $entry (@pproto) {
- chomp $entry;
- do { print $entry; next } if $entry =~ /^(?:i|\!)/;
-
- my @F = split /\s+/, $entry;
- my ($lhs, $rhs) = split /=/, $F[2];
-
- # Find the real path
- my $realpath;
- if ($F[0] eq 's' or $F[0] eq 'l') {
- $realpath = substr($lhs, 0, 1) ne '/'
- ? catfile($actual, $lhs)
- : $lhs;
-
- }
- else {
- $F[2] = $lhs if $lhs and $rhs;
- $realpath = $rhs
- ? $rhs
- : (substr($lhs, 0, 1) ne '/' ? catfile($actual, $lhs) : $lhs);
- }
-
- # Then do path transforms
- foreach my $xform (@XFORMS) { $F[2] =~ s/$xform->[0]/$xform->[1]/g }
- $F[2] =~ s/$root// if $root;
- next unless $F[2];
-
- # Then process any excludes
- next SPECLINE if( $F[2] =~ /$Common/ );
- next if exclude($realpath);
-
- # Fix up dir permissions/file ownership.
- $F[3] = $StdDirPerm if $F[0] eq 'd';
- ($F[4], $F[5]) = ( $StdOwn, $StdGrp )
- unless $F[0] eq 's' or $F[0] eq 'l';
-
- push @prototype, [ grep { defined $_ } @F ];
- }
-}
-
-print join " " => @$_ foreach (sort { $a->[2] cmp $b->[2] } @prototype);
-
-# End of file
Copied: csw/mgar/gar/bts/bin/cswproto (from rev 19813, csw/mgar/gar/v2/bin/cswproto)
===================================================================
--- csw/mgar/gar/bts/bin/cswproto (rev 0)
+++ csw/mgar/gar/bts/bin/cswproto 2012-12-04 18:29:17 UTC (rev 19814)
@@ -0,0 +1,169 @@
+#!/opt/csw/bin/perl -lw
+#
+# $Id$
+#
+# Copyright 2006 Cory Omand <comand at blastwave.org>
+# All rights reserved. Use is subject to license terms.
+#
+# Redistribution and/or use, with or without modification, is
+# permitted. This software is without warranty of any kind. The
+# author(s) shall not be liable in the event that use of the
+# software causes damage.
+#
+# cswproto - Create package prototypes which adhere to CSW standards.
+#
+
+use strict;
+use File::Basename;
+use File::Spec::Functions qw/catfile/;
+use Getopt::Long qw/:config no_ignore_case/;
+use POSIX;
+
+use vars qw/
+ @XFORMS $Common $StdOwn $StdGrp $StdDirPerm $common $stamp $root
+ /;
+
+# atime=8,mtime=9,ctime=10
+use constant TIME_FIELD => 10;
+
+# Prototype defaults
+$StdOwn = 'root';
+$StdGrp = 'bin';
+$StdDirPerm = '0755';
+
+# Path transforms
+ at XFORMS = (
+ [ qr{^/opt/csw/man$}, q{/opt/csw/share/man} ],
+ [ qr{^/opt/csw/doc$}, q{/opt/csw/share/doc} ],
+ [ qr{^/opt/csw/info$}, q{/opt/csw/share/info} ],
+);
+
+# Print usage information and exit
+sub usage {
+ print join(" ", @_) if @_;
+
+ my $program = basename $0;
+ print <<"_USAGE_";
+Usage: $program [-c <commonpathes>] [-h] [-s <timestamp>] path1[=path1] ... pathN[=pathN]
+
+ -c Filename containing common pathes not to include in the package
+
+ -s Timestamp source.
+ The path to a file to be used as the base timestamp for prototype
+ operations. If this is specified, all source file creation times
+ are compared to the creation time of this file. Files created
+ *before* this time will be excluded from the prototype.
+
+ -h Display brief usage.
+
+ pathN The remainder of arguments to this command will be specified
+ directly to pkgproto. These arguments specify which paths are to
+ be included in the prototype. This can be specified as
+ pathX=pathY to use a different prefix for files in the prototype
+ than were present on the build system.
+_USAGE_
+
+ exit 1;
+}
+
+# Returns true if the file should be excluded, false otherwise.
+sub exclude {
+ my $path = shift;
+
+ return 0 unless $stamp;
+ return 1 unless $path;
+
+ die "Path $path is not readable by current user!\n" unless -r $path or -l $path;
+
+ my $time = (lstat($path))[TIME_FIELD];
+ return ($time >= $stamp) ? 0 : 1;
+}
+
+#
+# MAIN EXECUTION
+#
+
+# Process command line arguments
+my $test;
+GetOptions(
+ 'root=s' => \$root,
+ 'stamp=s' => \$stamp,
+ 'common=s' => \$common,
+ 'help' => \&usage,
+) or usage;
+
+usage "Error: timestamp '$stamp' not readable" if $stamp and not -r $stamp;
+usage "Error: one or more pkgproto patterns required" unless @ARGV;
+
+$stamp = $stamp ? (stat($stamp))[TIME_FIELD] : 0;
+
+if( $common ) {
+ # Load common path contents
+ my %alldirs = ('/' => 1);
+ open F, $common || die "Couldn't open $common";
+ while (<F>) {
+ chomp; next if /^\s*$/ or /^#/;
+ s/\+/\\+/g;
+ s/\-/\\-/g;
+ my @c = split( m!/! );
+ my @pc = map { join( '/', @c[0..$_] ) } 1..$#c;
+ $alldirs{$_} = 1 foreach (@pc);
+ }
+ close F;
+ my $re = '^(' . join( '|', keys %alldirs ) . ')$';
+ $Common = qr /$re/;
+}
+
+my @prototype;
+
+foreach my $protopat (@ARGV) {
+ my ($actual, $virtual) = split /=/, $protopat;
+
+ my @pproto = `/usr/bin/pkgproto $protopat`;
+ die "Failed to generate prototype"
+ unless WIFEXITED($?) and WEXITSTATUS($?) == 0;
+
+SPECLINE:
+ foreach my $entry (@pproto) {
+ chomp $entry;
+ do { print $entry; next } if $entry =~ /^(?:i|\!)/;
+
+ my @F = split /\s+/, $entry;
+ my ($lhs, $rhs) = split /=/, $F[2];
+
+ # Find the real path
+ my $realpath;
+ if ($F[0] eq 's' or $F[0] eq 'l') {
+ $realpath = substr($lhs, 0, 1) ne '/'
+ ? catfile($actual, $lhs)
+ : $lhs;
+
+ }
+ else {
+ $F[2] = $lhs if $lhs and $rhs;
+ $realpath = $rhs
+ ? $rhs
+ : (substr($lhs, 0, 1) ne '/' ? catfile($actual, $lhs) : $lhs);
+ }
+
+ # Then do path transforms
+ foreach my $xform (@XFORMS) { $F[2] =~ s/$xform->[0]/$xform->[1]/g }
+ $F[2] =~ s/$root// if $root;
+ next unless $F[2];
+
+ # Then process any excludes
+ next SPECLINE if( $Common && $F[2] =~ /$Common/ );
+ next if exclude($realpath);
+
+ # Fix up dir permissions/file ownership.
+ $F[3] = $StdDirPerm if $F[0] eq 'd';
+ ($F[4], $F[5]) = ( $StdOwn, $StdGrp )
+ unless $F[0] eq 's' or $F[0] eq 'l';
+
+ push @prototype, [ grep { defined $_ } @F ];
+ }
+}
+
+print join " " => @$_ foreach (sort { $a->[2] cmp $b->[2] } @prototype);
+
+# End of file
Modified: csw/mgar/gar/bts/gar.conf.mk
===================================================================
--- csw/mgar/gar/v2/gar.conf.mk 2012-12-04 16:19:05 UTC (rev 19812)
+++ csw/mgar/gar/bts/gar.conf.mk 2012-12-04 18:29:17 UTC (rev 19814)
@@ -116,9 +116,23 @@
# makefiles. They're also used by autoconf, and can be adapted
# for a variety of build systems.
+# The name of the system, used to parametrize several scripts and pathes
+PKG_SYSTEM ?= csw
+# This is the prefix of all packages built
+PKG_STEM ?= CSW
+# This is user to form /opt/xxx, /etc/opt/xxx and /var/opt/xxx
+PKG_SUBDIRECTORY ?= csw
+# This is the default ownership of files in the packages
+PKG_DEFAULT_USER ?= root
+PKG_DEFAULT_GROUP ?= bin
+
+# This is the prefix where the environment used to bootstrap the new world is located and how the packages are named
+BOOTSTRAP_PKG_STEM ?= CSW
+BOOTSTRAP_PREFIX ?= /opt/csw
+
# This is the general prefix for "world". Don't change it in a package and
# if you change it in .garrc keep in mind to rebuild the world from scratch.
-BUILD_PREFIX ?= /opt/csw
+BUILD_PREFIX ?= /opt/$(PKG_SUBDIRECTORY)
prefix ?= $(BUILD_PREFIX)
exec_prefix ?= $(prefix)
@@ -143,7 +157,7 @@
sourcedir ?= $(BUILD_PREFIX)/src
sharedperl ?= $(sharedstatedir)/perl
perllib ?= $(libdir)/perl
-perlcswlib ?= $(perllib)/csw
+perlcswlib ?= $(perllib)/$(PKG_SUBDIRECTORY)
perlpackroot ?= $(perlcswlib)/auto
texmfdir ?= $(sharedstatedir)/texmf
texmfconfigdir ?= $(texmfdir)-config
@@ -183,7 +197,7 @@
DESTIMG ?= $(LOGNAME)-$(shell hostname)
# A default list of packages that everyone will depend on
-COMMON_PKG_DEPENDS ?= CSWcommon
+COMMON_PKG_DEPENDS ?= $(PKG_STEM)common
# These are the core packages which must be installed for GAR to function correctly
@@ -733,7 +747,7 @@
# 2. Allow us to use programs we just built. This is a bit complicated,
# but we want PATH to be a recursive variable, or 'gmake isaenv' won't work
# /usr/openwin/bin is needed for xmkmf used in gar.lib.mk
-PATH = $(if $(filter SOS12,$(GARCOMPILER)),$(abspath $(GARBIN)/sos12-wrappers):)$(if $(IGNORE_DESTDIR),,$(abspath $(DESTDIR)$(binpath_install)/$(MM_BINDIR)):$(DESTDIR)$(binpath_install):$(abspath $(DESTDIR)$(sbinpath_install)/$(MM_BINDIR)):$(DESTDIR)$(sbinpath_install):)$(abspath $(binpath_install)/$(MM_BINDIR)):$(binpath_install):$(abspath $(sbinpath_install)/$(MM_BINDIR)):$(sbinpath_install):$(CC_HOME)/bin:$(abspath $(GARBIN)):/usr/bin:/usr/sbin:/usr/java/bin:/usr/ccs/bin:/usr/openwin/bin
+PATH = $(if $(filter SOS12,$(GARCOMPILER)),$(abspath $(GARBIN)/sos12-wrappers):)$(if $(IGNORE_DESTDIR),,$(abspath $(DESTDIR)$(binpath_install)/$(MM_BINDIR)):$(DESTDIR)$(binpath_install):$(abspath $(DESTDIR)$(sbinpath_install)/$(MM_BINDIR)):$(DESTDIR)$(sbinpath_install):)$(abspath $(binpath_install)/$(MM_BINDIR)):$(binpath_install):$(abspath $(sbinpath_install)/$(MM_BINDIR)):$(sbinpath_install):$(CC_HOME)/bin:$(abspath $(GARBIN)):$(BOOTSTRAP_PREFIX)/bin:/usr/bin:/usr/sbin:/usr/java/bin:/usr/ccs/bin:/usr/openwin/bin
# This is for foo-config chaos
PKG_CONFIG_DIRS ?= $(EXTRA_PKG_CONFIG_DIRS) $(filter-out $(libpath_install),$(libdir_install)) $(libpath_install)
Modified: csw/mgar/gar/bts/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk 2012-12-04 16:19:05 UTC (rev 19812)
+++ csw/mgar/gar/bts/gar.mk 2012-12-04 18:29:17 UTC (rev 19814)
@@ -783,6 +783,7 @@
MERGE_DIRS_$(MODULATION) ?= $(MERGE_DIRS_$(MODULATION_ISACOLLAPSED))
MERGE_SCRIPTS_isa-default ?= copy-relocate $(EXTRA_MERGE_SCRIPTS_isa-$(ISA_DEFAULT)) $(EXTRA_MERGE_SCRIPTS)
+#MERGE_SCRIPTS_isa-default64 ?= $(if $(BUILD64_ONLY),copy-relocate,copy-relocated-only copy-config-only splice-include64) $(EXTRA_MERGE_SCRIPTS_isa-$(ISA)) $(EXTRA_MERGE_SCRIPTS_isa-default64) $(EXTRA_MERGE_SCRIPTS)
MERGE_SCRIPTS_isa-default64 ?= $(if $(BUILD64_ONLY),copy-relocate,copy-relocated-only copy-config-only) $(EXTRA_MERGE_SCRIPTS_isa-$(ISA)) $(EXTRA_MERGE_SCRIPTS_isa-default64) $(EXTRA_MERGE_SCRIPTS)
MERGE_SCRIPTS_isa-extra ?= copy-relocated-only copy-config-only $(EXTRA_MERGE_SCRIPTS_isa-$(ISA)) $(EXTRA_MERGE_SCRIPTS_isa-extra) $(EXTRA_MERGE_SCRIPTS)
MERGE_SCRIPTS_$(MODULATION_ISACOLLAPSED64) ?= $(MERGE_SCRIPTS_$(MODULATION_ISACOLLAPSEDEXTRA))
@@ -964,6 +965,16 @@
)
@$(MAKECOOKIE)
+# Splice include to have conditional selection of 32 and 64 bit. This requires
+# to have the 32 bit includes already in place. The includes from 64 bit are inspected
+# if they differ, and if they do they are conditionally spliced in the standard include location.
+# Making a direct unification of 32 and 64 bit would require knowledge of install directories
+# which we don't have at this point and exclusion of include files during regular merge phases.
+merge-splice-include64:
+ $(_DBG_MERGE)(cd $(INSTALLISADIR)$(if $(ALLOW_RELOCATE),$(RELOCATE_PREFIX)); umask 022 && splice \
+ "defined __amd64 || defined __x86_64 || defined __sparcv9" ./$(includedir) $(PKGROOT)$(includedir)
+ @$(MAKECOOKIE)
+
.PHONY: remerge reset-merge reset-merge-modulated
remerge: reset-merge merge
Modified: csw/mgar/gar/bts/gar.pkg.mk
===================================================================
--- csw/mgar/gar/v2/gar.pkg.mk 2012-12-04 16:19:05 UTC (rev 19812)
+++ csw/mgar/gar/bts/gar.pkg.mk 2012-12-04 18:29:17 UTC (rev 19814)
@@ -31,13 +31,13 @@
# SRCPACKAGE is the name of the package containing the sources
ifeq ($(origin PACKAGES), undefined)
-PACKAGES = $(if $(filter %.gspec,$(DISTFILES)),,CSW$(NAME))
+PACKAGES = $(if $(filter %.gspec,$(DISTFILES)),,$(PKG_STEM)$(NAME))
CATALOGNAME ?= $(if $(filter %.gspec,$(DISTFILES)),,$(subst -,_,$(NAME)))
SRCPACKAGE_BASE = $(firstword $(basename $(filter %.gspec,$(DISTFILES))) $(PACKAGES))
SRCPACKAGE ?= $(SRCPACKAGE_BASE)-src
SPKG_SPECS ?= $(basename $(filter %.gspec,$(DISTFILES))) $(PACKAGES) $(if $(NOSOURCEPACKAGE),,$(SRCPACKAGE))
else
-CATALOGNAME ?= $(if $(filter-out $(firstword $(PACKAGES)),$(PACKAGES)),,$(subst -,_,$(patsubst CSW%,%,$(PACKAGES))))
+CATALOGNAME ?= $(if $(filter-out $(firstword $(PACKAGES)),$(PACKAGES)),,$(subst -,_,$(patsubst $(PKG_STEM)%,%,$(PACKAGES))))
SRCPACKAGE_BASE = $(firstword $(PACKAGES))
SRCPACKAGE ?= $(SRCPACKAGE_BASE)-src
OBSOLETING_PKGS ?= $(sort $(PACKAGES) $(FOREIGN_PACKAGES))
@@ -46,16 +46,16 @@
endif
# For creating default pkgnames, e.g. CSWpy-$(DASHED_NAME)
-DASHED_NAME ?= $(subst _,-,$(patsubst CSW%,%,$(NAME)))
+DASHED_NAME ?= $(subst _,-,$(patsubst $(PKG_STEM)%,%,$(NAME)))
# Automatic definitions for source package
-CATALOGNAME_$(SRCPACKAGE) ?= $(patsubst CSW%,%,$(SRCPACKAGE_BASE))_src
+CATALOGNAME_$(SRCPACKAGE) ?= $(patsubst $(PKG_STEM)%,%,$(SRCPACKAGE_BASE))_src
SPKG_DESC_$(SRCPACKAGE) ?= $(SPKG_DESC_$(SRCPACKAGE_BASE)) Source Package
ARCHALL_$(SRCPACKAGE) ?= 1
# XXX: Use Repository Root instead of fixed URL as base
GARSYSTEMVERSION ?= $(shell $(SVN) propget svn:externals $(CURDIR) | perl -ane 'if($$F[0] eq "gar") { print ($$F[1]=~m(https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/gar/(.*))),"\n";}')
-GARPKG_v1 = CSWgar-v1
-GARPKG_v2 = CSWgar-v2
+GARPKG_v1 = $(PKG_STEM)gar-v1
+GARPKG_v2 = $(PKG_STEM)gar-v2
RUNTIME_DEP_PKGS_$(SRCPACKAGE) ?= $(or $(GARPKG_$(GARSYSTEMVERSION)),$(error GAR version $(GARSYSTEMVERSION) unknown))
# Set the catalog release based on hostname. E.g. building on current9s will
@@ -69,7 +69,7 @@
define obsoleted_pkg
# function 'catalogname' must not be used due to recursive calls to CATALOGNAME_*
-CATALOGNAME_$(1) ?= $(subst -,_,$(patsubst CSW%,%,$(1)))_stub
+CATALOGNAME_$(1) ?= $(subst -,_,$(patsubst $(PKG_STEM)%,%,$(1)))_stub
# The length of the description has been limited to 100 characters,
# the string is cut (no longer on word boundaries).
SPKG_DESC_$(1) ?= $(shell echo Transitional package. Content moved to $(foreach P,$(OBSOLETING_PKGS),$(if $(filter $(1),$(OBSOLETED_BY_$P)),$P)) | perl -npe 's/(.{100}).+/substr($$1,0,96) . " ..."/e')
@@ -99,12 +99,12 @@
SRCPACKAGE_BASE = $(if $(PACKAGES),$(firstword $(PACKAGES)),$(firstword $(SPKG_SPECS)))
SRCPACKAGE ?= $(SRCPACKAGE_BASE)-src
-CATALOGNAME_$(SRCPACKAGE) ?= $(patsubst CSW%,%,$(SRCPACKAGE_BASE))_src
+CATALOGNAME_$(SRCPACKAGE) ?= $(patsubst $(PKG_STEM)%,%,$(SRCPACKAGE_BASE))_src
SPKG_DESC_$(SRCPACKAGE) ?= $(SPKG_DESC_$(SRCPACKAGE_BASE)) Source Package
ARCHALL_$(SRCPACKAGE) ?= 1
GARSYSTEMVERSION ?= $(shell $(SVN) propget svn:externals $(CURDIR) | perl -ane 'if($$F[0] eq "gar") { print ($$F[1]=~m(https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/gar/(.*))),"\n";}')
-GARPKG_v1 = CSWgar-v1
-GARPKG_v2 = CSWgar-v2
+GARPKG_v1 = $(PKG_STEM)gar-v1
+GARPKG_v2 = $(PKG_STEM)gar-v2
RUNTIME_DEP_PKGS_$(SRCPACKAGE) ?= $(or $(GARPKG_$(GARSYSTEMVERSION)),$(error GAR version $(GARSYSTEMVERSION) unknown))
# Sanity checks for r8335
@@ -148,7 +148,7 @@
$(if $(CATALOGNAME),
$(CATALOGNAME),
$(if $(filter $(1),$(PACKAGES) $(OBSOLETED_PKGS)),
- $(subst -,_,$(patsubst CSW%,%,$(1))),
+ $(subst -,_,$(patsubst $(PKG_STEM)%,%,$(1))),
$(if $(realpath files/$(1).gspec),
$(shell perl -F'\s+' -ane 'print "$$F[2]" if( $$F[0] eq "%var" && $$F[1] eq "bitname")' files/$(1).gspec),
$(error The catalog name for the package '$1' could not be determined, because it was neither in PACKAGES nor was there a gspec-file)
@@ -200,7 +200,7 @@
$(if $(filter $(GNU_MIRROR),$(MASTER_SITES)),http://www.gnu.org/software/$(GNU_PROJ)) \
$(MASTER_SITES) \
$(GIT_REPOS))
-SPKG_VENDOR ?= $(SPKG_SOURCEURL) packaged for CSW by $(SPKG_PACKAGER)
+SPKG_VENDOR ?= $(SPKG_SOURCEURL) packaged for $(PKG_STEM) by $(SPKG_PACKAGER)
SPKG_PSTAMP ?= $(LOGNAME)@$(shell hostname)-$(call _REVISION)-$(shell date '+%Y%m%d%H%M%S')
SPKG_BASEDIR ?= $(prefix)
SPKG_CLASSES ?= none
@@ -216,7 +216,7 @@
SPKG_DEPEND_DB = $(GARDIR)/csw/depend.db
-SPKG_PKGFILE ?= %{bitname}-%{SPKG_VERSION},%{SPKG_REVSTAMP}-%{SPKG_OSNAME}-%{arch}-$(or $(filter $(call _REVISION),UNCOMMITTED NOTVERSIONED NOSVN),CSW).pkg
+SPKG_PKGFILE ?= %{bitname}-%{SPKG_VERSION},%{SPKG_REVSTAMP}-%{SPKG_OSNAME}-%{arch}-$(or $(filter $(call _REVISION),UNCOMMITTED NOTVERSIONED NOSVN),$(PKG_STEM)).pkg
MIGRATECONF ?= $(strip $(foreach S,$(filter-out $(OBSOLETED_PKGS),$(SPKG_SPECS)),$(if $(or $(MIGRATE_FILES_$S),$(MIGRATE_FILES)),/etc/opt/csw/pkg/$S/cswmigrateconf)))
@@ -241,23 +241,24 @@
PHP5_EXTFILES ?= *so $(EXTRA_PHP5_EXTFILES)
# - set class for all config files
+# BTS: apache, php, templates need further consideration
_CSWCLASS_FILTER = | perl -ane '\
- $(foreach FILE,$(MIGRATECONF),$$F[1] = "cswmigrateconf" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(foreach FILE,$(SAMPLECONF:%\.CSW=%),$$F[1] = "cswcpsampleconf" if ( $$F[2] =~ m(^$(FILE)\.CSW$$) );)\
- $(foreach FILE,$(PRESERVECONF:%\.CSW=%),$$F[1] = "cswpreserveconf" if( $$F[2] =~ m(^$(FILE)\.CSW$$) );)\
- $(foreach FILE,$(ETCSERVICES),$$F[1] = "cswetcservices" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(foreach FILE,$(INETDCONF),$$F[1] = "cswinetd" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(foreach FILE,$(INITSMF),$$F[1] = "cswinitsmf" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(foreach FILE,$(ETCSHELLS),$$F[1] = "cswetcshells" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(foreach FILE,$(USERGROUP),$$F[1] = "cswusergroup" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(foreach FILE,$(CRONTABS),$$F[1] = "cswcrontab" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(if $(PYCOMPILE),$(foreach FILE,$(_PYCOMPILE_FILES),$$F[1] = "cswpycompile" if( $$F[2] =~ m(^$(FILE)$$) );))\
- $(foreach FILE,$(TEXINFO),$$F[1] = "cswtexinfo" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(foreach FILE,$(TEXHASH),$$F[1] = "cswtexhash" if( $$F[2] =~ m(^$(FILE)$$) );)\
- $(foreach FILE,$(SSLCERT),$$F[1] = "cswsslcert" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(MIGRATECONF),$$F[1] = "$(PKG_SYSTEM)migrateconf" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(SAMPLECONF:%\.CSW=%),$$F[1] = "$(PKG_SYSTEM)cpsampleconf" if ( $$F[2] =~ m(^$(FILE)\.CSW$$) );)\
+ $(foreach FILE,$(PRESERVECONF:%\.CSW=%),$$F[1] = "$(PKG_SYSTEM)preserveconf" if( $$F[2] =~ m(^$(FILE)\.CSW$$) );)\
+ $(foreach FILE,$(ETCSERVICES),$$F[1] = "$(PKG_SYSTEM)etcservices" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(INETDCONF),$$F[1] = "$(PKG_SYSTEM)inetd" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(INITSMF),$$F[1] = "$(PKG_SYSTEM)initsmf" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(ETCSHELLS),$$F[1] = "$(PKG_SYSTEM)etcshells" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(USERGROUP),$$F[1] = "$(PKG_SYSTEM)usergroup" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(CRONTABS),$$F[1] = "$(PKG_SYSTEM)crontab" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(if $(PYCOMPILE),$(foreach FILE,$(_PYCOMPILE_FILES),$$F[1] = "$(PKG_SYSTEM)pycompile" if( $$F[2] =~ m(^$(FILE)$$) );))\
+ $(foreach FILE,$(TEXINFO),$$F[1] = "$(PKG_SYSTEM)texinfo" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(TEXHASH),$$F[1] = "$(PKG_SYSTEM)texhash" if( $$F[2] =~ m(^$(FILE)$$) );)\
+ $(foreach FILE,$(SSLCERT),$$F[1] = "$(PKG_SYSTEM)sslcert" if( $$F[2] =~ m(^$(FILE)$$) );)\
$(if $(AP2_MODS), at F = ("e", "build", $$F[2], "?", "?", "?") if ($$F[2] =~ m(^/opt/csw/apache2/ap2mod/.*));) \
$(if $(PHP5_EXT), at F = ("e", "build", $$F[2], "?", "?", "?") if ($$F[2] =~ m(^/opt/csw/php5/extensions/.*));) \
- $$F[1] = "cswcptemplates" if( $$F[2] =~ m(^/opt/csw/etc/templates/.+$$) and $$F[0] eq "f" ); \
+ $$F[1] = "$(PKG_SYSTEM)cptemplates" if( $$F[2] =~ m(^/opt/csw/etc/templates/.+$$) and $$F[0] eq "f" ); \
print join(" ", at F),"\n";'
# If you add another filter above, also add the class to this list. It is used
@@ -294,7 +295,7 @@
# Make sure the configuration files always have a .CSW suffix and rename the
# configuration files to this if necessary during merge.
-_EXTRA_PAX_ARGS += $(foreach FILE,$(SAMPLECONF:%\.CSW=%) $(PRESERVECONF:%\.CSW=%),-s ",^\.\($(FILE)\)$$,.\1\.CSW,p")
+_EXTRA_PAX_ARGS += $(foreach FILE,$(SAMPLECONF:%\.$(PKG_STEM)=%) $(PRESERVECONF:%\.$(PKG_STEM)=%),-s ",^\.\($(FILE)\)$$,.\1\.$(PKG_STEM),p")
PKGGET_DESTDIR ?=
@@ -556,9 +557,9 @@
# actually matching the _TEXINFO_FILTER. This is done at the prototype-level.
$(WORKDIR)/%.depend: $(WORKDIR)/$*.prototype
$(WORKDIR)/%.depend: _EXTRA_GAR_PKGS += $(_CATEGORY_RUNTIME_DEP_PKGS)
-$(WORKDIR)/%.depend: _EXTRA_GAR_PKGS += $(if $(strip $(shell cat $(WORKDIR)/$*.prototype | perl -ane '$(foreach I,$(ISAEXEC_FILES),print "yes" if( $$F[2] =~ m(^\Q$I\E(=.*)?$$));)')),CSWisaexec)
-$(WORKDIR)/%.depend: _EXTRA_GAR_PKGS += $(if $(strip $(shell cat $(WORKDIR)/$*.prototype | perl -ane 'print "yes" if( $$F[1] eq "cswalternatives")')),CSWalternatives)
-$(WORKDIR)/%.depend: _EXTRA_GAR_PKGS += $(foreach P,$(strip $(shell cat $(WORKDIR)/$*.prototype | perl -ane '$(foreach C,$(filter-out ugfiles,$(_CSWCLASSES)),print "$C " if( $$F[1] eq "$C");)')),CSWcas-$(subst csw,,$(P)))
+$(WORKDIR)/%.depend: _EXTRA_GAR_PKGS += $(if $(strip $(shell cat $(WORKDIR)/$*.prototype | perl -ane '$(foreach I,$(ISAEXEC_FILES),print "yes" if( $$F[2] =~ m(^\Q$I\E(=.*)?$$));)')),$(PKG_STEM)isaexec)
+$(WORKDIR)/%.depend: _EXTRA_GAR_PKGS += $(if $(strip $(shell cat $(WORKDIR)/$*.prototype | perl -ane 'print "yes" if( $$F[1] eq "cswalternatives")')),$(PKG_STEM)alternatives)
+$(WORKDIR)/%.depend: _EXTRA_GAR_PKGS += $(foreach P,$(strip $(shell cat $(WORKDIR)/$*.prototype | perl -ane '$(foreach C,$(filter-out ugfiles,$(_CSWCLASSES)),print "$C " if( $$F[1] eq "$C");)')),$(PKG_STEM)cas-$(subst csw,,$(P)))
$(WORKDIR)/%.depend: _DEP_PKGS=$(or $(RUNTIME_DEP_PKGS_ONLY_$*),$(RUNTIME_DEP_PKGS_ONLY),$(sort $(_EXTRA_GAR_PKGS)) $(or $(RUNTIME_DEP_PKGS_$*),$(RUNTIME_DEP_PKGS),$(DEP_PKGS_$*),$(DEP_PKGS)))
$(WORKDIR)/%.depend: $(WORKDIR)
# The final "true" is for packages without dependencies to make the shell happy as "( )" is not allowed.
@@ -757,9 +758,9 @@
@rm -f $(COOKIEDIR)/merge-license $(foreach SPEC,$(_PKG_SPECS),$(COOKIEDIR)/merge-license-$(SPEC))
merge-README.CSW: $(WORKDIR)
- $(_DBG)if test -f $(WORKDIR)/README.CSW; then \
+ $(_DBG)if test -f $(WORKDIR)/README.$(PKG_STEM); then \
$(foreach P,$(_PKG_SPECS),mkdir -p $(PKGROOT)$(docdir)/$(call catalogname,$P);) \
- $(foreach P,$(_PKG_SPECS),cp $(WORKDIR)/README.CSW $(PKGROOT)$(docdir)/$(call catalogname,$P)/README.CSW;) \
+ $(foreach P,$(_PKG_SPECS),cp $(WORKDIR)/README.$(PKG_STEM) $(PKGROOT)$(docdir)/$(call catalogname,$P)/README.$(PKG_STEM);) \
merge-distfile-%: $(DOWNLOADDIR)
$(_DBG_MERGE)if test -f $(DOWNLOADDIR)/$*; then \
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