source: main/trunk/package-kits/linux/perllib/Greenstone/Package/_apt.pm@ 29550

Last change on this file since 29550 was 29550, checked in by Jeremy Symon, 9 years ago

Ubuntu works

File size: 1018 bytes
Line 
1package Greenstone::Package::_apt;
2
3use strict;
4use warnings;
5use utf8;
6use parent 'Greenstone::Package';
7
8sub replacement_array {
9 my $self = shift;
10 my $array = shift;
11 return join ", ", @{$array};
12}
13
14sub write_function {
15 my ($self, $name, @lines) = @_;
16 open OUT, '>', "/tmp/$name";
17 for my $line (@lines) {
18 print OUT $line, "\n";
19 }
20 close OUT;
21 chmod 0755, "/tmp/$name";
22 $self->add ("/tmp/$name", "$self->{output}/debian/$name");
23}
24
25sub add_install {
26 my $self = shift;
27 exists $self->{config}->{PRE_INSTALL} and
28 $self->write_function ("preinst", @{$self->{config}->{PRE_INSTALL}});
29 exists $self->{config}->{POST_INSTALL} and
30 $self->write_function ("postinst", @{$self->{config}->{POST_INSTALL}});
31 exists $self->{config}->{PRE_REMOVE} and
32 $self->write_function ("prerm", @{$self->{config}->{PRE_REMOVE}});
33 exists $self->{config}->{POST_REMOVE} and
34 $self->write_function ("postrm", @{$self->{config}->{POST_REMOVE}});
35}
36
371;
Note: See TracBrowser for help on using the repository browser.