Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The instructions on building a release can be found in the build/README file in svn.

This page details how to set up an environment in which to build and test a release.

...

Packages that are installed from source on CPAN using cpanm -S which installs as root
  cpanm -S Razor2::Client::Agent
  cpanm -S Net::Patricia
  cpanm -S Geo::IP
  cpanm -S Devel::SawAmpersand
  custom compiled re2c
      - obtain the latest release from github (linked from https://re2c.org) because epel rpm is too old
      - sudo yum install gcc-c++
      - build with  ./configure --prefix=/usr/local && make && sudo make install

...

 build-essential
curl
cpanminus
git
pyzor
razor
subversion
libdb-dev
libdbi-dev
libidn11-dev
libidn2-dev
libmaxminddb-dev
libssl-dev
zlib1g-dev
poppler-utils
tesseract-ocr

libarchive-zip-perl
libberkeleydb-perl
libbsd-resource-perl
libdbilibdigest-sha-perl
libencode-detect-perl
libgeo-ip-perl
libgeoip2-perl
libio-compress-perl
libio-socket-inet6-perl
libio-socket-ssl-perl
libio-string-perl
libmail-dkim-perl
libmail-spf-perl
libnet-patricia-perl
libnetlibfile-sharedir-dnsinstall-perl
libnetaddrlibtest-ipexception-perl
libsocket6libregexp-common-perl
libsyslibxml-hostname-longlibxml-perl
libtest-pod-coverage-perl
libtest-pod-perl
libdbd-sqlite2-perl
libdbd-sqlite3-perl
libdevel-cycle-perl
libemail-address-xs-perl
libgeography-countries-perl
libtest-perl-critic-perl
libconfig-tiny-perl
libdbix-simple-perl
libemail-mime-perl
libemail-sender-perl
libemail-simple-perl
libnet-idn-encode-perl
libtest-file-sharedir-perl
libtest-output-perl
libnet-imap-simple-perl
libnet-smtps-perl
libtext-diff-perl

Install the following packages from CPAN which do not have equivalent apt packages on Ubuntu already.
The -S option causes the installation step to be run as root using sudo.


cpanm -S Digest::SHA1 IP::Country::DB_File IP::Country Mail::DMARC::PurePerl Net::LibIDN2 \
Perl::Critic::Policy::Bangs::ProhibitBitwiseOperators Perl::Critic::Policy::Perlsecret \
Perl::Critic::Policy::Compatibility::ProhibitThreeArgumentOpen \
Perl::Critic::Policy::Lax::ProhibitStringyEval::ExceptForRequire \
Perl::Critic::Policy::ValuesAndExpressions::PreventSQLInjection \
Perl::Critic::Policy::ControlStructures::ProhibitReturnInDoBlock

Install dcc from source: Get the source from the link at https://www.dcc-servers.net/dcc/ and 

...

custom compile re2c because the version installed by Ubuntu is too old
      - obtain the latest release from github (linked from https://re2c.org)
      - build with  
          ./configure --prefix=/usr/local
     
make
     sudo make install
 

...

Initialize the razor installation by running once (not as root) after razor is installed
  razor-admin --createcreate  
  razor-admin --register

Now that everything is installed, verify that you have a working build and test environment by downloading
the trunk svn working directory, build it, and run tests.

...

The following commands in a terminal shell will download and install plenv into your home directory, restart
the shell as a login shell, and install cpanm in the plenv environmentinstall perl 5.16.3,
cpanm, and all the CPAN modules required for SpamAssassin building and testing.
After running this, log out of Ubuntu and log back in again to get the new environment with the perl 5.16.3,
cd to the working directory and rebuild SpamAssassin starting with the perl Makefile.PL command.

With this old version of perl , the the sawampersand test can run. Read documentation about plenv to learn how to switch
between versions of perl.

git clone https://github.com/tokuhirom/plenv.git ~/.plenv
git clone https://github.com/tokuhirom/plenvPerl-Build.git ~/.plenv/plugins/perl-build/
echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(plenv init -)"' >> ~/.profile
exec $SHELL -l
plenv install-cpanm

Don't expect plenv to be available in any other terminal windows until you have logged out and logged in
again or rebooted the machine.

...

export PATH="$HOME/.plenv/bin:$PATH"
eval "$(plenv init -)"
plenv install 5.16.3

...

plenv install 5.16.3 

...


...

plenv rehash

plenv global 5.16.

To switch back to using the system perl

plenv global system 

To see a list of all versions of perl installed and ready to switch to, with the current one indicated

plenv versions 

To see just the current version

plenv version 

To run perl and have it show you the its version, so you can verify that plenv is working right

perl -v 

To disable plenv completely, all you have to do is edit ~/.profile  and comment out the two lines at the
end that you added with those echo  commands above, then restart your computer to be sure.
To enable it again, uncomment those two lines in ~/.profile  and restart.

The perl modules that were installed using apt will all have to be installed from CPAN into each perl version
hat you install in plenv. Use the cpanm command, without -S option.

Before the first time you do this, install the following packages which are needed for the CPAN install
of some of the modules

sudo apt install libd-bdev libidn2-dev libidn11-dev libmaxminddb-dev 

Then, in each version of perl other than system, switch to the version and do the cpanm install

cpanm HTML::Parser Net::DNS NetAddr::IP3
perl -v
plenv install-cpanm

cpanm Archive::Zip BSD::Resource BerkeleyDB Compress::Zlib DBI DB_File Devel::Cycle \
Digest::SHA Digest::SHA1 DigestEmail::Address::SHA DB_File Mail::SPF
XS Encode::Detect Encode::Detect::Detector \
Geo::IP GeoIP2 GeoIP2::Database::Reader Geography::Countries GeoHTML::IPParser IPHTTP::CountryCookies \
HTTP::DB_FileDaemon NetHTTP::CIDRDate HTTP::LiteNegotiate \
IO::Socket::INET6 IO::Socket::SSL Mail::DKIM DBIIO::String \
IP::Country IP::Country::DB_File LWP::Protocol::https LWP::UserAgent HTTPMail::DateDKIM \
Encode::Detect::DetectorMail::DMARC::PurePerl Math::Int128 MaxMind::DB::Reader::XS Net::CIDR::Lite Net::PatriciaDNS \
Net::DNS::Nameserver \
BSDNet::ResourceLibIDN ArchiveNet::ZipLibIDN2 IONet::CompressPatricia IONet::String BerkeleyDB BSDWorks::ResourceNetwork DBI EncodeNetAddr::DetectIP \
MailParams::Validate Razor2::Client::DKIMAgent Sys::Hostname::Long Test::PodPerl::CoverageCritic Test::Pod \
DevelTest::Pod::SawAmpersandCoverage MailWWW::DMARCRobotRules Text::PurePerl Devel::Cycle Email::Address::XS \
Geography::Countries IP::Country Math::Int128 Net::Works::Network Net::LibIDN2 \
Net::LibIDN MaxMind::DB::Reader::XS Test::Perl::Critic

...

Diff \
Perl::Critic::Policy::Bangs::ProhibitBitwiseOperators Perl::Critic::Policy::Perlsecret \
Perl::Critic::Policy::Compatibility::ProhibitThreeArgumentOpen \
Perl::Critic::Policy::Lax::ProhibitStringyEval::ExceptForRequire \
Perl::Critic::Policy::ValuesAndExpressions::PreventSQLInjection \
Perl::Critic::Policy::ControlStructures::ProhibitReturnInDoBlock

cpanm Mail::SPF -n --install-args="--install_path sbin=$HOME/bin" 

...