Bug 211723 - mail/opendkim: When enabling OPENDBX, port installation fails because of missing files
Summary: mail/opendkim: When enabling OPENDBX, port installation fails because of miss...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kurt Jaeger
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-08-10 12:19 UTC by Ștefan BĂLU
Modified: 2018-01-26 16:43 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (freebsd-ports)
koobs: merge-quarterly?


Attachments
poudriere-opendkim-2.1.0.3_5.log_103amd64 (164.77 KB, text/plain)
2016-08-10 23:18 UTC, w.schwarzenfeld
no flags Details
patch-Makefile (1.08 KB, patch)
2016-08-11 13:07 UTC, w.schwarzenfeld
koobs: maintainer-approval+
Details | Diff
patch using _IMPLIES instead (2.32 KB, patch)
2016-09-03 12:15 UTC, Kurt Jaeger
pi: maintainer-approval?
Details | Diff
proposed_svn-diff_opendkim (3.58 KB, patch)
2016-09-03 14:17 UTC, w.schwarzenfeld
no flags Details | Diff
Fix missing files when OPENDBX is enabled (670 bytes, patch)
2016-10-17 12:21 UTC, Max Khon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ștefan BĂLU 2016-08-10 12:19:01 UTC
When installing mail/opendkim, if one selects the OPENDBX port option (in order to be able to use MySQL, PgSql or SQLite3 databases), the opendkim port refuses to install because of some missing files (that are created because OPENDBX is enabled).

Below is an excerpt of the build process:

    # make all install
    ===>  Installing for opendkim-2.10.3_5
    ===>   opendkim-2.10.3_5 depends on package: perl5>=5.20<5.21 - found
    ===>   opendkim-2.10.3_5 depends on shared library: libcurl.so - found (/usr/local/lib/libcurl.so)
    ===>   opendkim-2.10.3_5 depends on shared library: libjansson.so - found (/usr/local/lib/libjansson.so)
    ===>   opendkim-2.10.3_5 depends on shared library: libldns.so - found (/usr/local/lib/libldns.so)
    ===>   opendkim-2.10.3_5 depends on shared library: libopendbx.so - found (/usr/local/lib/libopendbx.so)
    ===>   opendkim-2.10.3_5 depends on shared library: liblua-5.2.so - found (/usr/local/lib/liblua-5.2.so)
    ===>   opendkim-2.10.3_5 depends on shared library: libdb-5.3.so - found (/usr/local/lib/libdb-5.3.so)
    ===>  Checking if opendkim already installed
    ===>   Registering installation for opendkim-2.10.3_5
    pkg-static: Unable to access file /usr/ports/mail/opendkim/work/stage/usr/local/bin/opendkim-spam: No such file or directory
    pkg-static: Unable to access file /usr/ports/mail/opendkim/work/stage/usr/local/sbin/opendkim-importstats: No such file or directory
    pkg-static: Unable to access file /usr/ports/mail/opendkim/work/stage/usr/local/man/man1/opendkim-spam.1.gz: No such file or directory
    pkg-static: Unable to access file /usr/ports/mail/opendkim/work/stage/usr/local/man/man8/opendkim-importstats.8.gz: No such file or directory
    *** Error code 74

    Stop.
    make[1]: stopped in /usr/ports/mail/opendkim
    *** Error code 1

    Stop.
    make: stopped in /usr/ports/mail/opendkim

To fix this issue, i've performed `make all` in mail/opendkim. The, i edited the work/.PLIST.mktmp file and commented out the references to opendkim-spam and opendkim-importstats (both executables and man pages) as shown below:

    @comment bin/opendkim-spam
    @comment sbin/opendkim-importstats
    @comment man/man1/opendkim-spam.1.gz
    @comment man/man8/opendkim-importstats.8.gz

However, a better fix should be deployed.
Comment 1 w.schwarzenfeld freebsd_triage 2016-08-10 14:35:39 UTC
THe error does not appear, if STATS and STATSEXT are enabled.

Either it is forgotten to add it to this condition
if ${PORT_OPTIONS:MSTATSEXT}
.if !${PORT_OPTIONS:MSTATS} || !${PORT_OPTIONS:MLUA} <--  || !${PORTS_OPTION:MOPENDBX}
IGNORE= option STATSEXT requires STATS and LUA as well
.endif
.endif

or it is a bug.
Comment 2 w.schwarzenfeld freebsd_triage 2016-08-10 14:52:14 UTC
Cause it is only need STATS, and LUA is enabled by default, I guess it was forgotten.
Comment 3 Ștefan BĂLU 2016-08-10 21:26:20 UTC
This doesn't seem to fix the issue. Also, the STATS option is unset in the port's options file.

Running make package will trigger the issue:

    ===>  Building package for opendkim-2.10.3_5
    pkg-static: Unable to access file /usr/ports/mail/opendkim/work/stage/usr/local/bin/opendkim-spam: No such file or directory
    pkg-static: Unable to access file /usr/ports/mail/opendkim/work/stage/usr/local/sbin/opendkim-importstats: No such file or directory
    pkg-static: Unable to access file /usr/ports/mail/opendkim/work/stage/usr/local/man/man1/opendkim-spam.1.gz: No such file or directory
    pkg-static: Unable to access file /usr/ports/mail/opendkim/work/stage/usr/local/man/man8/opendkim-importstats.8.gz: No such file or directory
    *** Error code 1
Comment 4 w.schwarzenfeld freebsd_triage 2016-08-10 23:18:42 UTC
Created attachment 173529 [details]
poudriere-opendkim-2.1.0.3_5.log_103amd64
Comment 5 w.schwarzenfeld freebsd_triage 2016-08-10 23:19:49 UTC
Builds without problems with poudriere (see attached log).
Comment 6 w.schwarzenfeld freebsd_triage 2016-08-11 05:29:29 UTC
the statement with the condition was wrong. Overlooked the first if. It needs another condition for this option.
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2016-08-11 12:09:08 UTC
Is there a patch to be attached?
Comment 8 w.schwarzenfeld freebsd_triage 2016-08-11 13:07:15 UTC
Created attachment 173547 [details]
patch-Makefile
Comment 9 w.schwarzenfeld freebsd_triage 2016-08-11 13:09:54 UTC
Attached the patch with the changed ignorer warning. But I am not clear if it  works now with synth. (I don't work with it). But it works with stats, statsext on the poudriere tests (11.0,10.3 and 9.3amd, 10.3 and 9.3i386).
Comment 10 w.schwarzenfeld freebsd_triage 2016-08-11 13:31:00 UTC
I puzzled the PR's here was no problem with synth.
Comment 11 w.schwarzenfeld freebsd_triage 2016-08-11 14:40:45 UTC
I could enable the STAT and LUA option automatically if move STATS and STATSOPTION from Makefile.options to the Makefile. BUt I am not sure if this is right.
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2016-08-11 15:39:17 UTC
Pending maintainer review/approval
Comment 13 Ștefan BĂLU 2016-08-24 01:45:22 UTC
If patch is applied, it behaves as expected IF STATS config option is selected. Not sure why is this a requirement in order to use OPENDBX, since the initial issue was the complain of a couple of unexpected files...
Comment 14 Kubilay Kocak freebsd_committer freebsd_triage 2016-09-02 12:30:51 UTC
Comment on attachment 173547 [details]
patch-Makefile

Maintainer timeout (3 weeks), implicit approval
Comment 15 Kurt Jaeger freebsd_committer 2016-09-03 12:15:57 UTC
Created attachment 174333 [details]
patch using _IMPLIES instead

Here's the same using _IMPLIES. I'm wondering why many options are set in Makefile.options, and some in the Makefile. Would it work if all is moved to .options or all into the main Makefile ?
Comment 16 Kurt Jaeger freebsd_committer 2016-09-03 12:16:23 UTC
btw, testbuilds for the version with _IMPLIES are fine.
Comment 17 w.schwarzenfeld freebsd_triage 2016-09-03 14:17:33 UTC
Created attachment 174334 [details]
proposed_svn-diff_opendkim
Comment 18 w.schwarzenfeld freebsd_triage 2016-10-03 22:11:01 UTC
One month since last statement - maintainer time-out ?
Comment 19 Max Khon freebsd_committer 2016-10-17 12:21:44 UTC
Created attachment 175860 [details]
Fix missing files when OPENDBX is enabled
Comment 20 Martin Wilke freebsd_committer 2017-03-05 10:50:44 UTC
Hi,

Any progress here?
Comment 21 Ștefan BĂLU 2017-03-05 11:10:55 UTC
No. As soon as i enable OPENDBX, i won't be able to package or install this port without having to select also the STATS option (not STATSEXT) otherwise it will not stop complaining about the spam and importstats files.

OpenDBX is required in order to be able to use OpenDKIM with a database backend such as MySQL, PostgreSQL, SQLite3 etc. This STATS option and these files the build system complains about ARE NOT REQUIRED for my installation at all, so, the way i see a fix is to:

1. understand WHO needs these files and WHEN to actually include them in the package
2. fix the damn port so that it won't EVER complain about these files

So, make the port IGNORE these files UNLESS the STATS option has been SET. If only OPENDBX option is SET (and STATS is UNSET) then the Makefile should remove these files BEFORE INSTALLING or PACKAGING (this seems to fix the problem).
Comment 22 Max Khon freebsd_committer 2018-01-26 16:43:55 UTC
Please check my patch above that does exactly this.