Last change
on this file since 29546 was 29546, checked in by Jeremy Symon, 9 years ago |
Arch package now automatically sets the owner of the web directory to the tomcat user. The functionality is also implemented for the other package managers, but not yet tested.
|
File size:
1.0 KB
|
Line | |
---|
1 | package Greenstone::Package::_rpm;
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 | use warnings;
|
---|
5 | use utf8;
|
---|
6 | use parent 'Greenstone::Package';
|
---|
7 |
|
---|
8 | sub replacement_array {
|
---|
9 | my $self = shift;
|
---|
10 | my $array = shift;
|
---|
11 | return join ", ", @{$array};
|
---|
12 | }
|
---|
13 |
|
---|
14 | sub write_function {
|
---|
15 | my ($name, @lines) = @_;
|
---|
16 | my $ret = "";
|
---|
17 | $ret .= "%" . $name . "\n";
|
---|
18 | for my $line (@lines) {
|
---|
19 | $ret .= $line . "\n";
|
---|
20 | }
|
---|
21 | $ret .= "\n";
|
---|
22 | return $ret;
|
---|
23 | }
|
---|
24 |
|
---|
25 | sub add_install {
|
---|
26 | my $self = shift;
|
---|
27 | $self->{config}->{INSTALL} = "";
|
---|
28 | exists $self->{config}->{PRE_INSTALL} and
|
---|
29 | $self->{config}->{INSTALL} .= write_function "pre", @{$self->{config}->{PRE_INSTALL}};
|
---|
30 | exists $self->{config}->{POST_INSTALL} and
|
---|
31 | $self->{config}->{INSTALL} .= write_function "post", @{$self->{config}->{POST_INSTALL}};
|
---|
32 | exists $self->{config}->{PRE_REMOVE} and
|
---|
33 | $self->{config}->{INSTALL} .= write_function "preun", @{$self->{config}->{PRE_INSTALL}};
|
---|
34 | exists $self->{config}->{POST_REMOVE} and
|
---|
35 | $self->{config}->{INSTALL} .= write_function "postun", @{$self->{config}->{POST_INSTALL}};
|
---|
36 | }
|
---|
37 |
|
---|
38 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.