Page MenuHomeFreeBSD

Add Flavor helpers for PLIST_FILES, COMMENT, CONFIGURE_[ARGS|ENV]
Needs ReviewPublic

Authored by fluffy on Nov 16 2018, 1:18 PM.

Details

Reviewers
None
Group Reviewers
portmgr
Summary

If a port have dozen of flavors, using additional helpers allow to dramatically desrease size of Makefile

PLIST is always handled by helper, wonder why PLIST_FILES was missed.
Override COMMENT is useful for flavored plugins, CONFIGURE_[ARGS|ENV] is also useful as helper — it allow to avoid extra .ifdef in Makefile

For example, with additional helpers I can simply use

filter-clamav_COMMENT=                  Check messages with ClamAV in OpenSMTPD
filter-clamav_RUN_DEPENDS=              clamscan:security/clamav
filter-clamav_PLIST_FILES=              libexec/opensmtpd/filter-clamav \
                                        man/man8/filter-clamav.8.gz
filter-clamav_CONFIGURE_ARGS=           --with-experimental-filter-clamav

instead of two blocks

filter-clamav_RUN_DEPENDS=              clamscan:security/clamav

and

.if ${FLAVOR:M*clamav}
COMMENT=                  Check messages with ClamAV in OpenSMTPD
PLIST_FILES=              libexec/opensmtpd/filter-clamav \
                                        man/man8/filter-clamav.8.gz
CONFIGURE_ARGS=           --with-experimental-filter-clamav
.endif
Test Plan

exp-run?

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

fluffy created this revision.Nov 16 2018, 1:18 PM
Herald added a subscriber: mat. · View Herald Transcript
mat added a comment.Nov 23 2018, 10:26 AM

No port will ever have a dozen flavors. Flavors are few, not many.

I do not see a reason to change the COMMENT, it is the same software, it is just built differently, and I don't think I ever saw COMMENT being changed when options changes.

Also, from your example, it seems you are trying to abuse flavors to get some sort of subpackages, which will never be approved.