-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfoomatic-test-build.in
executable file
·56 lines (45 loc) · 1.32 KB
/
foomatic-test-build.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!@PERL@
# -*- perl -*-
# Automated build script for rapid development
# To use first do a manual build in a directory other than
# foomatic-db-engine-test-build
# then run this script.
use Foomatic::Defaults;
use File::Basename;
use strict;
use warnings;
use Getopt::Long;
my $now = time;
my $parent = '../';
my $source = 'foomatic-db-engine/';
my $dest = "foomatic-db-engine-test-build/";
my $show_help = 0;
GetOptions('help' => \$show_help,
'source' => \$source,
'destination' => \$dest);
if ($show_help) {
print STDERR "
Usage: foomatic-test-build.pl [ -s source_directory -d build_destination ]
source_directory: The directory with the source code we want
to build. Defaults to foomatic-db-engine
build_destination: The destination directory for the test
build. Relative to the parent of foomatic-db-engine
source folder.
Example:
foomatic-test-build.pl -s 'foomatic-db-engine/' -d 'foomatic-db-engine-test-build/'
";
exit(1);
}
# Let's make our soup #
print(`(cd $parent
mkdir $dest
cp -R $source/* $dest
cd $dest
./make_configure
./configure
make inplace) 2>&1`);
# Print buildtime #
$now = time - $now;
printf("\n-------------\nBuild time: %02d:%02d:%02d\n\n",
int($now / 3600), int(($now % 3600) / 60),
int($now % 60));