public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] depend.apache.eclass EAPI=6 support
@ 2016-12-04 23:18 Andreas K. Huettel
  2016-12-05  0:12 ` Michael Orlitzky
  2016-12-05  0:18 ` Mike Gilbert
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas K. Huettel @ 2016-12-04 23:18 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: Text/Plain, Size: 307 bytes --]


Please review. Given that I'm only tangentially involved with Apache myself, I 
would like to keep the changes to the eclass minimal... 

[The last nontrivial changes to the eclass were made in 2012 and 2008.]

-- 

Andreas K. Huettel
Gentoo Linux developer 
dilfridge@gentoo.org
http://www.akhuettel.de/


[-- Attachment #2: 0001-depend.apache.eclass-Make-it-work-with-EAPI-6-see-be.patch --]
[-- Type: text/x-patch, Size: 3464 bytes --]

From 895b4776d7ebad2bcafb7ab0e1023c4115075dc0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 5 Dec 2016 00:11:00 +0100
Subject: [PATCH] depend.apache.eclass: Make it work with EAPI=6; see below for
 details.

Starting with EAPI=6, the variables APACHE_BASEDIR and APACHE_MODULESDIR
are not exported in global scope anymore. Instead, ebuilds can use
get_apache_basedir and get_apache_modulesdir. Usage and applicable
restrictions are the same as for get_libdir.
---
 eclass/depend.apache.eclass | 44 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 35 insertions(+), 9 deletions(-)

diff --git a/eclass/depend.apache.eclass b/eclass/depend.apache.eclass
index b69c2ec..51fdde2 100644
--- a/eclass/depend.apache.eclass
+++ b/eclass/depend.apache.eclass
@@ -40,17 +40,11 @@
 # }
 # @CODE
 
-inherit multilib
-
 case ${EAPI:-0} in
 	0|1|2|3|4|5)
+		inherit multilib
 		;;
 	6)
-		ewarn
-		ewarn "EAPI=${EAPI} is not supported by depend.apache.eclass."
-		ewarn "This means that ${CATEGORY}/${PF} is most likely buggy."
-		ewarn "Please file a report on https://bugs.gentoo.org/"
-		ewarn
 		;;
 	*)
 		die "EAPI=${EAPI} is not supported by depend.apache.eclass"
@@ -85,6 +79,8 @@ esac
 # @DESCRIPTION:
 # Path to the server root directory.
 # This variable is set by the want/need_apache functions.
+# Only available in EAPIs 0 through 5. For later EAPIs, please
+# use get_apache_basedir.
 
 # @ECLASS-VARIABLE: APACHE_CONFDIR
 # @DESCRIPTION:
@@ -105,6 +101,8 @@ esac
 # @DESCRIPTION:
 # Path where we install modules.
 # This variable is set by the want/need_apache functions.
+# Only available in EAPIs 0 through 5. For later EAPIs, please
+# use get_apache_modulesdir.
 
 # @ECLASS-VARIABLE: APACHE_DEPEND
 # @DESCRIPTION:
@@ -141,11 +139,16 @@ _init_apache2() {
 	APACHE_BIN="/usr/sbin/apache2"
 	APACHE_CTL="/usr/sbin/apache2ctl"
 	APACHE_INCLUDEDIR="/usr/include/apache2"
-	APACHE_BASEDIR="/usr/$(get_libdir)/apache2"
 	APACHE_CONFDIR="/etc/apache2"
 	APACHE_MODULES_CONFDIR="${APACHE_CONFDIR}/modules.d"
 	APACHE_VHOSTS_CONFDIR="${APACHE_CONFDIR}/vhosts.d"
-	APACHE_MODULESDIR="${APACHE_BASEDIR}/modules"
+
+	case ${EAPI:-0} in
+		0|1|2|3|4|5)
+			APACHE_BASEDIR="/usr/$(get_libdir)/apache2"
+			APACHE_MODULESDIR="${APACHE_BASEDIR}/modules"
+			;;
+	esac
 }
 
 _init_no_apache() {
@@ -329,4 +332,27 @@ has_apache_threads_in() {
 	fi
 }
 
+# @FUNCTION: get_apache_basedir
+# @USAGE: get_apache_basedir
+# @DESCRIPTION:
+# EAPI=6 or later: prints out the apache basedir, e.g., /usr/lib64/apache2
+# Can only be called in src_* phases, and in particular NOT in global scope.
+# Replacement for the APACHE_BASEDIR variable.
+get_apache_basedir() {
+	declare -f -F get_libdir > /dev/null || 
+		die "depend.apache.eclass: get_apache_basedir can only be called in phase functions of EAPI=6 and later"
+	echo -n "/usr/$(get_libdir)/apache2"
+}
+
+# @FUNCTION: get_apache_modulesdir
+# @USAGE: get_apache_modulesdir
+# @DESCRIPTION:
+# EAPI=6 or later: prints out the apache module installation directory, e.g.,
+# /usr/lib64/apache2/modules
+# Can only be called in src_* phases, and in particular NOT in global scope.
+# Replacement for the APACHE_MODULESDIR variable.
+get_apache_modulesdir() {
+	echo -n "$(get_apache_basedir)/modules"
+}
+
 EXPORT_FUNCTIONS pkg_setup
-- 
2.11.0.rc2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] depend.apache.eclass EAPI=6 support
  2016-12-04 23:18 [gentoo-dev] [PATCH] depend.apache.eclass EAPI=6 support Andreas K. Huettel
@ 2016-12-05  0:12 ` Michael Orlitzky
  2016-12-06 22:25   ` Andreas K. Huettel
  2016-12-05  0:18 ` Mike Gilbert
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Orlitzky @ 2016-12-05  0:12 UTC (permalink / raw
  To: gentoo-dev

On 12/04/2016 06:18 PM, Andreas K. Huettel wrote:
> Starting with EAPI=6, the variables APACHE_BASEDIR and APACHE_MODULESDIR
> are not exported in global scope anymore.

Currently, we emit a warning when using depend.apache with EAPI=6. How
many packages are triggering that warning? If we stop exporting those
two variables, then EAPI=6 users of apache-module.eclass are going to
start installing modules into the root.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] depend.apache.eclass EAPI=6 support
  2016-12-04 23:18 [gentoo-dev] [PATCH] depend.apache.eclass EAPI=6 support Andreas K. Huettel
  2016-12-05  0:12 ` Michael Orlitzky
@ 2016-12-05  0:18 ` Mike Gilbert
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Gilbert @ 2016-12-05  0:18 UTC (permalink / raw
  To: Gentoo Dev

On Sun, Dec 4, 2016 at 6:18 PM, Andreas K. Huettel <dilfridge@gentoo.org> wrote:
>
> Please review. Given that I'm only tangentially involved with Apache myself, I
> would like to keep the changes to the eclass minimal...
>
> [The last nontrivial changes to the eclass were made in 2012 and 2008.]

For future patches, please use git send-email if possible. Makes it
easier to review in an email client.

> +   declare -f -F get_libdir > /dev/null ||

Nit: the -F option implies -f; passing both is unnecessary.

Otherwise, the changes seem fine.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] depend.apache.eclass EAPI=6 support
  2016-12-05  0:12 ` Michael Orlitzky
@ 2016-12-06 22:25   ` Andreas K. Huettel
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas K. Huettel @ 2016-12-06 22:25 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Am Montag, 5. Dezember 2016, 01:12:56 schrieb Michael Orlitzky:
> On 12/04/2016 06:18 PM, Andreas K. Huettel wrote:
> > Starting with EAPI=6, the variables APACHE_BASEDIR and APACHE_MODULESDIR
> > are not exported in global scope anymore.
> 
> Currently, we emit a warning when using depend.apache with EAPI=6. How
> many packages are triggering that warning? If we stop exporting those
> two variables, then EAPI=6 users of apache-module.eclass are going to
> start installing modules into the root.

Currently four ebuilds with EAPI=6 are using depend.apache.eclass. None of 
them uses the two variables.

However, there's a problem, and that needs still work.

apache-module.eclass makes heavy use of the variables and isn't versioned for 
EAPI yet. This affects only two of the above ebuilds; I'll likely downgrade 
them to EAPI=5 for now.

- -- 

Andreas K. Huettel
Gentoo Linux developer 
dilfridge@gentoo.org
http://www.akhuettel.de/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQKTBAEBCgB9FiEEwo/LD3vtE3qssC2JpEzzc+fumeQFAlhHOtZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEMy
OEZDQjBGN0JFRDEzN0FBQ0IwMkQ4OUE0NENGMzczRTdFRTk5RTQACgkQpEzzc+fu
meRwWA//X/MfAd+DK0WzwQrxdvyaR9YgdGYI5srSlhKazHaVRy/UNWp5+labo9CC
yPR5gX526U6UFy9jgmba74dpyYzPUpkOvjv/0e6zijO1CbHiBQdZ7pCdAQr/lH/a
0yU89g0gzKZ1aJkJHIRWyC6pvW8BQmFk3NmpLLFPR8SEiAHheelgG/zvjBapvaZX
0iEyFK/+EqJ45te2J6D8IpihXeq78K2mIqKN5mI7IgqR/sXzDeXvfV4fZvXos8IO
IprVJpceXgXL+hZKYsNNmiekli8KK432GsCoTZnUbbsA1tg1NG1hAjvaLr6upzMH
vEwl/sxeeOEtcb/+L4LVKNk/HVk2iGOLgGTanf9gYndrd5eTvknNZpykkqk79Lyw
azAbRDggHpbVEMxEnNA2DpnrPs6/cDmz0pDLc3S5vjPEPR1HJIncnDqMUzYRQQF6
PWUmVoB2RpCyQr6F1/IP08P330hirTkjVraYV8Om1i/3ze62QMi/JDx+TaCQPvnv
wSnveZHqb42vTlcKD2JynKS7BoF2DXWMfKgsx0oGpqoFTVcqE7SBl7fldX7JI2vF
alacMsLDcRE+mv4LKbJUJq5XWVTaE3Hj9ZOeUXP5irZGw009t/CDI4ijVEhIolfU
A1qAtG+7OO1TUEKzRduQ/VoyOEvsXGHTQNxZTX7Y+58EfzIu8nM=
=ZdRU
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-06 22:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-04 23:18 [gentoo-dev] [PATCH] depend.apache.eclass EAPI=6 support Andreas K. Huettel
2016-12-05  0:12 ` Michael Orlitzky
2016-12-06 22:25   ` Andreas K. Huettel
2016-12-05  0:18 ` Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox