summaryrefslogtreecommitdiff
path: root/infrastructure/BoxPlatform.pm.in
diff options
context:
space:
mode:
Diffstat (limited to 'infrastructure/BoxPlatform.pm.in')
-rw-r--r--infrastructure/BoxPlatform.pm.in50
1 files changed, 35 insertions, 15 deletions
diff --git a/infrastructure/BoxPlatform.pm.in b/infrastructure/BoxPlatform.pm.in
index d2510627..8657134e 100644
--- a/infrastructure/BoxPlatform.pm.in
+++ b/infrastructure/BoxPlatform.pm.in
@@ -5,7 +5,6 @@ use Exporter;
BEGIN
{
-
# which OS are we building under?
$target_os = '@target_os@';
$target_windows = 0;
@@ -32,27 +31,23 @@ BEGIN
$build_os ne "SunOS" && $build_os ne 'GNU/kFreeBSD');
# blank extra flags by default
- $platform_compile_line_extra = '@CPPFLAGS@ @CXXFLAGS@ @CXXFLAGS_STRICT@';
- $platform_compile_line_extra =~ s/ -O2//;
- $platform_link_line_extra = '@LDFLAGS@';
+ $platform_compile_line_extra = '';
+ $platform_link_line_extra = '';
$platform_lib_files = '@LIBS@';
$platform_exe_ext = '@EXEEXT@';
# get version
- if (! -r "VERSION.txt" and -r "../../VERSION.txt")
- {
- open VERSION,"../../VERSION.txt" or die "../../VERSION.txt: $!";
- }
- else
- {
- open VERSION,"VERSION.txt" or die "VERSION.txt: $!";
- }
+ my $version_file = "VERSION.txt";
+ if (not -r $version_file) { $version_file = "../../$version_file" }
+ die "missing version file: $version_file" unless $version_file;
+ open VERSION, $version_file or die "$version_file: $!";
$product_version = <VERSION>;
chomp $product_version;
$product_name = <VERSION>;
chomp $product_name;
close VERSION;
+
if($product_version =~ /USE_SVN_VERSION/)
{
# for developers, use SVN version
@@ -69,14 +64,23 @@ BEGIN
}
}
close INFO;
- $svnurl =~ m!box/(.+)$!;
- my $svndir = $1;
+
+ my $svndir;
+ if ($svnurl =~ m!/box/(.+)$!)
+ {
+ $svndir = $1;
+ }
+ elsif ($svnurl =~ m'/(boxi/.+)/boxi/boxbackup')
+ {
+ $svndir = $1;
+ }
+
$svndir =~ tr/0-9A-Za-z/_/c;
$product_version =~ s/USE_SVN_VERSION/$svndir.'_'.$svnversion/e;
}
# where to put the files
- $install_into_dir = '@bindir_expanded@';
+ $install_into_dir = '@sbindir_expanded@';
# if it's Darwin,
if($build_os eq 'Darwin')
@@ -108,5 +112,21 @@ sub make_flag
return $_[0].'=1';
}
+sub parcel_root
+{
+ my $tos = $_[1] || $target_os;
+ return $product_name.'-'.$product_version.'-'.$_[0].'-'.$tos;
+}
+
+sub parcel_dir
+{
+ 'parcels/'.parcel_root($_[0], $_[1])
+}
+
+sub parcel_target
+{
+ parcel_dir($_[0]).'.tgz'
+}
+
1;