From ed4a2745163972bf1c9f36ed823b7c365a020511 Mon Sep 17 00:00:00 2001 From: dlglin Date: Fri, 1 Nov 2019 15:46:42 -0600 Subject: [PATCH 1/3] Add support for RHEL 7.5 --- distros/redhat/75.pm | 244 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 distros/redhat/75.pm diff --git a/distros/redhat/75.pm b/distros/redhat/75.pm new file mode 100644 index 0000000..5a4a54a --- /dev/null +++ b/distros/redhat/75.pm @@ -0,0 +1,244 @@ +package redhat::75; + +use strict; +use warnings; + +use WeBWorK::Install::Utils; + +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', + patch => 'patch', + tar => 'tar', + system_config => 'system-config-services', + gzip => 'gzip', + unzip => 'coreutils', + dvipng => 'dvipng', + curl => 'curl', + perl => 'perl', + netpbm => 'netpbm', #provides giftopnm, ppmtopgm, pnmtops, pnmtopng, + netpbm_progs => 'netpbm-progs', #and pgntopnm + git => 'git', + svn => 'subversion', + + mysql => 'mariadb', + mysql_server => 'mariadb-server', + ssh_server => 'openssh-server', + + apache2 => 'httpd', + mod_mpm => 'httpd', + mod_fcgid => 'mod_fcgid', + mod_perl => 'mod_perl', + mod_apreq => 'libapreq2', + + preview_latex => 'tex-preview', + texlive => 'texlive-latex', + texlive_appendix => 'texlive-appendix', + texlive_preprint => 'texlive-preprint', + texlive_epsf => 'texlive-epsf', + }; + +sub get_binary_prerequisites { + return $binary_prerequisites; +} + +# A list of perl modules that we need +my $perl_prerequisites = { + 'Test::XML' => 'perl-Test-XML', # needed in centos 7 for cpan installs + 'Test::Simple' => 'perl-Test-Simple', + 'Test::Requires' => 'perl-Test-Requires', + 'Test::TCP' => 'perl-Test-TCP', + 'HTTP::Tiny' => 'perl-HTTP-Tiny', + 'Plack' => 'perl-Plack', + 'Apache2::Request' => 'perl-libapreq2', + 'Apache2::Cookie' => 'perl-libapreq2', + 'Apache2::ServerRec' => 'mod_perl', + 'Apache2::ServerUtil' => 'mod_perl', + 'Array::Utils' => 'CPAN', + 'Benchmark' => 'perl', + 'Carp' => 'perl', + 'CGI' => 'perl-CGI', + 'CPAN' => 'perl-CPAN', + 'CPANMinus' => 'perl-App-cpanminus', + 'Crypt::SSLeay' => 'perl-Crypt-SSLeay', + 'Dancer' => 'CPAN', + 'Dancer::Plugin::Database' => 'CPAN', + 'Data::Dump' => 'perl-Data-Dump', + 'Data::Dumper' => 'perl-Data-Dumper', + 'Data::UUID' => 'perl-Data-UUID', + 'Date::Format' => 'perl-TimeDate', + 'Date::Parse' => 'perl-TimeDate', + 'DateTime' => 'perl-DateTime', + 'DBD::mysql' => 'perl-DBD-MySQL', + 'DBI' => 'perl-DBI', + 'Digest::MD5' => 'perl', + 'Email::Address' => 'perl-Email-Address', + 'Email::Simple' => 'perl-Email-Simple', + 'Email::Sender::Simple' => 'perl-Email-Sender', + 'Email::Sender::Transport::SMTP' => 'perl-Email-Sender', + 'Errno' => 'perl', + 'Exception::Class' => 'perl-Exception-Class', + 'ExtUtils::XSBuilder' => 'perl-ExtUtils-XSBuilder', + 'File::Copy' => 'perl', + 'File::Find' => 'perl', + 'File::Find::Rule' => 'perl-File-Find-Rule', + 'File::Path' => 'perl', + 'File::Spec' => 'perl', + 'File::stat' => 'perl', + 'File::Temp' => 'perl', + 'GD' => 'perl-GD', + 'GDGraph' => 'perl-GDGraph', + 'Getopt::Long' => 'perl', + 'Getopt::Std' => 'perl', + 'HTML::Entities' => 'perl-HTML-Parser', + 'HTML::Scrubber' => 'perl-HTML-Scrubber', + 'HTML::Tagset' => 'perl-HTML-Tagset', + 'HTML::Template' => 'perl-HTML-Template', + 'IO::File' => 'perl', + 'Iterator' => 'CPAN', + 'Iterator::Util' => 'CPAN', + 'JSON' => 'perl-JSON', + 'Locale::Maketext::Lexicon' => 'CPAN', #is availble for fedora + 'Locale::Maketext::Simple' => 'perl-Locale-Maketext-Simple', + 'LWP::Protocol::https' => 'CPAN', #need cpan for higher version + 'MIME::Base64' => 'perl', + 'Net::IP' => 'perl-Net-IP', + 'Net::LDAPS' => 'perl-LDAP', + 'Net::OAuth' => 'perl-Net-OAuth', + 'Net::SMTP' => 'perl-Net-SMTP-SSL', + 'Opcode' => 'perl', + 'PadWalker' => 'perl-PadWalker', + 'Path::Class' => 'perl-Path-Class', + 'PHP::Serialization' => 'CPAN', + 'Pod::Usage' => 'perl', + 'Pod::WSDL' => 'CPAN', + 'Safe' => 'perl', + 'Scalar::Util' => 'perl', + 'SOAP::Lite' => 'perl-SOAP-Lite', + 'Socket' => 'perl', + 'SQL::Abstract' => 'CPAN', + 'Statistics::R::IO' => 'CPAN', + 'String::ShellQuote' => 'perl-String-ShellQuote', + 'Template' => 'CPAN', + 'Text::CSV' => 'perl-Text-CSV', + 'Text::Wrap' => 'perl', + 'Tie::IxHash' => 'perl-Tie-IxHash', + 'Time::HiRes' => 'perl-Time-HiRes', + 'Time::Zone' => 'perl-TimeDate', + 'URI::Escape' => 'perl', + 'UUID::Tiny' => 'CPAN', + 'XML::Parser' => 'perl-XML-Parser', + 'XML::Parser::EasyTree' => 'CPAN', + 'XML::Writer' => 'perl-XML-Writer', + 'XMLRPC::Lite' => 'perl-XMLRPC-Lite', + 'YAML' => 'perl-YAML', +}; + +sub get_perl_prerequisites { + return $perl_prerequisites; +} + +# A hash containing information about the apache webserver +my $apacheLayout = { + MPMDir => '', + MPMConfFile => '/etc/httpd/conf.modules.d/00-mpm.conf', + ServerRoot => '/etc/httpd', + DocumentRoot => '/var/www/html', + ConfigFile => '/etc/httpd/conf/httpd.conf', + OtherConfig => '/etc/httpd/conf.d', + SSLConfig => '', + Modules => '/etc/httpd/modules', + ErrorLog => '/var/log/httpd/error_log', + AccessLog => '/var/log/httpd/access_log', + Binary => '/usr/sbin/apachectl', + User => 'apache', + Group => 'apache', +}; + +sub get_apacheLayout { + return $apacheLayout; +} + +# A command for any distro specific stuff that needs to be done +# before installing prerequisites +sub prepreq_hook { + +}; + +sub midpreq_hook { + run_command(['cpan','Moo']); #moo needs tob e done with cpan not cpanm +}; + +# A command for updating the package sources +sub update_sources { + run_command(['yum', '-y', 'install', 'epel-release']); +}; + +# A command for updating the system +sub update_packages { + run_command(['yum', '-y', 'update']); +}; + +# A command for installing a package given a name +sub package_install { + my $self = shift; + my @packages = @_; + run_command(['yum','-y','install',@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 { + # For installing missing tex package. We can safely use the fedora + # package because its just a latex sytle file. + run_command(['curl', '-ksSO', 'https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/25/Everything/i386/os/Packages/t/texlive-path-svn22045.3.05-17.fc25.1.noarch.rpm']); + run_command(['rpm','-ivh','--replacepkgs','texlive-path-svn22045.3.05-17.fc25.1.noarch.rpm']) + +} + +# A command for checking if the required services are running and +# configuring them +sub configure_services { + run_command(['service','mariadb','start']); + run_command(['chkconfig','mariadb','on']); + run_command(['service','httpd','start']); + run_command(['chkconfig','httpd','on']); + run_command(['mysql_secure_installation']); +} + +# 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 { + +} + +# A comand for any distro specific stuff that needs to be done +# after webwork has been fully installed +sub postinstall_hook { + +} + + +1; From 3aa53e81e917cf74870daecd009ab9bf279aa7df Mon Sep 17 00:00:00 2001 From: dlglin Date: Fri, 1 Nov 2019 15:59:51 -0600 Subject: [PATCH 2/3] Add direct path to EPEL for RHEL7 because no yum package exists --- distros/redhat/75.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/redhat/75.pm b/distros/redhat/75.pm index 5a4a54a..fdb076d 100644 --- a/distros/redhat/75.pm +++ b/distros/redhat/75.pm @@ -180,7 +180,7 @@ sub midpreq_hook { # A command for updating the package sources sub update_sources { - run_command(['yum', '-y', 'install', 'epel-release']); + run_command(['yum', '-y', 'install', 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm']); }; # A command for updating the system From c9335a754dd0cc0c3b3a27f9ebc8d5041d2bf275 Mon Sep 17 00:00:00 2001 From: Danny Glin Date: Thu, 30 Jul 2020 15:36:03 -0600 Subject: [PATCH 3/3] Add support for RHEL7.8 --- distros/redhat/{75.pm => 78.pm} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename distros/redhat/{75.pm => 78.pm} (97%) diff --git a/distros/redhat/75.pm b/distros/redhat/78.pm similarity index 97% rename from distros/redhat/75.pm rename to distros/redhat/78.pm index fdb076d..1fae97f 100644 --- a/distros/redhat/75.pm +++ b/distros/redhat/78.pm @@ -1,11 +1,11 @@ -package redhat::75; +package redhat::78; use strict; use warnings; use WeBWorK::Install::Utils; -my $ww_versions = ['2.13']; +my $ww_versions = ['2.14']; sub get_ww_versions { return $ww_versions; @@ -180,7 +180,7 @@ sub midpreq_hook { # A command for updating the package sources sub update_sources { - run_command(['yum', '-y', 'install', 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm']); + run_command(['rpm', '-Uhv', 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm']); }; # A command for updating the system