Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 427946

Summary: apache-2.eclass: Proposed enhancement: USE_EXPAND of APACHE2_MODULES should support IUSE-DEFAULTS
Product: Gentoo Linux Reporter: Stefan Kuhn <wuodan-gentoo>
Component: EclassesAssignee: Apache Team - Bugzilla Reports <apache-bugs>
Status: UNCONFIRMED ---    
Severity: enhancement CC: mail, patrick, stefan.kuhn
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Attachments: apache-2.eclass.patch

Description Stefan Kuhn 2012-07-24 21:28:08 UTC
Proposed Enhancement:
Change the behavior of APACHE2_MODULES USE_EXPAND in apache-2.eclass to support IUSE-DEFAULTS, so we can define default modules in the ebuild.

IUSE_MODULES="+foo" would become IUSE="+apache2_modules_foo"

Currently default modules for www-servers/apache are only defined as APACHE2_MODULES in the base profile at /usr/portage/profiles/base/make.defaults

There is no other way to set defaults with current apache-2.eclass, I tried hard.

Now apache-2.4 replaced/renamed some modules, split up modules, etc.
So the defaults would need an update.

Current strategy in the ebuild/eclass is also to allow installation without critical modules, only a warning in apache-2-pkg_setup() is displayed.
This is fine, as long as the default modules are compliant.

So with apache-2.4, every user will run into errors about missing packages and then has to set some flags manually.

Other Solutions:
I played with the ebuild/eclass a while and see only these other solutions, none satisfying:

a) Display warnings:
Either the current way with MODULE_CRITICAL or special warnings in pkg_postinst(). Every user will still have to set flags manually.

b) Hard disabling installations without critical modules
Still an error for everyone, earlier and possible with smarter warning message.

c) Hard enabling new/critical modules
Possible by abusing the eclass-internal MY_MODS in the ebuild as in MY_MODS="${MY_MODS} foo"

d) Continuous updates of default modules in the profile
Comment 1 Stefan Kuhn 2012-07-24 21:34:44 UTC
Created attachment 319136 [details, diff]

I'm sure there are better ways to code this, but it's simple and works in my tests ...
Comment 2 Stefan Kuhn 2012-07-24 22:02:31 UTC
If that is not compliant with definition of USE_EXPAND in the PMS, then I would propose introducing a new variable to the eclass "MODULE_DEFAULTS" with the same effect.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-07-25 01:34:43 UTC
Bugzilla says:
Assignee: did not match anything

--- apache-2.eclass     23 May 2012 03:24:44 -0000      1.29
+++ apache-2.eclass     25 Jul 2012 01:34:01 -0000
@@ -4,7 +4,7 @@
 # @ECLASS: apache-2.eclass
 # @BLURB: Provides a common set of functions for apache-2.x ebuilds
 # This eclass handles apache-2.x ebuild functions such as LoadModule generation
Comment 4 Stefan Kuhn 2012-07-26 11:31:52 UTC
Created attachment 319292 [details, diff]

Other solution: New eclass variable MODULE_DEFAULTS

The attached diff contains a tested patch to the eclass.
The effect is the same:
=> we can set sane default modules/flags in the ebuild without touching the profile.
Comment 5 Stefan Kuhn 2012-07-26 11:32:35 UTC
Sidenote: EAPI >2 throws QA-notice: ebeep  not defined
I would also like to use REQUIRED_USE for apache-2.4, thus lifting EAPI from 2
to 4.
But imho, the eclass is not completly conform with EAPI >2.

This QA-notice shows up in apache-2_pkg_setup().

* QA Notice: ebeep is not defined in EAPI=4, please file a bug at
* Please note that you need SysV IPC support in your kernel.
* Make sure CONFIG_SYSVIPC=y is set.
Comment 6 Stefan Kuhn 2012-07-26 11:34:29 UTC
Created attachment 319294 [details, diff]

Wrong file, sorry
Comment 7 Stoian Ivanov 2012-09-04 08:13:23 UTC
I'm willing to test anything. Can we have  apache-24.eclass that best suits your thoughts and probably a new slot for 2.4? I think this will isolate 2.4 well enough but I'm not a ebuild dev
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-02-04 13:02:43 UTC
(reassigning to the current maintainer of the eclass)