Note: this article is quite dated now as there are easier ways to install spamassassin but if you want to install from source this will work.
Login as root and run a Perl shell (cpan I think)
perl -MCPAN -e shell
Then begin the installation:
Install will commence and once complete, you should have a fully working spamassassin installation.
Depending on which SMTP MTA you’re using, additional customisation will be required.
You can also use:
cpan -i Mail::SpamAssassin