SpamAssassin does not compile: Can't exec `version.h.pl'

JonathanJ

New member
Joined
Sep 26, 2014
Messages
2
Hey!

On a few occasions, when trying to install SpamAssassin via custombuild (happened last in DA 1.51.3, but also had the problem last year) I would sometimes encounter the following error while custombuild is building SpamAssassin:

Code:
spamc/configure.pl: Can't exec `version.h.pl': No such file or directory at spamc/configure.pl line 74.

The error persisted even after updating custombuild and double checking all prerequisites. DA Support helped me solving the problem. The solution may seem trivial, but I'm not familiar with custombuild so I wasn't able to cook it up myself. I want to post their work-around here to help other people who may encounter the issue and tried Googling to no avail. It's not a solution, but at least let's you compile SpamAssassin. If somebody has a solution or another work-around, I would be very curious.

Full credits for the work-around goes to DA Support, I'm just posting it here so others can find it via Google.

---

After trying the installation as normal (so the most recent source version was downloaded):

Code:
cd /usr/local/directadmin/custombuild
tar xvzf Mail-SpamAssassin-VERSION.tar.gz
cd Mail-SpamAssassin-VERSION

Change spamc/configure.pl like so, to ignore the check for version.h.pl existence:

Code:
   local @ARGV = ();
   # Got to check for defined because the script returns shell error level!
   unless (defined do $0) {
-    $0 = $Z;
-    die $@ ? $@ : "Can't exec `version.h.pl': $!";
+   $0 = "/usr/local/directadmin/custombuild/Mail-SpamAssassin-3.4.1/spamc/version.h.pl";
+   $Z = $0;
+   $Z;
   }
 }

The previous file's job was to create another file, spamc/version.h, which you'll have to create manually:

Code:
/* version.h.  Generated by version.h.pl.  */
/* version.h.in.  template for version.h.pl, called from configure.pl.  */

#define VERSION_STRING "3.4.1"

Then you can manually complete the installation of SpamAssassin manually:

Code:
perl Makefile.PL PREFIX=/usr CONTACT_ADDRESS="the administrator of that system" RUN_NET_TESTS="no" INSTALL_BASE=""
make
make install

And finally, you can start SpamAssassin:

Code:
spamd -d -c -m 15
 
Back
Top