Portability: replace `whoami`
[buildfarm-client.git] / build-farm.conf.template
index 268e27952090697e7537ed5cc3e525d099ce6305..0073b09fcf670205d625d482028c81a802ed7dcc 100644 (file)
@@ -11,24 +11,19 @@ See accompanying License file for license details
 
 package EximBuild;
 
+use 5.010;
 use strict;
+use warnings;
 
-use vars qw(%conf);
-
-# use vars qw($VERSION); $VERSION = 'REL_0.1';
-
-my $branch;
-{
-    no warnings qw(once);
-    $branch = $main::branch;
-}
+my $branch = $::branch;
 
 # This template assumes that the user running the buildfarm process is "farm"
-my $farm_user_name = 'farm';
+my $farm_user_name = getpwuid($<) // die "$0: can't get user name from uid $<: $!\n";
 
-%conf =(
+our %conf =(
     scm => 'git',
     # default is github mirror of Exim
+    # Only used for the initial clone (?)
     scmrepo => 'https://github.com/Exim/exim.git',
     # webref for diffs on server - use default for community
     scm_url => undef,
@@ -46,9 +41,9 @@ my $farm_user_name = 'farm';
     tar_log_cmd => undef,
     # If running multiple animals, an explicit common directory for
     # the lockfile so that runs do not conflict. Otherwise, leave unset.
-    global_lock_dir => "/home/$farm_user_name",
+    global_lock_dir => $ENV{HOME},
     # this directory must exist before anything will work
-    build_root => "/home/$farm_user_name/buildfarm",
+    build_root => "$ENV{HOME}/buildfarm",
     # set true to do vpath builds
     use_vpath => undef,
 
@@ -57,10 +52,10 @@ my $farm_user_name = 'farm';
     core_file_glob => "core*",
 
     # build process will connect to this URL to upload results
-    target => "http://buildfarm.exim.org/cgi-bin/eximstatus.pl",
+    target => 'http://buildfarm.exim.org/cgi-bin/eximstatus.pl',
     # update_personality uses this when you want to update your
     # machine's info (OS, version, compiler, version)
-    upgrade_target => "http://buildfarm.exim.org/cgi-bin/upgrade.pl",
+    upgrade_target => 'http://buildfarm.exim.org/cgi-bin/upgrade.pl',
 
     # Your host alias and password in the BuildFarm
     animal => "alias_assigned_by_build_team",
@@ -120,7 +115,7 @@ my $farm_user_name = 'farm';
     build_env =>{
         # use a dedicated cache for the build farm. this should give us
         # very high hit rates and slightly faster cache searching.
-        CCACHE_DIR => "/home/$farm_user_name/buildfarm/ccache/$branch",
+        CCACHE_DIR => "$ENV{HOME}/buildfarm/ccache/$branch",
 
         ### set this if you need a proxy setting for the
         # outbound web transaction that reports the results
@@ -141,14 +136,23 @@ my $farm_user_name = 'farm';
         AUTH_PLAINTEXT => 'yes',
         SUPPORT_MAILDIR => 'yes',
         # Other examples. Could use makefile_regex instead.
+        #
         #SUPPORT_TLS => 'yes',
-        #USE_OPENSSL_PC => 'openssl',
+        #  Enable the proper libs here or see in makefile_regex
+        #  for use of pkg-config
+        #USE_GNUTLS => 'yes'
         #TLS_LIBS => '-lssl -lcrypto',
-        #EXPERIMENTAL_SPF => 'yes',
+        #
         #LOOKUP_LDAP => 'yes',
-        #LOOKUP_INCLUDE => '-I/usr/include/mysql',
+        #LOOKUP_INCLUDE => '-I/usr/include/mysql -I/usr/include/postgresql'
         #LOOKUP_LIBS => '-lmysqlclient -lpq -lldap -llber',
         #LDAP_LIB_TYPE => 'OPENLDAP2',
+        #LOOKUP_MYSQL => 'yes',
+        #LOOKUP_PGSQL => 'yes',
+        #SUPPORT_PROXY => 'yes',
+        #SUPPORT_SOCKS => 'yes',
+        #EXPERIMENTAL_SPF => 'yes',
+        #EXPERIMENTAL_DANE => 'yes',
     },
     # Settings to add to Local/Makefile. These will add to variables that
     # are already defined earlier in the Makefile.  Example:
@@ -168,16 +172,14 @@ my $farm_user_name = 'farm';
     makefile_regex =>[
         # If have perl devel libraries installed, can build embedded perl
         #q(s/^# EXIM_PERL=/EXIM_PERL=/),
-        # If have mysql devel libraries installed
-        #q(s/^# LOOKUP_MYSQL=/LOOKUP_MYSQL=/),
-        # If have postgres devel librarires installed
-        #q(s/^# LOOKUP_PGSQL=/LOOKUP_PGSQL=/),
-        # Severl experimental features to consider
-        #q(s/^# EXPERIMENTAL_CERTNAMES.*/EXPERIMENTAL_CERTNAMES=yes/),
-        #q(s/^# EXPERIMENTAL_DNSSEC.*/EXPERIMENTAL_DNSSEC=yes/),
-        # Proxy causes some extra debug output messing with tests
-        #q(s/^# EXPERIMENTAL_PROXY.*/EXPERIMENTAL_PROXY=yes/),
-        #q(s/^# EXPERIMENTAL_TPDA.*/EXPERIMENTAL_TPDA=yes/),
+        # Use SSL libraries
+        #q(s/^# (USE_GNUTLS(?:_PC)?=.*)/$1/),
+        #q(s/^# (USE_OPENSSL_PC=.*)/$1/),
+        # Several experimental features to consider
+        # May be outdated, please check a current EDITME for
+        # for options.
+        #q(s/^# (EXPERIMENTAL_CERTNAMES.*)/$1/),
+        #q(s/^# (EXPERIMENTAL_DNSSEC.*)/$1/),
     ],
 
     # The user compiled as the master exim username.
@@ -188,8 +190,10 @@ my $farm_user_name = 'farm';
     master_exim_user => "exim",
 
     # Range of tests to run if enable make_test in optional steps.
-    #range_num_tests => '1 999',
-    range_num_tests => '1 5999',
+    # Start with just a couple while getting the aminal set up,
+    # then enable the full set
+    range_num_tests => '1 2',
+    #range_num_tests => '1 5999',
     # Hardcode some valid version for use during make test
     exim_test_version => '4.84',