From 9e892293b5c2517fa7d25c07d351f192ace0d1f0 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 20 Jun 2021 23:15:55 +0200 Subject: webapp.eclass: [QA] add EAPI guard * Declare supported EAPIs as: [QA] 5, 6, 7 * Add guards to die on unsupported/untested EAPIs * Add inherit guards to prevent multiple sourcing Signed-off-by: Sam James Signed-off-by: David Seifert --- eclass/webapp.eclass | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'eclass/webapp.eclass') diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass index 6907ef1c321d..5ef7dbce03cf 100644 --- a/eclass/webapp.eclass +++ b/eclass/webapp.eclass @@ -4,11 +4,22 @@ # @ECLASS: webapp.eclass # @MAINTAINER: # web-apps@gentoo.org +# @SUPPORTED_EAPIS: 5 6 7 # @BLURB: functions for installing applications to run under a web server # @DESCRIPTION: # The webapp eclass contains functions to handle web applications with # webapp-config. Part of the implementation of GLEP #11 +case ${EAPI:-0} in + [567]) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm + +if [[ -z ${_WEBAPP_ECLASS} ]]; then +_WEBAPP_ECLASS=1 + # @ECLASS-VARIABLE: WEBAPP_DEPEND # @DESCRIPTION: # An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be built, most @@ -35,8 +46,6 @@ if [[ "${WEBAPP_OPTIONAL}" != "yes" ]]; then RDEPEND="${DEPEND}" fi -EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm - INSTALL_DIR="/${PN}" IS_UPGRADE=0 IS_REPLACE=0 @@ -577,3 +586,5 @@ webapp_pkg_prerm() { echo fi } + +fi -- cgit v1.2.3-18-g5258