-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.PL
More file actions
104 lines (85 loc) · 2.76 KB
/
Build.PL
File metadata and controls
104 lines (85 loc) · 2.76 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
use 5.006;
use strict;
use warnings;
use Module::Build;
$ENV{'PERL_MB_OPT'} = '--install-base=/usr'; # I could not make this work via the parameters below :/
$ENV{'DEB_BUILD_OPTIONS'}='nocheck';
use lib '../tm2_base/lib';
use lib '../templescript/lib';
my $debian = Module::Build->subclass(
class => "Module::Build::Debian",
code => <<'SUBCLASS' );
sub DEBVERSION {
return 3;
}
sub ACTION_cpan_upload {
my $self = shift;
$self->depends_on("dist");
my $version = $self->dist_version;
$self->do_system(qq{ cpan-upload TM2::SSH-${version}.tar.gz } );
}
sub ACTION_README {
my $self = shift;
$self->do_system(qq{ pod2readme -f markdown lib/TM2/SSH.pm } );
}
sub ACTION_debian {
my $self = shift;
$self->depends_on("README");
$self->depends_on("dist");
$self->depends_on("distdir");
my $version = $self->dist_version;
my $debversion = $self->DEBVERSION;
$self->do_system(qq{DEB_BUILD_OPTIONS=nocheck dh-make-perl --build --version=$version-$debversion TM2-SSH-$version } );
}
sub ACTION_inject {
my $self = shift;
$self->depends_on("debian");
my $version = $self->dist_version;
my $debversion = $self->DEBVERSION;
$self->do_system(qq{ scp libtm2-ssh-perl_${version}-${debversion}_all.deb packages.devc.at:packages/ } );
foreach (qw(stretch) ) { # squeeze wheezy jessie
$self->do_system(qq{ ssh packages.devc.at -Y -t reprepro --ask-passphrase -b /var/www/packages/data/dists/ includedeb $_ packages/libtm2-ssh-perl_${version}-${debversion}_all.deb })
;
}
}
SUBCLASS
unless (defined getpwnam('po') ) {
warn "for testing we need a user 'po'";
print "
\$ sudo adduser po
\$ sudo mkdir ~po/.ssh/
\$ sudo cp t/po_rsa.pub ~po/.ssh/authorized_keys
\$ sudo chown po:po ~po/.ssh/authorized_keys
\$ sudo chmod 600 ~po/.ssh/authorized_keys
\$ sudo cp t/po.sudo /etc/sudoers.d/tm2-ssh-test-user
";
}
my $builder = $debian->new(
module_name => 'TM2::SSH',
license => 'artistic_2',
dist_author => q{Robert Barta <rho@devc.at>},
dist_version_from => 'lib/TM2/SSH.pm',
release_status => 'stable',
configure_requires => {
'Module::Build' => '0',
},
build_requires => {
'Test::More' => 0,
'Pod::Readme' => 0,
'List::Util' => 0,
},
requires => {
'TM2::TempleScript' => 0,
'IPC::PerlSSH::Async' => 0,
},
add_to_cleanup => [ 'TM2-SSH-*' ],
install_base => '/usr',
install_path => { 'ontologies' => '/usr/share/templescript/ontologies',
},
onto_files => {
'ontologies/ssh.ts' => 'ontologies/ssh.ts',
'ontologies/ssh-bg.atm' => 'ontologies/ssh-bg.atm'
},
);
$builder->add_build_element('onto');
$builder->create_build_script();