[svk-commit] r2457 - in branches/i18n-fixes: . pkg
nobody at bestpractical.com
nobody at bestpractical.com
Mon Jul 16 05:23:53 EDT 2007
Author: clkao
Date: Mon Jul 16 05:23:48 2007
New Revision: 2457
Modified:
branches/i18n-fixes/ (props changed)
branches/i18n-fixes/pkg/buildsvk.pl
branches/i18n-fixes/pkg/win32/paroptions.txt
branches/i18n-fixes/pkg/win32/svk.nsi
Log:
merge down for i18n fixes branch.
Modified: branches/i18n-fixes/pkg/buildsvk.pl
==============================================================================
--- branches/i18n-fixes/pkg/buildsvk.pl (original)
+++ branches/i18n-fixes/pkg/buildsvk.pl Mon Jul 16 05:23:48 2007
@@ -3,10 +3,11 @@
use strict;
use warnings;
use Cwd 'abs_path';
-use File::Copy 'move';
use File::Spec;
+
+
=head1 NAME
buildsvk.pl - packaging svk
@@ -23,7 +24,6 @@
=cut
my $build = SVK::Build->new;
-
my $t = time();
$build->prepare_perl();
@@ -36,15 +36,16 @@
$build->build_module($_) for qw(File-chdir SVN-Mirror);
$build->build_module($_) for qw(FreezeThaw);
-if (shift) {
- $build->perlmake_install("..");
- $build->prepare_dist("..");
+my $svkroot = shift;
+if ($svkroot) {
+ $build->perlmake_install($svkroot);
}
else {
$build->build_module('SVK');
- $build->prepare_dist(glob($build->build_dir.'/SVK-*'));
+ ($svkroot) = glob($build->build_dir.'/SVK-*');
}
+$build->prepare_dist($svkroot);
warn 'build finished - '.(time() - $t);
@@ -52,10 +53,14 @@
package SVK::Build;
use Archive::Extract;
+ use Archive::Tar;
use Env::Path;
use File::Path (qw(mkpath rmtree));
use File::chdir;
use File::Copy 'copy';
+use File::Temp 'tempdir';
+
+our $BUILD_BASE;
sub prepare_perl { 1 };
sub prepare_svn_core {
@@ -71,11 +76,11 @@
}
sub build_dir {
- '/tmp/svk-build/dest';
+ shift->build_base ."/dest";
}
sub build_base {
- '/tmp/svk-build';
+ $BUILD_BASE ||= tempdir();
}
sub prepare_build_dir {
@@ -87,6 +92,8 @@
my $class = shift;
if ($^O eq 'MSWin32') {
$class .= '::Win32';
+ } elsif ($^O eq 'darwin') {
+ $class .= "::Darwin";
}
my $self = bless {}, $class;
@@ -118,7 +125,6 @@
$self->extract($file);
($dir) = glob($self->build_base."/$module-*");
- $dir .= "/$subdir" if $subdir;
$self->perlmake_install( $subdir ? "$dir/$subdir" : $dir );
}
@@ -153,7 +159,7 @@
copy('svk-wrapper' => $self->build_dir."/svk");
chmod 0755, $self->build_dir."/svk";
- open my $fh, "$toplevel/MANIFEST" or die $!;
+ open my $fh, "$toplevel/MANIFEST" or die "Could not create $toplevel/MANIFEST: ".$!;
while (<$fh>) {
chomp;
next unless m{^t/};
@@ -165,12 +171,50 @@
copy('maketest' => $self->build_dir."/maketest");
chmod 0755, $self->build_dir."/maketest";
+
+ my $version = $self->get_svk_version($toplevel);
+
+ rename($self->build_dir => $self->build_base.'/svk-'.$version);
+
+ $self->build_archive( 'svk-'.$version);
+
+
+}
+
+sub get_svk_version {
+ my ($self, $toplevel) = @_;
+ my $version = eval {
+ local @INC = @INC; unshift @INC, "$toplevel/lib"; require SVK::Version;
+ SVK->VERSION;
+ };
+
+}
+
+sub build_archive {
+ my $self = shift;
+ my $path = shift;
+ my $olddir = $CWD;
+ {
+ local $CWD = $self->build_base;
+ warn "In ".$self->build_base . " looking for ". $path;
+ my @cmd = ( 'tar', 'czvf' , "$olddir/$path.tgz", $path);
+ system( @cmd);
+ if ($!) { die "Failed to create tarball: ". $! . join (' ', at cmd);}
+ }
+ if (-f "$path.tgz" ) {
+
+ print "Congratulations! You have a new build of $path in ".$olddir."/".$path.".tgz\n";
+ } else {
+ warn "Couldn't build ".$self->build_base."/$path into a tarball\n";
+ }
}
package SVK::Build::Win32;
use base 'SVK::Build';
use Cwd 'abs_path';
+use File::Path (qw(rmtree));
use File::Spec;
+use File::Copy 'move';
sub build_dir {
'c:/tmp/svk-build';
@@ -188,13 +232,19 @@
sub make { 'dmake' }
+sub perlmake_install {
+ my $self = shift;
+ local %ENV = %ENV;
+ Env::Path->PATH->Assign( map { abs_path(File::Spec->catfile($self->build_dir, 'strawberry-perl', $_, 'bin')) } qw(perl dmake mingw));
+ return $self->SUPER::perlmake_install(@_);
+}
+
sub perldest {
- abs_path(File::Spec->catfile($_[0]->build_dir, qw(strawberry-perl perl lib)));
+ File::Spec->catdir(abs_path($_[0]->build_dir), qw(strawberry-perl perl lib));
}
sub prepare_perl {
my $self = shift;
- Env::Path->PATH->Assign( map { abs_path(File::Spec->catfile($self->build_dir, 'strawberry-perl', $_, 'bin')) } qw(perl dmake mingw));
if (-d $self->perldest) {
warn "found strawberry perl, remove ".$self->perldest." for clean build.\n";
@@ -225,5 +275,64 @@
}
sub prepare_dist {
+ my $self = shift;
+ my $toplevel = shift;
+ my @paroptions;
+ open my $fh, 'win32/paroptions.txt' or die $!;
+ while (<$fh>) { next if m/^#/; chomp; push @paroptions, split(/ /,$_) };
+ push @paroptions,
+ -a => "$toplevel/lib/SVK/Help;lib/SVK/Help",
+ -a => "$toplevel/lib/SVK/I18N;lib/SVK/I18N",
+ -a => $self->perldest."/auto/POSIX;lib/auto/POSIX",
+ -I => "$toplevel/lib",
+ -I => $self->perldest,
+ (map { (-a => File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'bin', $_).";bin/$_") }
+ qw(perl.exe perl58.dll prove.bat intl3_svn.dll libapr.dll libapriconv.dll libaprutil.dll libdb44.dll libeay32.dll ssleay32.dll) ),
+ -a => "$toplevel/blib/script/svk;bin/svk",
+ -a => "$toplevel/blib/script/svk.bat;bin/svk.bat",
+ -a => "$toplevel/pkg/win32/maketest.bat;win32/maketest.bat",
+ -a => "$toplevel/pkg/win32/svk.ico;win32/svk.ico",
+ -a => "$toplevel/pkg/win32/svk-uninstall.ico;win32/svk-uninstall.ico",
+ -a => "$toplevel/pkg/win32/svk.nsi;win32/svk.nsi",
+ -a => "$toplevel/pkg/win32/Path.nsh;win32/Path.nsh",
+ -a => "$toplevel/contrib;site/contrib",
+ -a => "$toplevel/utils;site/utils",
+ -a => "$toplevel/t;site/t",
+ -a => "$toplevel/README;README",
+ -a => "$toplevel/CHANGES;CHANGES",
+ -a => "$toplevel/ARTISTIC;ARTISTIC",
+ -a => "$toplevel/COPYING;COPYING";
+
+
+ rmtree ['build'] if -d 'build';
+ mkdir('build');
+ system('pp', @paroptions, "$toplevel/blib/script/svk");
+
+ system('zip', qw(-d build\SVK.par lib\SVK));
+ system('zip', qw(-d build\t\checkout lib\SVK));
+ system('unzip', qw(-o -d build build/SVK.par));
+ $self->build_archive($self->get_svk_version($toplevel));
+}
+
+sub build_archive {
+ my ($self, $version) = @_;
+ Env::Path->PATH->Prepend("C:/Program Files/NSIS");
+ system('makensis', "/X !define MUI_VERSION $version", 'build/win32/svk.nsi');
}
+
+
+package SVK::Build::Darwin;
+use base 'SVK::Build';
+use File::Copy 'copy';
+sub prepare_svn_core {
+ my $self = shift;
+ my $output = `otool -L \`which svn\``;
+ for ($output =~ m/^.*$/mg) {
+ my ($lib) = m/^\s*(.*?)\s/ or next;
+ next if $lib =~ /^\/(?:System|usr\/lib)/;
+ warn $lib;
+ copy($lib, $self->build_dir);
+ }
+}
+
Modified: branches/i18n-fixes/pkg/win32/paroptions.txt
==============================================================================
--- branches/i18n-fixes/pkg/win32/paroptions.txt (original)
+++ branches/i18n-fixes/pkg/win32/paroptions.txt Mon Jul 16 05:23:48 2007
@@ -12,7 +12,11 @@
# create a log
-L pp.log
# include some missed modules
+-M Log::Log4perl::Appender::Screen
-M Encode::TW
+-M Encode::JP
+-M Encode::KR
+-M Encode::CN
-M POSIX
# exclude some not-needed dependencies
-X ExtUtils::CBuilder
Modified: branches/i18n-fixes/pkg/win32/svk.nsi
==============================================================================
--- branches/i18n-fixes/pkg/win32/svk.nsi (original)
+++ branches/i18n-fixes/pkg/win32/svk.nsi Mon Jul 16 05:23:48 2007
@@ -2,13 +2,16 @@
!define MUI_COMPANY "Best Practical Solutions, LLC"
!define MUI_PRODUCT "SVK"
-!define MUI_VERSION "2.0.1-1"
+!ifndef MUI_VERSION
+!define MUI_VERSION "unknown"
+!endif
!define MUI_NAME "svk"
!define MUI_ICON "${MUI_NAME}.ico"
!define MUI_UNICON "${MUI_NAME}-uninstall.ico"
!include "MUI.nsh"
!include "Path.nsh"
+
!include "Library.nsh"
XPStyle On
@@ -17,14 +20,13 @@
InstallDir "$PROGRAMFILES\${MUI_NAME}"
ShowInstDetails hide
InstProgressFlags smooth
-Var ALREADY_INSTALLED
!define MUI_ABORTWARNING
;--------------------------------
;Pages
- !insertmacro MUI_PAGE_LICENSE "License.txt"
+ !insertmacro MUI_PAGE_LICENSE "..\ARTISTIC"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
@@ -60,10 +62,6 @@
WriteUninstaller "$INSTDIR\Uninstall.exe"
-new_installation:
-
- !insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "shared\msvcr71.dll" "$SYSDIR\msvcr71.dll" $SYSDIR
-
Libeay32:
IfFileExists "$SYSDIR\libeay32.dll" RenameLibeay32 SSLeay32
RenameLibeay32:
@@ -80,10 +78,10 @@
Push "$INSTDIR\bin"
Call AddToPath
SectionEnd
-
+
Section "Uninstall"
- Push $INSTDIR
- Call un.RemoveFromPath
- RMDir /r $INSTDIR
- DeleteRegKey HKLM "SOFTWARE\${MUI_COMPANY}\${MUI_PRODUCT}"
+ Push $INSTDIR
+ Call un.RemoveFromPath
+ RMDir /r $INSTDIR
+ DeleteRegKey HKLM "SOFTWARE\${MUI_COMPANY}\${MUI_PRODUCT}"
SectionEnd
More information about the svk-commit
mailing list