-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2004.pm
More file actions
231 lines (201 loc) · 7.3 KB
/
Copy path2004.pm
File metadata and controls
231 lines (201 loc) · 7.3 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# Package for distribution ubuntu version 20.04
package ubuntu::2004;
use base qw(blankdistro);
use strict;
use warnings;
use WeBWorK::Install::Utils;
# This is a list of WeBWorK versions for which the installer has
# been verified to work for this distro.
my $ww_versions = ['2.13'];
sub get_ww_versions {
return $ww_versions;
}
# A list of packages for various binaries that we need.
my $binary_prerequisites = {
mkdir => 'coreutils',
mv => 'coreutils',
gcc => 'gcc',
make => 'make',
tar => 'tar',
gzip => 'gzip',
unzip => 'unzip',
dvipng => 'dvipng',
curl => 'curl',
perl => 'perl',
netpbm => 'netpbm', #provides giftopnm, ppmtopgm, pnmtops, pnmtopng,
#and pgntopnm
git => 'git',
svn => 'subversion',
cpanminus => 'cpanminus',
mysql => 'mysql-client',
mysql_server => 'mysql-server',
ssh_server => 'openssh-server',
apache2 => 'apache2',
mod_mpm => 'apache2',
mod_fcgid => 'libapache2-mod-fcgid',
mod_perl => 'libapache2-mod-perl2',
mod_apreq => 'libapache2-mod-apreq2',
preview_latex => 'preview-latex-style',
texlive => 'texlive-latex-base',
texlive_recommended => 'texlive-latex-recommended',
texlive_extra => 'texlive-latex-extra',
texlive_fonts_recommended => 'texlive-fonts-recommended',
};
sub get_binary_prerequisites {
return $binary_prerequisites;
}
# A list of perl modules that we need
my $perl_prerequisites = {
'Apache2::Request' => 'libapache2-request-perl',
'Apache2::Cookie' => 'libapache2-request-perl',
'Apache2::ServerRec' => 'libapache2-mod-perl2',
'Apache2::ServerUtil' => 'libapache2-mod-perl2',
'Array::Utils' => 'CPAN',
'Benchmark' => 'perl-modules',
'Carp' => 'perl-base',
'CGI' => 'perl-modules',
'Crypt::SSLeay' => 'libcrypt-ssleay-perl',
'Dancer' => 'libdancer-perl',
'Dancer::Plugin::Database' => 'libdancer-plugin-database-perl',
'Data::Dump' => 'libdata-dump-perl',
'Data::Dumper' => 'perl',
'Data::UUID' => 'libossp-uuid-perl',
'Date::Format' => 'libtimedate-perl',
'Date::Parse' => 'libtimedate-perl',
'DateTime' => 'libdatetime-perl',
'DBD::mysql' => 'libdbd-mysql-perl',
'DBI' => 'libdbi-perl',
'Digest::MD5' => 'perl',
'Email::Address' => 'libemail-sender-perl',
'Email::Simple' => 'libemail-simple-perl',
'Email::Sender::Simple' => 'libemail-sender-perl',
'Email::Sender::Transport::SMTP' => 'libemail-sender-perl',
'Errno' => 'perl-base',
'Exception::Class' => 'libexception-class-perl',
'ExtUtils::XSBuilder' => 'libextutils-xsbuilder-perl',
'File::Copy' => 'perl-modules',
'File::Find' => 'perl-modules',
'File::Find::Rule' => 'libfile-find-rule-perl',
'File::Path' => 'perl-modules',
'File::Spec' => 'perl-modules',
'File::stat' => 'perl-modules',
'File::Temp' => 'perl-modules',
'GD' => 'libgd-gd2-perl',
'Getopt::Long' => 'perl-base',
'Getopt::Std' => 'perl-modules',
'HTML::Entities' => 'libhtml-parser-perl',
'HTML::Scrubber' => 'libhtml-scrubber-perl',
'HTML::Tagset' => 'libhtml-tagset-perl',
'HTML::Template' => 'libhtml-template-perl',
'IO::File' => 'libio-file-withpath-perl',
'Iterator' => 'CPAN',
'Iterator::Util' => 'CPAN',
'JSON' => 'libjson-perl',
'Locale::Maketext::Lexicon' => 'liblocale-maketext-lexicon-perl',
'Locale::Maketext::Simple' => 'perl-modules',
'LWP::Protocol::https' => 'liblwp-protocol-https-perl',
'MIME::Base64' => 'libmime-tools-perl',
'Net::IP' => 'libnet-ip-perl',
'Net::LDAPS' => 'libnet-ldap-perl',
'Net::OAuth' => 'libnet-oauth-perl',
'Net::SMTP' => 'perl-modules',
'Opcode' => 'perl',
'PadWalker' => 'libpadwalker-perl',
'Path::Class' => 'CPAN',
'PHP::Serialization' => 'libphp-serialization-perl',
'Pod::Usage' => 'perl-modules',
'Pod::WSDL' => 'libpod-wsdl-perl',
'Safe' => 'perl-modules',
'Scalar::Util' => 'perl-base',
'SOAP::Lite' => 'libsoap-lite-perl',
'Socket' => 'perl-base',
'SQL::Abstract' => 'libsql-abstract-perl',
'Statistics::R::IO' => 'CPAN',
'String::ShellQuote' => 'libstring-shellquote-perl',
'Template' => 'libtemplate-perl',
'Text::CSV' => 'libtext-csv-perl',
'Text::Wrap' => 'perl-base',
'Tie::IxHash' => 'libtie-ixhash-perl',
'Time::HiRes' => 'perl',
'Time::Zone' => 'libtimedate-perl',
'URI::Escape' => 'liburi-perl',
'UUID::Tiny' => 'libuuid-tiny-perl',
'XML::Parser' => 'libxml-parser-perl',
'XML::Parser::EasyTree' => 'CPAN',
'XML::Writer' => 'libxml-writer-perl',
'XMLRPC::Lite' => 'libsoap-lite-perl',
'YAML' => 'libyaml-perl'
};
sub get_perl_prerequisites {
return $perl_prerequisites;
}
# A hash containing information about the apache webserver
my $apacheLayout = {
MPMDir => '',
MPMConfFile => '/etc/apache2/mods-available/mpm_prefork.conf',
ServerRoot => '/etc/apache2',
DocumentRoot => '/var/www',
ConfigFile => '/etc/apache2/apache2.conf',
OtherConfig => '/etc/apache2/conf-enabled',
SSLConfig => '',
Modules => '/etc/apache2/mods-enabled',
ErrorLog => '/var/log/apache2/error.log',
AccessLog => '/var/log/apache2/access.log',
Binary => '/usr/sbin/apache2ctl',
User => 'www-data',
Group => 'www-data',
};
sub get_apacheLayout {
return $apacheLayout;
}
# A command for updating the package sources
sub update_sources {
run_command(['sed','-i','-e','s/^# deb \(.*\) partner/deb \1 partner/','/etc/apt/sources.list']);
run_command(['sed','-i','-e','s/^# deb-src \(.*\) partner/deb-src \1 partner/','/etc/apt/sources.list']);
};
# A command for updating the system
sub update_packages {
run_command(['apt-get','-y','update']);
run_command(['apt-get','-y','upgrade']);
};
# A command for installing a package given a name
sub package_install {
my $self = shift;
my @packages = @_;
run_command(['apt-get','install','-y','--allow-unauthenticated',@packages]);
};
# A command for installing a cpan package given a name
sub CPAN_install {
my $self = shift;
my @modules = @_;
run_command(['cpanm',@modules]);
};
# A command for any distro specific stuff that needs to be done
# after installing prerequieists
sub postpreq_hook {
}
# A command for checking if the required services are running
# and configuring them
sub configure_services {
run_command(['a2enmod','apreq2']);
run_command(['a2enmod','fcgid']);
run_command(['apache2ctl', 'restart']);
}
# A command for any distro specific stuff that needs to be done
# before the webwork config process begins
sub preconfig_hook {
}
# A command for any distro specific stuff that needs to be done
# after webwork has been configured
sub postconfig_hook {
# As of the release of 2.12 the JSON::XS::Boolean package for
# ubuntu was kind of borked. So we use the PP boolean
# implementation instead by setting an environment variable.
print_and_log("Setting Perl to use JSON::PP in apache config file.\n");
die $! if system(q|sed --follow-symlinks -i 's/\$ENV{WEBWORK_ROOT} = $webwork_dir;/\$ENV{WEBWORK_ROOT} = $webwork_dir;\n$ENV{PERL_JSON_BACKEND} = '"'JSON::PP';/" /etc/apache2/conf-enabled/webwork.conf|);
}
# A comand for any distro specific stuff that needs to be done
# after webwork has been fully installed
sub postinstall_hook {
}
1;