~ubuntu-branches/ubuntu/oneiric/javatools/oneiric

« back to all changes in this revision

Viewing changes to jh_setupenvironment

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Johnson, Niels Thykier, Matthew Johnson
  • Date: 2010-03-30 00:11:37 UTC
  • mfrom: (6.1.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100330001137-ihh6lyi8omhx6dun
Tags: 0.30
[ Niels Thykier ]
* Added myself to uploaders.
* Created debhelper-like scripts for building eclipse features and
  added a dh7 sequence.
* Added Vcs-* fields.
* Replaced references to "dh_clean -k" with "dh_prep" in the tutorial.
  (Closes: #571097)
* Added DM-Upload-Allowed.
* Bumped Standards-Version to 3.8.4 - no changes required.

[ Matthew Johnson ]
* Make it a 3.0 (native) package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
=head1 NAME
 
4
 
 
5
jh_setupenvironment - Prepares a build environment to compile an eclipse feature.
 
6
 
 
7
=cut
 
8
 
 
9
use strict;
 
10
use Debian::Debhelper::Dh_Lib;
 
11
 
 
12
=head1 SYNOPSIS
 
13
 
 
14
B<jh_setupenvironment> [S<I<debhelper options>>] [B<--pde-build-dir=>I<dir>] [S<I<copy [...]>>]
 
15
 
 
16
=head1 DESCRIPTION
 
17
 
 
18
jh_setupenvironment is a javahelper program that handles creating
 
19
an environment for building an eclipse feature. It does not setup
 
20
an orbit dir (use jh_generateorbitdir for that). It will copy files
 
21
specified in debian/eclipse.environment as well as those given on
 
22
command line into the environment dir. If no files are given per
 
23
command line and the environment file is not present (or is empty),
 
24
it will default to "org.eclipse.*"
 
25
 
 
26
=head1 FILES
 
27
 
 
28
=over 4
 
29
 
 
30
=item debian/eclipse.environment
 
31
 
 
32
List of file- and directory glob patterns to copy into the build
 
33
environment.
 
34
 
 
35
=back
 
36
 
 
37
=head1 OPTIONS
 
38
 
 
39
=over 4
 
40
 
 
41
=item B<--pde-build-dir=dir>
 
42
 
 
43
Specifies where the environment should be or is placed.
 
44
 
 
45
=item B<--clean>
 
46
 
 
47
If passed, jh_setupenvironment will clean up the build environment.
 
48
When cleaning jh_setupenvironment will not record itself in the
 
49
debhelper log to avoid confusing dh, when it has to use the log
 
50
to trace where it was.
 
51
 
 
52
=back
 
53
 
 
54
=cut
 
55
 
 
56
my $builddir = undef;
 
57
my $me = basename($0);
 
58
my $clean = '';
 
59
 
 
60
init(options => {
 
61
    "pde-build-dir=s" => \$builddir,
 
62
    "clean" => sub { $clean = 1 },
 
63
});
 
64
 
 
65
$clean = 0 unless(defined($clean) and $clean ne '');
 
66
$builddir = 'debian/.eclipse-build' unless(defined($builddir));
 
67
 
 
68
# do not write to the log if we are cleaning.
 
69
inhibit_log() if($clean);
 
70
 
 
71
if($clean){
 
72
    doit("rm", "-fr", $builddir);
 
73
    # clean up after jh_generateorbitdeps - dh_clean tend to miss this file
 
74
    # because it does not "belong" to a package.
 
75
    doit("rm", "-f", "orbitdeps.debhelper");
 
76
} else{
 
77
    my $bfile = "debian/eclipse.environment";
 
78
    if( -f $bfile){
 
79
        push(@ARGV, filearray($bfile));
 
80
    }
 
81
    push(@ARGV, "org.eclipse.*") unless(scalar(@ARGV) > 0);
 
82
    doit("mkdir", "-p", $builddir);
 
83
    complex_doit("cp -far " . join(" ", @ARGV) . " $builddir");
 
84
}
 
85
 
 
86
exit(0);
 
87
 
 
88
=head1 EXAMPLE
 
89
 
 
90
  jh_setupenvironment org.eclipse.* debian/*.properties
 
91
 
 
92
Will clone all files and folders starting with "org.eclipse." and all
 
93
property files in the debian-folder and put them into the environment.
 
94
 
 
95
=head1 SEE ALSO
 
96
 
 
97
L<debhelper(7)>
 
98
 
 
99
This program is a part of javahelper and uses debhelper as backend. There are
 
100
also tutorials in /usr/share/javahelper.
 
101
 
 
102
=head1 AUTHOR
 
103
 
 
104
Niels Thykier <niels@thykier.net>
 
105
 
 
106
=head1 COPYRIGHT AND LICENSE
 
107
 
 
108
Copyright 2010 by Niels Thykier
 
109
 
 
110
This tool is free software; you may redistribute it and/or modify
 
111
it under the terms of GNU GPL 2.
 
112
 
 
113
=cut