Skip to content

Detect perl path at configure time instead of hardcoding /usr/bin/perl#318

Open
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:fix/perl-shebang
Open

Detect perl path at configure time instead of hardcoding /usr/bin/perl#318
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:fix/perl-shebang

Conversation

@thegushi
Copy link
Copy Markdown
Collaborator

Summary

The shebang in all four report scripts (opendmarc-reports, opendmarc-import, opendmarc-expire, opendmarc-params) was hardcoded as #!/usr/bin/perl. On systems where Perl is not at /usr/bin/perl (notably FreeBSD, where it is installed at /usr/local/bin/perl from ports), the installed scripts fail with "not found".

  • Add AC_PATH_PROG([PERL], [perl], [/usr/bin/perl]) to configure.ac so configure detects the correct Perl path, falling back to /usr/bin/perl if not found
  • Replace #!/usr/bin/perl with #!@PERL@ in all four .in files so the correct path is substituted at build time

Test plan

  • On FreeBSD: autoreconf && ./configure — confirm checking for perl... /usr/local/bin/perl in configure output
  • Confirm installed scripts have #!/usr/local/bin/perl shebang
  • On Linux with /usr/bin/perl: confirm shebang is unchanged
  • Pass PERL=/custom/path/perl to configure and confirm it overrides detection

Add AC_PATH_PROG([PERL], [perl], [/usr/bin/perl]) to configure.ac and
replace the hardcoded #!/usr/bin/perl shebang in all four report
scripts with #!@Perl@ so that systems where perl lives elsewhere
(e.g. /usr/local/bin/perl on FreeBSD) get the correct shebang.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant