summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2017-01-10 09:39:07 +0100
committerFabian Groffen <grobian@gentoo.org>2017-01-10 09:39:07 +0100
commit88064ab3025a131fdf6d3624e48f4118c1fbef13 (patch)
tree450922ff41f757e2a2fd769ba5ef42f1dad77f82
parentapp-cdr: drop, needs revisiting (diff)
downloadprefix-88064ab3025a131fdf6d3624e48f4118c1fbef13.tar.gz
prefix-88064ab3025a131fdf6d3624e48f4118c1fbef13.tar.bz2
prefix-88064ab3025a131fdf6d3624e48f4118c1fbef13.zip
eclass: remove some (hopefully) unused eclasses
-rw-r--r--eclass/common-lisp-common-3.eclass82
-rw-r--r--eclass/common-lisp-common.eclass209
-rw-r--r--eclass/depend.apache.eclass318
-rw-r--r--eclass/depend.php.eclass581
-rw-r--r--eclass/embassy.eclass95
-rw-r--r--eclass/games-ggz.eclass78
-rw-r--r--eclass/games.eclass396
-rw-r--r--eclass/gnustep-base.eclass269
-rw-r--r--eclass/mozcoreconf-2.eclass273
-rw-r--r--eclass/mozilla-launcher.eclass123
-rw-r--r--eclass/pam.eclass264
-rw-r--r--eclass/php-common-r1.eclass296
-rw-r--r--eclass/phpconfutils.eclass458
-rw-r--r--eclass/ssl-cert.eclass250
-rw-r--r--eclass/webapp.eclass583
-rw-r--r--eclass/x-modular.eclass634
16 files changed, 0 insertions, 4909 deletions
diff --git a/eclass/common-lisp-common-3.eclass b/eclass/common-lisp-common-3.eclass
deleted file mode 100644
index 400018f2aa..0000000000
--- a/eclass/common-lisp-common-3.eclass
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/common-lisp-common-3.eclass,v 1.4 2012/06/02 19:16:31 zmedico Exp $
-#
-# Author Matthew Kennedy <mkennedy@gentoo.org>
-#
-# Sundry code common to many Common Lisp related ebuilds. Some
-# implementation use the Portage time stamp hack to ensure their
-# installed files have the right modification time relative to each
-# other.
-
-inherit eutils multilib
-
-CLSOURCEROOT=${EPREFIX}/usr/share/common-lisp/source/
-CLSYSTEMROOT=${EPREFIX}/usr/share/common-lisp/systems/
-
-# Many of our Common Lisp ebuilds are either inspired by, or actually
-# use packages and files from the Debian project's archives.
-
-do-debian-credits() {
- docinto debian
- for i in copyright README.Debian changelog; do
- test -f $i && dodoc "${S}"/debian/${i}
- done
- docinto .
-}
-
-# BIG FAT HACK: Since the Portage emerge step kills file timestamp
-# information, we need to compensate by ensuring all FASL files are
-# more recent than their source files.
-
-# The following `impl-*-timestamp-hack' functions SHOULD NOT be used
-# outside of this eclass.
-
-# Bug http://bugs.gentoo.org/show_bug.cgi?id=16162 should remove the
-# need for this hack.
-
-impl-save-timestamp-hack() {
- local impl=$1
- dodir /usr/share/${impl}
- tar cpjf "${ED}"/usr/share/${impl}/portage-timestamp-compensate -C "${ED}"/usr/$(get_libdir)/${impl} .
-}
-
-impl-restore-timestamp-hack() {
- local impl=$1
- tar xjpfo ${EPREFIX}/usr/share/${impl}/portage-timestamp-compensate -C ${EPREFIX}/usr/$(get_libdir)/${impl}
-}
-
-impl-remove-timestamp-hack() {
- local impl=$1
- rm -rf ${EPREFIX}/usr/$(get_libdir)/${impl} &>/dev/null || true
-}
-
-standard-impl-postinst() {
- local impl=$1
- case ${impl} in
- cmucl|sbcl)
- impl-restore-timestamp-hack ${impl}
- ;;
- *)
- ;;
- esac
-}
-
-standard-impl-postrm() {
- local impl=$1 impl_binary=$2
- if [ ! -x ${impl_binary} ]; then
- case ${impl} in
- cmucl|sbcl)
- impl-remove-timestamp-hack ${impl}
- ;;
- *)
- ;;
- esac
- rm -rf ${EPREFIX}/var/cache/common-lisp-controller/*/${impl}
- fi
-}
-
-# Local Variables: ***
-# mode: shell-script ***
-# tab-width: 4 ***
-# End: ***
diff --git a/eclass/common-lisp-common.eclass b/eclass/common-lisp-common.eclass
deleted file mode 100644
index 402906a36b..0000000000
--- a/eclass/common-lisp-common.eclass
+++ /dev/null
@@ -1,209 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/common-lisp-common.eclass,v 1.15 2012/06/02 19:16:31 zmedico Exp $
-#
-# Author Matthew Kennedy <mkennedy@gentoo.org>
-#
-# Sundry code common to many Common Lisp related ebuilds.
-
-# Some handy constants
-
-inherit eutils multilib
-
-CLFASLROOT=/usr/$(get_libdir)/common-lisp/
-CLSOURCEROOT=/usr/share/common-lisp/source/
-CLSYSTEMROOT=/usr/share/common-lisp/systems/
-
-# Many of our Common Lisp ebuilds are either inspired by, or actually
-# use packages and files from the Debian project's archives.
-
-do-debian-credits() {
- docinto debian
- for i in copyright README.Debian changelog; do
- # be silent, since all files are not always present
- dodoc "${S}"/debian/${i} &>/dev/null || true
- done
- docinto .
-}
-
-# Most of the code below is from Debian's Common Lisp Controller
-# package
-
-register-common-lisp-implementation() {
- PROGNAME=$(basename $0)
- # first check if there is at least a compiler-name:
- if [ -z "$1" ] ; then
- cat <<EOF
-usage: $PROGNAME compiler-name
-
-registers a Common Lisp compiler to the
-Common-Lisp-Controller system.
-EOF
- exit 1
- fi
- IMPL=$1
- FILE="/usr/$(get_libdir)/common-lisp/bin/$IMPL.sh"
- if [ ! -f "$FILE" ] ; then
- cat <<EOF
-$PROGNAME: I cannot find the script $FILE for the implementation $IMPL
-EOF
- exit 2
- fi
- if [ ! -r "$FILE" ] ; then
- cat <<EOF
-$PROGNAME: I cannot read the script $FILE for the implementation $IMPL
-EOF
- exit 2
- fi
- # install CLC into the lisp
- sh "$FILE" install-clc || (echo "Installation of CLC failed" >&2 ; exit 3)
- mkdir /usr/$(get_libdir)/common-lisp/$IMPL &>/dev/null || true
- chown cl-builder:cl-builder /usr/$(get_libdir)/common-lisp/$IMPL
-
- # now recompile the stuff
- for i in /usr/share/common-lisp/systems/*.asd ; do
- if [ -f $i -a -r $i ] ; then
- i=${i%.asd}
- package=${i##*/}
- clc-autobuild-check $IMPL $package
- if [ $? = 0 ]; then
- echo recompiling package $package for implementation $IMPL
- /usr/bin/clc-send-command --quiet recompile $package $IMPL
- fi
- fi
- done
- for i in /usr/share/common-lisp/systems/*.system ; do
- if [ -f $i -a -r $i ] ; then
- i=${i%.system}
- package=${i##*/}
- clc-autobuild-check $IMPL $package
- if [ $? = 0 ]; then
- echo recompiling package $package for implementation $IMPL
- /usr/bin/clc-send-command --quiet recompile $package $IMPL
- fi
- fi
- done
- echo "$PROGNAME: Compiler $IMPL installed"
-}
-
-unregister-common-lisp-implementation() {
- PROGNAME=$(basename $0)
- if [ `id -u` != 0 ] ; then
- echo $PROGNAME: you need to be root to run this program
- exit 1
- fi
- if [ -z "$1" ] ; then
- cat <<EOF
-usage: $PROGNAME compiler-name
-
-un-registers a Common Lisp compiler to the
-Common-Lisp-Controller system.
-EOF
- exit 1
- fi
- IMPL=$1
- IMPL_BIN="/usr/$(get_libdir)/common-lisp/bin/$IMPL.sh"
- if [ ! -f "$IMPL_BIN" ] ; then
- cat <<EOF
-$PROGNAME: No implementation of the name $IMPL is registered
-Cannot find the file $IMPL_BIN
-
-Maybe you already removed it?
-EOF
- exit 0
- fi
- if [ ! -r "$IMPL_BIN" ] ; then
- cat <<EOF
-$PROGNAME: No implementation of the name $IMPL is registered
-Cannot read the file $IMPL_BIN
-
-Maybe you already removed it?
-EOF
- exit 0
- fi
- # Uninstall the CLC
- sh $IMPL_BIN remove-clc || echo "De-installation of CLC failed" >&2
- clc-autobuild-impl $IMPL inherit
- # Just remove the damn subtree
- (cd / ; rm -rf "/usr/$(get_libdir)/common-lisp/$IMPL/" ; true )
- echo "$PROGNAME: Common Lisp implementation $IMPL uninstalled"
-}
-
-reregister-all-common-lisp-implementations() {
- # Rebuilds all common lisp implementations
- # Written by Kevin Rosenberg <kmr@debian.org>
- # GPL-2 license
- local clc_bin_dir=/usr/$(get_libdir)/common-lisp/bin
- local opt=$(shopt nullglob); shopt -s nullglob
- cd $clc_bin_dir
- for impl_bin in *.sh; do
- impl=$(echo $impl_bin | sed 's/\(.*\).sh/\1/')
- unregister-common-lisp-implementation $impl
- register-common-lisp-implementation $impl
- done
- cd - >/dev/null
- [[ $opt = *off ]] && shopt -u nullglob
-}
-
-# BIG FAT HACK: Since the Portage emerge step kills file timestamp
-# information, we need to compensate by ensuring all FASL files are
-# more recent than their source files.
-
-# The following `impl-*-timestamp-hack' functions SHOULD NOT be used
-# outside of this eclass.
-
-impl-save-timestamp-hack() {
- local impl=$1
- dodir /usr/share/${impl}
- tar cpjf "${ED}"/usr/share/${impl}/portage-timestamp-compensate -C "${ED}"/usr/$(get_libdir)/${impl} .
-}
-
-impl-restore-timestamp-hack() {
- local impl=$1
- tar xjpfo /usr/share/${impl}/portage-timestamp-compensate -C /usr/$(get_libdir)/${impl}
-}
-
-impl-remove-timestamp-hack() {
- local impl=$1
- rm -rf /usr/$(get_libdir)/${impl} &>/dev/null || true
-}
-
-test-in() {
- local symbol=$1
- shift
- for i in $@; do
- if [ $i == ${symbol} ]; then
- return 0 # true
- fi
- done
- false
-}
-
-standard-impl-postinst() {
- local impl=$1
- rm -rf /usr/$(get_libdir)/common-lisp/${impl}/* &>/dev/null || true
- chown cl-builder:cl-builder /usr/$(get_libdir)/common-lisp/${impl}
- if test-in ${impl} cmucl sbcl; then
- impl-restore-timestamp-hack ${impl}
- fi
- chown -R root:0 /usr/$(get_libdir)/${impl}
- /usr/bin/clc-autobuild-impl ${impl} yes
- register-common-lisp-implementation ${impl}
-}
-
-standard-impl-postrm() {
- local impl=$1 impl_binary=$2
- # Since we keep our own time stamps we must manually remove them
- # here.
- if [ ! -x ${impl_binary} ]; then
- if test-in ${impl} cmucl sbcl; then
- impl-remove-timestamp-hack ${impl}
- fi
- rm -rf /usr/$(get_libdir)/common-lisp/${impl}/*
- fi
-}
-
-# Local Variables: ***
-# mode: shell-script ***
-# tab-width: 4 ***
-# End: ***
diff --git a/eclass/depend.apache.eclass b/eclass/depend.apache.eclass
deleted file mode 100644
index f5dd22ebec..0000000000
--- a/eclass/depend.apache.eclass
+++ /dev/null
@@ -1,318 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.47 2012/04/20 07:22:47 patrick Exp $
-
-# @ECLASS: depend.apache.eclass
-# @MAINTAINER:
-# apache-devs@gentoo.org
-# @BLURB: Functions to allow ebuilds to depend on apache
-# @DESCRIPTION:
-# This eclass handles depending on apache in a sane way and provides information
-# about where certain binaries and configuration files are located.
-#
-# To make use of this eclass simply call one of the need/want_apache functions
-# described below. Make sure you use the need/want_apache call after you have
-# defined DEPEND and RDEPEND. Also note that you can not rely on the automatic
-# RDEPEND=DEPEND that portage does if you use this eclass.
-#
-# See Bug 107127 for more information.
-#
-# @EXAMPLE:
-#
-# Here is an example of an ebuild depending on apache:
-#
-# @CODE
-# DEPEND="virtual/Perl-CGI"
-# RDEPEND="${DEPEND}"
-# need_apache2
-# @CODE
-#
-# Another example which demonstrates non-standard IUSE options for optional
-# apache support:
-#
-# @CODE
-# DEPEND="server? ( virtual/Perl-CGI )"
-# RDEPEND="${DEPEND}"
-# want_apache2 server
-#
-# pkg_setup() {
-# depend.apache_pkg_setup server
-# }
-# @CODE
-
-inherit multilib
-
-# ==============================================================================
-# INTERNAL VARIABLES
-# ==============================================================================
-
-# @ECLASS-VARIABLE: APACHE_VERSION
-# @DESCRIPTION:
-# Stores the version of apache we are going to be ebuilding.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APXS
-# @DESCRIPTION:
-# Path to the apxs tool.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APACHE_BIN
-# @DESCRIPTION:
-# Path to the apache binary.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APACHE_CTL
-# @DESCRIPTION:
-# Path to the apachectl tool.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APACHE_BASEDIR
-# @DESCRIPTION:
-# Path to the server root directory.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APACHE_CONFDIR
-# @DESCRIPTION:
-# Path to the configuration file directory.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APACHE_MODULES_CONFDIR
-# @DESCRIPTION:
-# Path where module configuration files are kept.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APACHE_VHOSTS_CONFDIR
-# @DESCRIPTION:
-# Path where virtual host configuration files are kept.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APACHE_MODULESDIR
-# @DESCRIPTION:
-# Path where we install modules.
-# This variable is set by the want/need_apache functions.
-
-# @ECLASS-VARIABLE: APACHE_DEPEND
-# @DESCRIPTION:
-# Dependencies for Apache
-APACHE_DEPEND="www-servers/apache"
-
-# @ECLASS-VARIABLE: APACHE2_DEPEND
-# @DESCRIPTION:
-# Dependencies for Apache 2.x
-APACHE2_DEPEND="=www-servers/apache-2*"
-
-# @ECLASS-VARIABLE: APACHE2_2_DEPEND
-# @DESCRIPTION:
-# Dependencies for Apache 2.2.x
-APACHE2_2_DEPEND="=www-servers/apache-2.2*"
-
-# @ECLASS-VARIABLE: APACHE2_4_DEPEND
-# @DESCRIPTION:
-# Dependencies for Apache 2.4.x
-APACHE2_4_DEPEND="=www-servers/apache-2.4*"
-
-
-# ==============================================================================
-# INTERNAL FUNCTIONS
-# ==============================================================================
-
-_init_apache2() {
- debug-print-function $FUNCNAME $*
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
-
- # WARNING: Do not use these variables with anything that is put
- # into the dependency cache (DEPEND/RDEPEND/etc)
- APACHE_VERSION="2"
- APXS="${EPREFIX}/usr/sbin/apxs2"
- APACHE_BIN="${EPREFIX}/usr/sbin/apache2"
- APACHE_CTL="${EPREFIX}/usr/sbin/apache2ctl"
- APACHE_INCLUDEDIR="${EPREFIX}/usr/include/apache2"
- APACHE_BASEDIR="${EPREFIX}/usr/$(get_libdir)/apache2"
- APACHE_CONFDIR="${EPREFIX}/etc/apache2"
- APACHE_MODULES_CONFDIR="${APACHE_CONFDIR#${EPREFIX}}/modules.d"
- APACHE_VHOSTS_CONFDIR="${APACHE_CONFDIR#${EPREFIX}}/vhosts.d"
- APACHE_MODULESDIR="${APACHE_BASEDIR#${EPREFIX}}/modules"
-}
-
-_init_no_apache() {
- debug-print-function $FUNCNAME $*
- APACHE_VERSION="0"
-}
-
-# ==============================================================================
-# PUBLIC FUNCTIONS
-# ==============================================================================
-
-# @FUNCTION: depend.apache_pkg_setup
-# @USAGE: [myiuse]
-# @DESCRIPTION:
-# An ebuild calls this in pkg_setup() to initialize variables for optional
-# apache-2.x support. If the myiuse parameter is not given it defaults to
-# apache2.
-depend.apache_pkg_setup() {
- debug-print-function $FUNCNAME $*
-
- if [[ "${EBUILD_PHASE}" != "setup" ]]; then
- die "$FUNCNAME() should be called in pkg_setup()"
- fi
-
- local myiuse=${1:-apache2}
- if has ${myiuse} ${IUSE}; then
- if use ${myiuse}; then
- _init_apache2
- else
- _init_no_apache
- fi
- fi
-}
-
-# @FUNCTION: want_apache
-# @USAGE: [myiuse]
-# @DESCRIPTION:
-# An ebuild calls this to get the dependency information for optional apache
-# support. If the myiuse parameter is not given it defaults to apache2.
-# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup()
-# with the same myiuse parameter.
-want_apache() {
- debug-print-function $FUNCNAME $*
- want_apache2 "$@"
-}
-
-# @FUNCTION: want_apache2
-# @USAGE: [myiuse]
-# @DESCRIPTION:
-# An ebuild calls this to get the dependency information for optional apache-2.x
-# support. If the myiuse parameter is not given it defaults to apache2.
-# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup()
-# with the same myiuse parameter.
-want_apache2() {
- debug-print-function $FUNCNAME $*
-
- local myiuse=${1:-apache2}
- IUSE="${IUSE} ${myiuse}"
- DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
- RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
-}
-
-# @FUNCTION: want_apache2_2
-# @USAGE: [myiuse]
-# @DESCRIPTION:
-# An ebuild calls this to get the dependency information for optional
-# apache-2.2.x support. If the myiuse parameter is not given it defaults to
-# apache2.
-# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup()
-# with the same myiuse parameter.
-want_apache2_2() {
- debug-print-function $FUNCNAME $*
-
- local myiuse=${1:-apache2}
- IUSE="${IUSE} ${myiuse}"
- DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
- RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
-}
-
-# @FUNCTION: need_apache
-# @DESCRIPTION:
-# An ebuild calls this to get the dependency information for apache.
-need_apache() {
- debug-print-function $FUNCNAME $*
- need_apache2
-}
-
-# @FUNCTION: need_apache2
-# @DESCRIPTION:
-# An ebuild calls this to get the dependency information for apache-2.x.
-need_apache2() {
- debug-print-function $FUNCNAME $*
-
- DEPEND="${DEPEND} ${APACHE2_DEPEND}"
- RDEPEND="${RDEPEND} ${APACHE2_DEPEND}"
- _init_apache2
-}
-
-# @FUNCTION: need_apache2_2
-# @DESCRIPTION:
-# An ebuild calls this to get the dependency information for apache-2.2.x.
-need_apache2_2() {
- debug-print-function $FUNCNAME $*
-
- DEPEND="${DEPEND} ${APACHE2_2_DEPEND}"
- RDEPEND="${RDEPEND} ${APACHE2_2_DEPEND}"
- _init_apache2
-}
-
-# @FUNCTION: need_apache2_4
-# @DESCRIPTION:
-# An ebuild calls this to get the dependency information for apache-2.4.x.
-need_apache2_4() {
- debug-print-function $FUNCNAME $*
-
- DEPEND="${DEPEND} ${APACHE2_4_DEPEND}"
- RDEPEND="${RDEPEND} ${APACHE2_4_DEPEND}"
- _init_apache2
-}
-
-# @FUNCTION: has_apache
-# @DESCRIPTION:
-# An ebuild calls this to get runtime variables for an indirect apache
-# dependency without USE-flag, in which case want_apache does not work.
-# DO NOT call this function in global scope.
-has_apache() {
- debug-print-function $FUNCNAME $*
-
- if has_version '>=www-servers/apache-2'; then
- _init_apache2
- else
- _init_no_apache
- fi
-}
-
-# @FUNCTION: has_apache_threads
-# @USAGE: [myflag]
-# @DESCRIPTION:
-# An ebuild calls this to make sure thread-safety is enabled if apache has been
-# built with a threaded MPM. If the myflag parameter is not given it defaults to
-# threads.
-has_apache_threads() {
- debug-print-function $FUNCNAME $*
-
- if ! built_with_use www-servers/apache threads; then
- return
- fi
-
- local myflag="${1:-threads}"
-
- if ! use ${myflag}; then
- echo
- eerror "You need to enable USE flag '${myflag}' to build a thread-safe version"
- eerror "of ${CATEGORY}/${PN} for use with www-servers/apache"
- die "Need missing USE flag '${myflag}'"
- fi
-}
-
-# @FUNCTION: has_apache_threads_in
-# @USAGE: <myforeign> [myflag]
-# @DESCRIPTION:
-# An ebuild calls this to make sure thread-safety is enabled in a foreign
-# package if apache has been built with a threaded MPM. If the myflag parameter
-# is not given it defaults to threads.
-has_apache_threads_in() {
- debug-print-function $FUNCNAME $*
-
- if ! built_with_use www-servers/apache threads; then
- return
- fi
-
- local myforeign="$1"
- local myflag="${2:-threads}"
-
- if ! built_with_use ${myforeign} ${myflag}; then
- echo
- eerror "You need to enable USE flag '${myflag}' in ${myforeign} to"
- eerror "build a thread-safe version of ${CATEGORY}/${PN} for use"
- eerror "with www-servers/apache"
- die "Need missing USE flag '${myflag}' in ${myforeign}"
- fi
-}
-
-EXPORT_FUNCTIONS pkg_setup
diff --git a/eclass/depend.php.eclass b/eclass/depend.php.eclass
deleted file mode 100644
index 5ce5228e42..0000000000
--- a/eclass/depend.php.eclass
+++ /dev/null
@@ -1,581 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.32 2012/06/02 19:16:31 zmedico Exp $
-
-# @ECLASS: depend.php.eclass
-# @MAINTAINER:
-# Gentoo PHP team <php-bugs@gentoo.org>
-# @AUTHOR:
-# Author: Stuart Herbert <stuart@gentoo.org>
-# Author: Luca Longinotti <chtekk@gentoo.org>
-# Author: Jakub Moc <jakub@gentoo.org> (documentation)
-# @BLURB: Functions to allow ebuilds to depend on php5 and check for specific features.
-# @DESCRIPTION:
-# This eclass provides functions that allow ebuilds to depend on php5 and check
-# for specific PHP features, SAPIs etc. Also provides dodoc-php wrapper to install
-# documentation for PHP packages to php-specific location.
-
-inherit eutils multilib phpconfutils
-
-# PHP5-only depend functions
-
-# @FUNCTION: need_php5_cli
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
-# with cli SAPI.
-need_php5_cli() {
- DEPEND="${DEPEND} =dev-lang/php-5*"
- RDEPEND="${RDEPEND} =dev-lang/php-5*"
- PHP_VERSION="5"
-}
-
-# @FUNCTION: need_php5_httpd
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
-# with either cgi or apache2 SAPI.
-need_php5_httpd() {
- DEPEND="${DEPEND} =virtual/httpd-php-5*"
- RDEPEND="${RDEPEND} =virtual/httpd-php-5*"
- PHP_VERSION="5"
-}
-
-# @FUNCTION: need_php5
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
-# (with any SAPI).
-need_php5() {
- DEPEND="${DEPEND} =dev-lang/php-5*"
- RDEPEND="${RDEPEND} =dev-lang/php-5*"
- PHP_VERSION="5"
- PHP_SHARED_CAT="php5"
-}
-
-# common settings go in here
-uses_php5() {
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
- # cache this
- libdir=$(get_libdir)
-
- PHPIZE="${EPREFIX}/usr/${libdir}/php5/bin/phpize"
- PHPCONFIG="${EPREFIX}/usr/${libdir}/php5/bin/php-config"
- PHPCLI="${EPREFIX}/usr/${libdir}/php5/bin/php"
- PHPCGI="${EPREFIX}/usr/${libdir}/php5/bin/php-cgi"
- PHP_PKG="$(best_version =dev-lang/php-5*)"
- PHPPREFIX="${EPREFIX}/usr/${libdir}/php5"
- EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
-
- einfo
- einfo "Using ${PHP_PKG}"
- einfo
-}
-
-# general PHP depend functions
-
-# @FUNCTION: need_php_cli
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
-# (any version) with cli SAPI.
-need_php_cli() {
- DEPEND="${DEPEND} dev-lang/php"
- RDEPEND="${RDEPEND} dev-lang/php"
-}
-
-# @FUNCTION: need_php_httpd
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
-# (any version) with either cgi or apache2 SAPI.
-need_php_httpd() {
- DEPEND="${DEPEND} virtual/httpd-php"
- RDEPEND="${RDEPEND} virtual/httpd-php"
-}
-
-# @FUNCTION: need_php
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
-# (any version with any SAPI).
-need_php() {
- DEPEND="${DEPEND} dev-lang/php"
- RDEPEND="${RDEPEND} dev-lang/php"
- PHP_SHARED_CAT="php"
-}
-
-# @FUNCTION: need_php_by_category
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild to depend on PHP version
-# determined by ${CATEGORY} - any PHP version or PHP5 for dev-php or
-# dev-php5, respectively.
-need_php_by_category() {
- case "${CATEGORY}" in
- dev-php) need_php ;;
- *) die "Version of PHP required by packages in category ${CATEGORY} unknown"
- esac
-}
-
-
-# @FUNCTION: has_php
-# @DESCRIPTION:
-# Call this function from your pkg_setup, src_compile, src_install etc. if you
-# need to know which PHP version is being used and where the PHP binaries/data
-# are installed.
-has_php() {
- # Detect which PHP version we have installed
- if has_version '=dev-lang/php-5*' ; then
- PHP_VERSION="5"
- else
- die "Unable to find an installed dev-lang/php package"
- fi
-
- # If we get here, then PHP_VERSION tells us which version of PHP we
- # want to use
- uses_php${PHP_VERSION}
-}
-
-# @FUNCTION: require_php_sapi_from
-# @USAGE: <list of SAPIs>
-# @DESCRIPTION:
-# Call this function from pkg_setup if your package only works with
-# specific SAPI(s) and specify a list of PHP SAPI USE flags that are
-# required (one or more from cli, cgi, apache2) as arguments.
-# Returns if any of the listed SAPIs have been installed, dies if none
-# of them is available.
-#
-# Unfortunately, if you want to be really sure that the required SAPI is
-# provided by PHP, you will have to use this function or similar ones (like
-# require_php_cli or require_php_cgi) in pkg_setup until we are able to
-# depend on USE flags being enabled. The above described need_php[45]_cli
-# and need_php[45]_httpd functions cannot guarantee these requirements.
-# See Bug 2272 for details.
-require_php_sapi_from() {
- has_php
-
- local has_sapi="0"
- local x
-
- einfo "Checking for compatible SAPI(s)"
-
- for x in $@ ; do
- if built_with_use =${PHP_PKG} ${x} || phpconfutils_built_with_use =${PHP_PKG} ${x} ; then
- einfo " Discovered compatible SAPI ${x}"
- has_sapi="1"
- fi
- done
-
- if [[ "${has_sapi}" == "1" ]] ; then
- return
- fi
-
- eerror
- eerror "${PHP_PKG} needs to be re-installed with one of the following"
- eerror "USE flags enabled:"
- eerror
- eerror " $@"
- eerror
- die "No compatible PHP SAPIs found"
-}
-
-# @FUNCTION: require_php_with_use
-# @USAGE: <list of USE flags>
-# @DESCRIPTION:
-# Call this function from pkg_setup if your package requires PHP compiled
-# with specific USE flags. Returns if all of the listed USE flags are enabled.
-# Dies if any of the listed USE flags are disabled.
-
-# @VARIABLE: PHPCHECKNODIE
-# @DESCRIPTION:
-# You can set PHPCHECKNODIE to non-empty value in your ebuild to chain multiple
-# require_php_with_(any)_use checks without making the ebuild die on every failure.
-# This is useful in cases when certain PHP features are only required if specific
-# USE flag(s) are enabled for that ebuild.
-# @CODE
-# Example:
-#
-# local flags="pcre session snmp sockets wddx"
-# use mysql && flags="${flags} mysql"
-# use postgres && flags="${flags} postgres"
-# if ! PHPCHECKNODIE="yes" require_php_with_use ${flags} \
-# || ! PHPCHECKNODIE="yes" require_php_with_any_use gd gd-external ; then
-# die "Re-install ${PHP_PKG} with ${flags} and either gd or gd-external"
-# fi
-# @CODE
-require_php_with_use() {
- has_php
-
- local missing_use=""
- local x
-
- einfo "Checking for required PHP feature(s) ..."
-
- for x in $@ ; do
- case $x in
- pcre|spl|reflection|mhash)
- eqawarn "require_php_with_use MUST NOT check for the pcre, spl, mhash or reflection USE flag."
- eqawarn "These USE flags are removed from >=dev-lang/php-5.3 and your ebuild will break"
- eqawarn "if you check the USE flags against PHP 5.3 ebuilds."
- eqawarn "Please use USE dependencies from EAPI 2 instead"
- ;;
- esac
-
- if ! built_with_use =${PHP_PKG} ${x} && ! phpconfutils_built_with_use =${PHP_PKG} ${x} ; then
- einfo " Discovered missing USE flag: ${x}"
- missing_use="${missing_use} ${x}"
- fi
- done
-
- if [[ -z "${missing_use}" ]] ; then
- if [[ -z "${PHPCHECKNODIE}" ]] ; then
- return
- else
- return 0
- fi
- fi
-
- if [[ -z "${PHPCHECKNODIE}" ]] ; then
- eerror
- eerror "${PHP_PKG} needs to be re-installed with all of the following"
- eerror "USE flags enabled:"
- eerror
- eerror " $@"
- eerror
- die "Missing PHP USE flags found"
- else
- return 1
- fi
-}
-
-# @FUNCTION: require_php_with_any_use
-# @USAGE: <list of USE flags>
-# @DESCRIPTION:
-# Call this function from pkg_setup if your package requires PHP compiled with
-# any of specified USE flags. Returns if any of the listed USE flags are enabled.
-# Dies if all of the listed USE flags are disabled.
-require_php_with_any_use() {
- has_php
-
- local missing_use=""
- local x
-
- einfo "Checking for required PHP feature(s) ..."
-
- for x in $@ ; do
- if built_with_use =${PHP_PKG} ${x} || phpconfutils_built_with_use =${PHP_PKG} ${x} ; then
- einfo " USE flag ${x} is enabled, ok ..."
- return
- else
- missing_use="${missing_use} ${x}"
- fi
- done
-
- if [[ -z "${missing_use}" ]] ; then
- if [[ -z "${PHPCHECKNODIE}" ]] ; then
- return
- else
- return 0
- fi
- fi
-
- if [[ -z "${PHPCHECKNODIE}" ]] ; then
- eerror
- eerror "${PHP_PKG} needs to be re-installed with any of the following"
- eerror "USE flags enabled:"
- eerror
- eerror " $@"
- eerror
- die "Missing PHP USE flags found"
- else
- return 1
- fi
-}
-
-# ========================================================================
-# has_*() functions
-#
-# These functions return 0 if the condition is satisfied, 1 otherwise
-# ========================================================================
-
-# @FUNCTION: has_zts
-# @DESCRIPTION:
-# Check if our PHP was compiled with ZTS (Zend Thread Safety) enabled.
-# @RETURN: 0 if true, 1 otherwise
-has_zts() {
- has_php
-
- if built_with_use =${PHP_PKG} apache2 threads || phpconfutils_built_with_use =${PHP_PKG} apache2 threads ; then
- return 0
- fi
-
- return 1
-}
-
-# @FUNCTION: has_debug
-# @DESCRIPTION:
-# Check if our PHP was built with debug support enabled.
-# @RETURN: 0 if true, 1 otherwise
-has_debug() {
- has_php
-
- if built_with_use =${PHP_PKG} debug || phpconfutils_built_with_use =${PHP_PKG} debug ; then
- return 0
- fi
-
- return 1
-}
-
-# @FUNCTION: has_concurrentmodphp
-# @DESCRIPTION:
-# Check if our PHP was built with the concurrentmodphp support enabled.
-# @RETURN: 0 if true, 1 otherwise
-has_concurrentmodphp() {
- has_php
-
- if built_with_use =${PHP_PKG} apache2 concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} apache2 concurrentmodphp ; then
- return 0
- fi
-
- return 1
-}
-
-# ========================================================================
-# require_*() functions
-#
-# These functions die() if PHP was built without the required features
-# ========================================================================
-
-# @FUNCTION: require_pdo
-# @DESCRIPTION:
-# Require a PHP built with PDO support (PHP5 only).
-# This function is now redundant and DEPRECATED since
-# pdo-external use flag and pecl-pdo-* ebuilds were removed.
-# You should use require_php_with_use pdo instead now.
-# @RETURN: die if feature is missing
-require_pdo() {
- has_php
-
- # Was PHP5 compiled with internal PDO support?
- if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then
- return
- else
- eerror
- eerror "No PDO extension for PHP found."
- eerror "Please note that PDO only exists for PHP 5."
- eerror "Please install a PDO extension for PHP 5."
- eerror "You must install >=dev-lang/php-5.1 with USE=\"pdo\"."
- eerror
- die "No PDO extension for PHP 5 found"
- fi
-}
-
-# @FUNCTION: require_php_cli
-# @DESCRIPTION:
-# Determines which installed PHP version has the CLI SAPI enabled.
-# Useful for PEAR stuff, or anything which needs to run PHP script
-# depending on the CLI SAPI.
-# @RETURN: die if feature is missing
-require_php_cli() {
- # If PHP_PKG is set, then we have remembered our PHP settings
- # from last time
- if [[ -n ${PHP_PKG} ]] ; then
- return
- fi
-
- local PHP_PACKAGE_FOUND=""
-
- if has_version '=dev-lang/php-5*' ; then
- PHP_PACKAGE_FOUND="1"
- pkg="$(best_version '=dev-lang/php-5*')"
- if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then
- PHP_VERSION="5"
- fi
- fi
-
- if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
- die "Unable to find an installed dev-lang/php package"
- fi
-
- if [[ -z ${PHP_VERSION} ]] ; then
- die "No PHP CLI installed. Re-emerge dev-lang/php with USE=cli."
- fi
-
- # If we get here, then PHP_VERSION tells us which version of PHP we
- # want to use
- uses_php${PHP_VERSION}
-}
-
-# @FUNCTION: require_php_cgi
-# @DESCRIPTION:
-# Determines which installed PHP version has the CGI SAPI enabled.
-# Useful for anything which needs to run PHP scripts depending on the CGI SAPI.
-# @RETURN: die if feature is missing
-require_php_cgi() {
- # If PHP_PKG is set, then we have remembered our PHP settings
- # from last time
- if [[ -n ${PHP_PKG} ]] ; then
- return
- fi
-
- local PHP_PACKAGE_FOUND=""
-
- if has_version '=dev-lang/php-5*' ; then
- PHP_PACKAGE_FOUND="1"
- pkg="$(best_version '=dev-lang/php-5*')"
- if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then
- PHP_VERSION="5"
- fi
- fi
-
- if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
- die "Unable to find an installed dev-lang/php package"
- fi
-
- if [[ -z ${PHP_VERSION} ]] ; then
- die "No PHP CGI installed. Re-emerge dev-lang/php with USE=cgi."
- fi
-
- # If we get here, then PHP_VERSION tells us which version of PHP we
- # want to use
- uses_php${PHP_VERSION}
-}
-
-# @FUNCTION: require_sqlite
-# @DESCRIPTION:
-# Require a PHP built with SQLite support
-# @RETURN: die if feature is missing
-require_sqlite() {
- has_php
-
- # Has our PHP been built with SQLite support?
- if built_with_use =${PHP_PKG} sqlite || phpconfutils_built_with_use =${PHP_PKG} sqlite ; then
- return
- fi
-
- # If we get here, then we don't have any SQLite support for PHP installed
- eerror
- eerror "No SQLite extension for PHP found."
- eerror "Please install an SQLite extension for PHP,"
- eerror "this is done best by simply adding the"
- eerror "'sqlite' USE flag when emerging dev-lang/php."
- eerror
- die "No SQLite extension for PHP found"
-}
-
-# @FUNCTION: require_gd
-# @DESCRIPTION:
-# Require a PHP built with GD support
-# @RETURN: die if feature is missing
-require_gd() {
- has_php
-
- # Do we have the internal GD support installed?
- if built_with_use =${PHP_PKG} gd || phpconfutils_built_with_use =${PHP_PKG} gd ; then
- return
- fi
-
- # Ok, maybe GD was built using the external library support?
- if built_with_use =${PHP_PKG} gd-external || phpconfutils_built_with_use =${PHP_PKG} gd-external ; then
- return
- fi
-
- # If we get here, then we have no GD support
- eerror
- eerror "No GD support for PHP found."
- eerror "Please install the GD support for PHP,"
- eerror "you must install dev-lang/php with either"
- eerror "the 'gd' or the 'gd-external' USE flags"
- eerror "turned on."
- eerror
- die "No GD support found for PHP"
-}
-
-# ========================================================================
-# Misc functions
-#
-# These functions provide miscellaneous checks and functionality.
-# ========================================================================
-
-# @FUNCTION: php_binary_extension
-# @DESCRIPTION:
-# Executes some checks needed when installing a binary PHP extension.
-php_binary_extension() {
- has_php
-
- local PUSE_ENABLED=""
-
- # Binary extensions do not support the change of PHP
- # API version, so they can't be installed when USE flags
- # are enabled which change the PHP API version, they also
- # don't provide correctly versioned symbols for our use
-
- if has_debug ; then
- eerror
- eerror "You cannot install binary PHP extensions"
- eerror "when the 'debug' USE flag is enabled!"
- eerror "Please reemerge dev-lang/php with the"
- eerror "'debug' USE flag turned off."
- eerror
- PUSE_ENABLED="1"
- fi
-
- if has_concurrentmodphp ; then
- eerror
- eerror "You cannot install binary PHP extensions when"
- eerror "the 'concurrentmodphp' USE flag is enabled!"
- eerror "Please reemerge dev-lang/php with the"
- eerror "'concurrentmodphp' USE flag turned off."
- eerror
- PUSE_ENABLED="1"
- fi
-
- if [[ -n ${PUSE_ENABLED} ]] ; then
- die "'debug' and/or 'concurrentmodphp' USE flags turned on!"
- fi
-}
-
-# @FUNCTION: dodoc-php
-# @USAGE: <list of docs>
-# @DESCRIPTION:
-# Alternative to dodoc function for use in our PHP eclasses and ebuilds.
-# Stored here because depend.php gets always sourced everywhere in the PHP
-# ebuilds and eclasses. It simply is dodoc with a changed path to the docs.
-# NOTE: No support for docinto is provided!
-dodoc-php() {
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-phpdocdir="/usr/share/doc/${CATEGORY}/${PF}/"
-
-for x in $@ ; do
- if [[ -s "${x}" ]] ; then
- insinto "${phpdocdir}"
- doins "${x}"
- gzip -f -9 "${ED}/${phpdocdir}/${x##*/}"
- elif [[ ! -e "${x}" ]] ; then
- echo "dodoc-php: ${x} does not exist" 1>&2
- fi
-done
-}
-
-# @FUNCTION: dohtml-php
-# @USAGE: <list of html docs>
-# @DESCRIPTION:
-# Alternative to dohtml function for use in our PHP eclasses and ebuilds.
-# Stored here because depend.php gets always sourced everywhere in the PHP
-# ebuilds and eclasses. It simply is dohtml with a changed path to the docs.
-# NOTE: No support for [-a|-A|-p|-x] options is provided!
-dohtml-php() {
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-phphtmldir="/usr/share/doc/${CATEGORY}/${PF}/html"
-
-for x in $@ ; do
- if [[ -s "${x}" ]] ; then
- insinto "${phphtmldir}"
- doins "${x}"
- elif [[ ! -e "${x}" ]] ; then
- echo "dohtml-php: ${x} does not exist" 1>&2
- fi
-done
-}
diff --git a/eclass/embassy.eclass b/eclass/embassy.eclass
deleted file mode 100644
index 58f9bc6f2f..0000000000
--- a/eclass/embassy.eclass
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/embassy.eclass,v 1.19 2012/09/15 16:16:53 zmedico Exp $
-
-# Author Olivier Fisette <ribosome@gentoo.org>
-
-# This eclass is used to install EMBASSY programs (EMBOSS add-ons).
-
-# The inheriting ebuild should provide a "DESCRIPTION", "KEYWORDS" and, if
-# necessary, add "(R|P)DEPEND"encies. Additionnaly, the inheriting ebuild's
-# name must begin by "embassy-". Also, before inheriting, the ebuild should
-# specify what version of EMBOSS is required by setting EBOV.
-
-inherit eutils multilib
-
-# The EMBASSY package name, retrieved from the inheriting ebuild's name
-EN=${PN:8}
-# The full name and version of the EMBASSY package (excluding the Gentoo
-# revision number)
-EF="$(echo ${EN} | tr "[:lower:]" "[:upper:]")-${PV}"
-
-HOMEPAGE="http://emboss.sourceforge.net/"
-LICENSE="LGPL-2 GPL-2"
-SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/EMBOSS-${EBOV}.tar.gz
- ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz"
-
-SLOT="0"
-IUSE="X png"
-
-DEPEND="=sci-biology/emboss-${EBOV}*
- !<sci-biology/emboss-${EBOV}
- X? ( x11-libs/libX11 )
- png? ( sys-libs/zlib
- media-libs/libpng
- >=media-libs/gd-1.8
- )"
-
-S=${WORKDIR}/EMBOSS-${EBOV}/embassy/${EF}
-
-embassy_src_unpack() {
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
- unpack ${A}
- mkdir EMBOSS-${EBOV}/embassy
- mv ${EF} EMBOSS-${EBOV}/embassy/
- cp "${EPREFIX}"/usr/$(get_libdir)/libplplot.la EMBOSS-${EBOV}/plplot/
- cp "${EPREFIX}"/usr/$(get_libdir)/libeplplot.la EMBOSS-${EBOV}/plplot/
- cp "${EPREFIX}"/usr/$(get_libdir)/libajax.la EMBOSS-${EBOV}/ajax/
- cp "${EPREFIX}"/usr/$(get_libdir)/libajaxg.la EMBOSS-${EBOV}/ajax/
- cp "${EPREFIX}"/usr/$(get_libdir)/libnucleus.la EMBOSS-${EBOV}/nucleus/
- if [ -e "${FILESDIR}"/${PF}.patch ]; then
- cd "${S}"
- epatch "${FILESDIR}"/${PF}.patch
- fi
-}
-
-embassy_src_compile() {
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" && PREFIX=
- local PREFIX="${EROOT}/usr" # grobian: this feels so bad, ROOT in here
- local EXTRA_CONF
- ! use X && EXTRA_CONF="${EXTRA_CONF} --without-x"
- ! use png && EXTRA_CONF="${EXTRA_CONF} --without-pngdriver"
- ./configure \
- "--bindir=${PREFIX}/bin" \
- "--sbindir=${PREFIX}/sbin" \
- "--libexecdir=${PREFIX}/libexec" \
- "--sysconfdir=${EROOT}/etc" \
- "--sharedstatedir=${EROOT}/var" \
- "--localstatedir=${EROOT}/var" \
- "--libdir=${PREFIX}/$(get_libdir)" \
- "--includedir=${PREFIX}/include" \
- "--datarootdir=${PREFIX}/share" \
- "--datadir=${PREFIX}/share" \
- "--infodir=${PREFIX}/share/info" \
- "--localedir=${PREFIX}/share/locale" \
- "--mandir=${PREFIX}/share/man" \
- ${EXTRA_CONF} || die
- emake || die "Before reporting this error as a bug, please make sure you compiled
- EMBOSS and the EMBASSY packages with the same \"USE\" flags. Failure to
- do so may prevent the compilation of some EMBASSY packages, or cause
- runtime problems with some EMBASSY programs. For example, if you
- compile EMBOSS with \"png\" support and then try to build DOMAINATRIX
- without \"png\" support, compilation will fail when linking the binaries."
-}
-
-embassy_src_install() {
- has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
- emake DESTDIR="${D}" install || die "Install failed"
- dodoc AUTHORS ChangeLog NEWS README
- dodir /usr/share
- mv "${ED}"/usr/local/share/* "${ED}"/usr/share/
- rmdir "${ED}"/usr/local/share
- rmdir "${ED}"/usr/local
-}
-
-EXPORT_FUNCTIONS src_unpack src_compile src_install
diff --git a/eclass/games-ggz.eclass b/eclass/games-ggz.eclass
deleted file mode 100644
index df60c671ff..0000000000
--- a/eclass/games-ggz.eclass
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/games-ggz.eclass,v 1.9 2012/09/27 16:35:41 axs Exp $
-
-inherit base
-
-# For GGZ Gaming Zone packages
-
-GAMES_GGZ_EXPF="src_compile src_install pkg_postinst pkg_postrm"
-case "${EAPI:-0}" in
- 2|3|4|5) GAMES_GGZ_EXPF+=" src_configure" ;;
- 0|1) : ;;
- *) die "EAPI=${EAPI} is not supported" ;;
-esac
-EXPORT_FUNCTIONS ${GAMES_GGZ_EXPF}
-
-HOMEPAGE="http://www.ggzgamingzone.org/"
-SRC_URI="mirror://ggz/${PV}/${P}.tar.gz"
-
-GGZ_MODDIR="/usr/share/ggz/modules"
-
-games-ggz_src_configure() {
- local reg="--enable-noregistry=\"${EPREFIX}${GGZ_MODDIR}\""
- [[ ${PN} == ggz-client-libs ]] && reg=''
- econf \
- --disable-dependency-tracking \
- $reg \
- $(has debug ${IUSE} && ! use debug && echo --disable-debug) \
- "$@"
-}
-
-games-ggz_src_compile() {
- has src_configure ${GAMES_GGZ_EXPF} || games-ggz_src_configure
- emake || die "emake failed"
-}
-
-games-ggz_src_install() {
- emake DESTDIR="${D}" install || die "emake install failed"
- local f
- for f in AUTHORS ChangeLog NEWS QuickStart.GGZ README* TODO ; do
- [[ -f ${f} ]] && dodoc ${f}
- done
-}
-
-# Update ggz.modules with the .dsc files from ${GGZ_MODDIR}.
-games-ggz_update_modules() {
- [[ ${EBUILD_PHASE} == "postinst" || ${EBUILD_PHASE} == "postrm" ]] \
- || die "${FUNCNAME} can only be used in pkg_postinst or pkg_postrm"
-
- # ggz-config needs libggz, so it could be broken
- ggz-config -h &> /dev/null || return 1
-
- local confdir=${EROOT}/etc
- local moddir=${EROOT}/${GGZ_MODDIR}
- local dsc rval=0
-
- mkdir -p "${confdir}"
- echo -n > "${confdir}"/ggz.modules
- if [[ -d ${moddir} ]] ; then
- ebegin "Updating GGZ modules"
- cd "${moddir}"
- find . -type f -name '*.dsc' | while read dsc ; do
- DESTDIR=${ROOT} ggz-config -Dim "${dsc}" || ((rval++))
- done
- eend ${rval}
- fi
- return ${rval}
-}
-
-# Register new modules
-games-ggz_pkg_postinst() {
- games-ggz_update_modules
-}
-
-# Unregister old modules
-games-ggz_pkg_postrm() {
- games-ggz_update_modules
-}
diff --git a/eclass/games.eclass b/eclass/games.eclass
deleted file mode 100644
index b54802750a..0000000000
--- a/eclass/games.eclass
+++ /dev/null
@@ -1,396 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/games.eclass,v 1.159 2014/11/21 21:47:16 hasufell Exp $
-
-# @ECLASS: games
-# @MAINTAINER:
-# Games team <games@gentoo.org>
-# @BLURB: Standardizing the install of games.
-# @DESCRIPTION:
-# This eclass makes sure that games are consistently handled in gentoo.
-# It installs game files by default in FHS-compatible directories
-# like /usr/share/games and sets more restrictive permissions in order
-# to avoid some security bugs.
-#
-# The installation directories as well as the user and group files are
-# installed as can be controlled by the user. See the variables like
-# GAMES_BINDIR, GAMES_USER etc. below. These are NOT supposed to be set
-# by ebuilds!
-#
-# For a general guide on writing games ebuilds, see:
-# https://wiki.gentoo.org/wiki/Project:Games/Ebuild_howto
-
-
-if [[ -z ${_GAMES_ECLASS} ]]; then
-_GAMES_ECLASS=1
-
-inherit base multilib toolchain-funcs eutils user
-
-case ${EAPI:-0} in
- 0|1) EXPORT_FUNCTIONS pkg_setup src_compile pkg_preinst pkg_postinst ;;
- 2|3|4|5) EXPORT_FUNCTIONS pkg_setup src_configure src_compile pkg_preinst pkg_postinst ;;
- *) die "no support for EAPI=${EAPI} yet" ;;
-esac
-
-if [[ ${CATEGORY}/${PN} != "games-misc/games-envd" ]] ; then
- # environment file
- RDEPEND="games-misc/games-envd"
-fi
-
-# @ECLASS-VARIABLE: GAMES_PREFIX
-# @DESCRIPTION:
-# Prefix where to install games, mostly used by GAMES_BINDIR. Games data should
-# still go into GAMES_DATADIR. May be set by the user.
-GAMES_PREFIX=${GAMES_PREFIX:-/usr/games}
-
-# @ECLASS-VARIABLE: GAMES_PREFIX_OPT
-# @DESCRIPTION:
-# Prefix where to install precompiled/blob games, usually followed by
-# package name. May be set by the user.
-GAMES_PREFIX_OPT=${GAMES_PREFIX_OPT:-/opt}
-
-# @ECLASS-VARIABLE: GAMES_DATADIR
-# @DESCRIPTION:
-# Base directory where to install game data files, usually followed by
-# package name. May be set by the user.
-GAMES_DATADIR=${GAMES_DATADIR:-/usr/share/games}
-
-# @ECLASS-VARIABLE: GAMES_DATADIR_BASE
-# @DESCRIPTION:
-# Similar to GAMES_DATADIR, but only used when a package auto appends 'games'
-# to the path. May be set by the user.
-GAMES_DATADIR_BASE=${GAMES_DATADIR_BASE:-/usr/share}
-
-# @ECLASS-VARIABLE: GAMES_SYSCONFDIR
-# @DESCRIPTION:
-# Where to install global games configuration files, usually followed by
-# package name. May be set by the user.
-GAMES_SYSCONFDIR=${GAMES_SYSCONFDIR:-/etc/games}
-
-# @ECLASS-VARIABLE: GAMES_STATEDIR
-# @DESCRIPTION:
-# Where to install/store global variable game data, usually followed by
-# package name. May be set by the user.
-GAMES_STATEDIR=${GAMES_STATEDIR:-/var/games}
-
-# @ECLASS-VARIABLE: GAMES_LOGDIR
-# @DESCRIPTION:
-# Where to store global game log files, usually followed by
-# package name. May be set by the user.
-GAMES_LOGDIR=${GAMES_LOGDIR:-/var/log/games}
-
-# @ECLASS-VARIABLE: GAMES_BINDIR
-# @DESCRIPTION:
-# Where to install the game binaries. May be set by the user. This is in PATH.
-GAMES_BINDIR=${GAMES_BINDIR:-${GAMES_PREFIX}/bin}
-
-# @ECLASS-VARIABLE: GAMES_ENVD
-# @INTERNAL
-# @DESCRIPTION:
-# The games environment file name which sets games specific LDPATH and PATH.
-GAMES_ENVD="90games"
-
-# @ECLASS-VARIABLE: GAMES_USER
-# @DESCRIPTION:
-# The USER who owns all game files and usually has write permissions.
-# May be set by the user.
-GAMES_USER=${GAMES_USER:-root}
-
-# @ECLASS-VARIABLE: GAMES_USER_DED
-# @DESCRIPTION:
-# The USER who owns all game files related to the dedicated server part
-# of a package. May be set by the user.
-GAMES_USER_DED=${GAMES_USER_DED:-games}
-
-# @ECLASS-VARIABLE: GAMES_GROUP
-# @DESCRIPTION:
-# The GROUP that owns all game files and usually does not have
-# write permissions. May be set by the user.
-# If you want games world-executable, then you can at least set this variable
-# to 'users' which is almost the same.
-GAMES_GROUP=${GAMES_GROUP:-games}
-
-# @FUNCTION: games_get_libdir
-# @DESCRIPTION:
-# Gets the directory where to install games libraries. This is in LDPATH.
-games_get_libdir() {
- echo ${GAMES_PREFIX}/$(get_libdir)
-}
-
-# @FUNCTION: egamesconf
-# @USAGE: [<args>...]
-# @DESCRIPTION:
-# Games equivalent to 'econf' for autotools based build systems. It passes
-# the necessary games specific directories automatically.
-egamesconf() {
- # handle verbose build log pre-EAPI5
- local _gamesconf
- if has "${EAPI:-0}" 0 1 2 3 4 ; then
- if grep -q -s disable-silent-rules "${ECONF_SOURCE:-.}"/configure ; then
- _gamesconf="--disable-silent-rules"
- fi
- fi
-
- # bug 493954
- if grep -q -s datarootdir "${ECONF_SOURCE:-.}"/configure ; then
- _gamesconf="${_gamesconf} --datarootdir=/usr/share"
- fi
-
- econf \
- --prefix="${EPREFIX}${GAMES_PREFIX}" \
- --libdir="${EPREFIX}$(games_get_libdir)" \
- --datadir="${EPREFIX}${GAMES_DATADIR}" \
- --sysconfdir="${EPREFIX}${GAMES_SYSCONFDIR}" \
- --localstatedir="${EPREFIX}${GAMES_STATEDIR}" \
- ${_gamesconf} \
- "$@"
-}
-
-# @FUNCTION: gameswrapper
-# @USAGE: <command> [<args>...]
-# @INTERNAL
-# @DESCRIPTION:
-# Wraps an install command like dobin, dolib etc, so that
-# it has GAMES_PREFIX as prefix.
-gameswrapper() {
- # dont want to pollute calling env
- (
- into "${GAMES_PREFIX}"
- cmd=$1
- shift
- ${cmd} "$@"
- )
-}
-
-# @FUNCTION: dogamesbin
-# @USAGE: <path>...
-# @DESCRIPTION:
-# Install one or more games binaries.
-dogamesbin() { gameswrapper ${FUNCNAME/games} "$@"; }
-
-# @FUNCTION: dogamessbin
-# @USAGE: <path>...
-# @DESCRIPTION:
-# Install one or more games system binaries.
-dogamessbin() { gameswrapper ${FUNCNAME/games} "$@"; }
-
-# @FUNCTION: dogameslib
-# @USAGE: <path>...
-# @DESCRIPTION:
-# Install one or more games libraries.
-dogameslib() { gameswrapper ${FUNCNAME/games} "$@"; }
-
-# @FUNCTION: dogameslib.a
-# @USAGE: <path>...
-# @DESCRIPTION:
-# Install one or more static games libraries.
-dogameslib.a() { gameswrapper ${FUNCNAME/games} "$@"; }
-
-# @FUNCTION: dogameslib.so
-# @USAGE: <path>...
-# @DESCRIPTION:
-# Install one or more shared games libraries.
-dogameslib.so() { gameswrapper ${FUNCNAME/games} "$@"; }
-
-# @FUNCTION: newgamesbin
-# @USAGE: <path> <newname>
-# @DESCRIPTION:
-# Install one games binary with a new name.
-newgamesbin() { gameswrapper ${FUNCNAME/games} "$@"; }
-
-# @FUNCTION: newgamessbin
-# @USAGE: <path> <newname>
-# @DESCRIPTION:
-# Install one system games binary with a new name.
-newgamessbin() { gameswrapper ${FUNCNAME/games} "$@"; }
-
-# @FUNCTION: games_make_wrapper
-# @USAGE: <wrapper> <target> [chdir] [libpaths] [installpath]
-# @DESCRIPTION:
-# Create a shell wrapper script named wrapper in installpath
-# (defaults to the games bindir) to execute target (default of wrapper) by
-# first optionally setting LD_LIBRARY_PATH to the colon-delimited
-# libpaths followed by optionally changing directory to chdir.
-games_make_wrapper() { gameswrapper ${FUNCNAME/games_} "$@"; }
-
-# @FUNCTION: gamesowners
-# @USAGE: [<args excluding owner/group>...] <path>...
-# @DESCRIPTION:
-# Run 'chown' with the given args on the given files. Owner and
-# group are GAMES_USER and GAMES_GROUP and must not be passed
-# as args.
-gamesowners() { use prefix || chown ${GAMES_USER}:${GAMES_GROUP} "$@"; }
-
-# @FUNCTION: gamesperms
-# @USAGE: <path>...
-# @DESCRIPTION:
-# Run 'chmod' with games specific permissions on the given files.
-gamesperms() { use prefix || chmod u+rw,g+r-w,o-rwx "$@"; }
-
-# @FUNCTION: prepgamesdirs
-# @DESCRIPTION:
-# Fix all permissions/owners of files in games related directories,
-# usually called at the end of src_install().
-prepgamesdirs() {
- local dir f mode
- for dir in \
- "${GAMES_PREFIX}" "${GAMES_PREFIX_OPT}" "${GAMES_DATADIR}" \
- "${GAMES_SYSCONFDIR}" "${GAMES_STATEDIR}" "$(games_get_libdir)" \
- "${GAMES_BINDIR}" "$@"
- do
- [[ ! -d ${ED}/${dir} ]] && continue
- use prefix || (
- gamesowners -R "${ED}/${dir}"
- find "${ED}/${dir}" -type d -print0 | xargs -0 chmod 750
- mode=o-rwx,g+r,g-w
- [[ ${dir} = ${GAMES_STATEDIR} ]] && mode=o-rwx,g+r
- find "${ED}/${dir}" -type f -print0 | xargs -0 chmod $mode
-
- # common trees should not be games owned #264872
- if [[ ${dir} == "${GAMES_PREFIX_OPT}" ]] ; then
- fowners root:root "${dir}"
- fperms 755 "${dir}"
- for d in $(get_libdir) bin ; do
- # check if dirs exist to avoid "nonfatal" option
- if [[ -e ${ED}/${dir}/${d} ]] ; then
- fowners root:root "${dir}/${d}"
- fperms 755 "${dir}/${d}"
- fi
- done
- fi
- ) &>/dev/null
-
- f=$(find "${ED}/${dir}" -perm +4000 -a -uid 0 2>/dev/null)
- if [[ -n ${f} ]] ; then
- eerror "A game was detected that is setuid root!"
- eerror "${f}"
- die "refusing to merge a setuid root game"
- fi
- done
- [[ -d ${ED}/${GAMES_BINDIR} ]] || return 0
- use prefix || find "${D}/${GAMES_BINDIR}" -maxdepth 1 -type f -exec chmod 750 '{}' \;
-}
-
-# @FUNCTION: games_pkg_setup
-# @DESCRIPTION:
-# Export some toolchain specific variables and create games related groups
-# and users. This function is exported as pkg_setup().
-games_pkg_setup() {
- if has "${EAPI:-0}" 0 1 2 && ! use prefix; then
- EPREFIX=
- EROOT=${ROOT}
- ED=${D}
- fi
-
- tc-export CC CXX LD AR RANLIB
-
- enewgroup "${GAMES_GROUP}" 35
- [[ ${GAMES_USER} != "root" ]] \
- && enewuser "${GAMES_USER}" 35 -1 "${EPREFIX}${GAMES_PREFIX}" "${GAMES_GROUP}"
- [[ ${GAMES_USER_DED} != "root" ]] \
- && enewuser "${GAMES_USER_DED}" 36 "${EPREFIX}"/bin/bash "${EPREFIX}${GAMES_PREFIX}" "${GAMES_GROUP}"
-
- # Dear portage team, we are so sorry. Lots of love, games team.
- # See Bug #61680
- [[ ${USERLAND} != "GNU" ]] && return 0
- [[ $(egetshell "${GAMES_USER_DED}") == "/bin/false" ]] \
- && usermod -s "${EPREFIX}"/bin/bash "${GAMES_USER_DED}"
-}
-
-# @FUNCTION: games_src_configure
-# @DESCRIPTION:
-# Runs egamesconf if there is a configure file.
-# This function is exported as src_configure().
-games_src_configure() {
- [[ -x "${ECONF_SOURCE:-.}"/configure ]] && egamesconf
-}
-
-# @FUNCTION: games_src_compile
-# @DESCRIPTION:
-# Runs base_src_make(). This function is exported as src_compile().
-games_src_compile() {
- case ${EAPI:-0} in
- 0|1) games_src_configure ;;
- esac
- base_src_make
-}
-
-# @FUNCTION: games_pkg_preinst
-# @DESCRIPTION:
-# Synchronizes GAMES_STATEDIR of the ebuild image with the live filesystem.
-games_pkg_preinst() {
- local f
-
- while read f ; do
- if [[ -e ${EROOT}/${GAMES_STATEDIR}/${f} ]] ; then
- cp -p \
- "${EROOT}/${GAMES_STATEDIR}/${f}" \
- "${ED}/${GAMES_STATEDIR}/${f}" \
- || die "cp failed"
- # make the date match the rest of the install
- touch "${ED}/${GAMES_STATEDIR}/${f}"
- fi
- done < <(find "${ED}/${GAMES_STATEDIR}" -type f -printf '%P\n' 2>/dev/null)
-}
-
-# @FUNCTION: games_pkg_postinst
-# @DESCRIPTION:
-# Prints some warnings and infos, also related to games groups.
-games_pkg_postinst() {
- if [[ -z "${GAMES_SHOW_WARNING}" ]] ; then
- ewarn "Remember, in order to play games, you have to"
- ewarn "be in the '${GAMES_GROUP}' group."
- echo
- case ${CHOST} in
- *-darwin*) ewarn "Just run 'niutil -appendprop / /groups/games users <USER>'";;
- *-freebsd*|*-dragonfly*) ewarn "Just run 'pw groupmod ${GAMES_GROUP} -m <USER>'";;
- *) ewarn "Just run 'gpasswd -a <USER> ${GAMES_GROUP}', then have <USER> re-login.";;
- esac
- echo
- einfo "For more info about Gentoo gaming in general, see our website:"
- einfo " http://games.gentoo.org/"
- echo
- fi
-}
-
-# @FUNCTION: games_ut_unpack
-# @USAGE: <directory or file to unpack>
-# @DESCRIPTION:
-# Unpack .uz2 files for UT2003/UT2004.
-games_ut_unpack() {
- local ut_unpack="$1"
- local f=
-
- if [[ -z ${ut_unpack} ]] ; then
- die "You must provide an argument to games_ut_unpack"
- fi
- if [[ -f ${ut_unpack} ]] ; then
- uz2unpack "${ut_unpack}" "${ut_unpack%.uz2}" \
- || die "uncompressing file ${ut_unpack}"
- fi
- if [[ -d ${ut_unpack} ]] ; then
- while read f ; do
- uz2unpack "${ut_unpack}/${f}" "${ut_unpack}/${f%.uz2}" \
- || die "uncompressing file ${f}"
- rm -f "${ut_unpack}/${f}" || die "deleting compressed file ${f}"
- done < <(find "${ut_unpack}" -maxdepth 1 -name '*.uz2' -printf '%f\n' 2>/dev/null)
- fi
-}
-
-# @FUNCTION: games_umod_unpack
-# @USAGE: <file to unpack>
-# @DESCRIPTION:
-# Unpacks .umod/.ut2mod/.ut4mod files for UT/UT2003/UT2004.
-# Don't forget to set 'dir' and 'Ddir'.
-games_umod_unpack() {
- local umod=$1
- mkdir -p "${Ddir}"/System
- cp "${dir}"/System/{ucc-bin,{Manifest,Def{ault,User}}.ini,{Engine,Core,zlib,ogg,vorbis}.so,{Engine,Core}.int} "${Ddir}"/System
- cd "${Ddir}"/System
- UT_DATA_PATH=${Ddir}/System ./ucc-bin umodunpack -x "${S}/${umod}" -nohomedir &> /dev/null \
- || die "uncompressing file ${umod}"
- rm -f "${Ddir}"/System/{ucc-bin,{Manifest,Def{ault,User},User,UT200{3,4}}.ini,{Engine,Core,zlib,ogg,vorbis}.so,{Engine,Core}.int,ucc.log} &>/dev/null \
- || die "Removing temporary files"
-}
-
-fi
diff --git a/eclass/gnustep-base.eclass b/eclass/gnustep-base.eclass
deleted file mode 100644
index 0354caa08d..0000000000
--- a/eclass/gnustep-base.eclass
+++ /dev/null
@@ -1,269 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.27 2012/06/22 12:41:51 voyageur Exp $
-
-# @ECLASS: gnustep-base.eclass
-# @MAINTAINER:
-# GNUstep Herd <gnustep@gentoo.org>
-# @BLURB: Internal handling of GNUstep pacakges
-# @DESCRIPTION:
-# Inner gnustep eclass, should only be inherited directly by gnustep-base
-# packages
-
-inherit eutils flag-o-matic
-
-# IUSE variables across all GNUstep packages
-# "debug": enable code for debugging
-# "doc": build and install documentation, if available
-IUSE="debug doc"
-
-# packages needed to build any base gnustep package
-GNUSTEP_CORE_DEPEND="doc? ( virtual/texi2dvi dev-tex/latex2html app-text/texi2html )"
-
-# New layout is used when ${EPREFIX}/usr/share/GNUstep/Makefiles exists
-# Where to install GNUstep (with old layout)
-GNUSTEP_PREFIX="${EPREFIX}/usr/GNUstep"
-
-# GNUstep environment array
-typeset -a GS_ENV
-
-# Ebuild function overrides
-gnustep-base_pkg_setup() {
- if test_version_info 3.3 ; then
- strip-unsupported-flags
- elif test_version_info 3.4 ; then
- # strict-aliasing is known to break obj-c stuff in gcc-3.4*
- filter-flags -fstrict-aliasing
- fi
-
- # known to break ObjC (bug 86089)
- filter-flags -fomit-frame-pointer
-}
-
-gnustep-base_src_unpack() {
- unpack ${A}
- cd "${S}"
-
- gnustep-base_src_prepare
-}
-
-gnustep-base_src_prepare() {
- if [[ -f ./GNUmakefile ]] ; then
- # Kill stupid includes that are simply overdone or useless on normal
- # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this
- # only removes a part of a path it's good that it bails out, as we want
- # to know when they use some direct include.
- ebegin "Cleaning paths from GNUmakefile"
- sed -i \
- -e 's|-I/usr/X11R6/include/\?||g' \
- -e 's|-I/usr/include/\?||g' \
- -e 's|-L/usr/X11R6/lib/\?||g' \
- -e 's|-L/usr/lib/\?||g' \
- GNUmakefile
- eend $?
- fi
-}
-
-gnustep-base_src_configure() {
- egnustep_env
- if [[ -x ./configure ]] ; then
- econf || die "configure failed"
- fi
-}
-
-gnustep-base_src_compile() {
- egnustep_env
- case ${EAPI:-0} in
- 0|1) gnustep-base_src_configure ;;
- esac
-
- egnustep_make
-}
-
-gnustep-base_src_install() {
- egnustep_env
- egnustep_install
- if use doc ; then
- egnustep_env
- egnustep_doc
- fi
- egnustep_install_config
-}
-
-gnustep-base_pkg_postinst() {
- [[ $(type -t gnustep_config_script) != "function" ]] && return 0
-
- local SCRIPT_PATH
- if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
- SCRIPT_PATH="/usr/bin"
- else
- SCRIPT_PATH=${GNUSTEP_SYSTEM_TOOLS}/Gentoo
- fi
- elog "To use this package, as *user* you should run:"
- elog " ${SCRIPT_PATH}/config-${PN}.sh"
-}
-
-# Clean/reset an ebuild to the installed GNUstep environment
-egnustep_env() {
- # Get additional variables
- GNUSTEP_SH_EXPORT_ALL_VARIABLES="true"
-
- # Makefiles path
- local GS_MAKEFILES
- if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
- GS_MAKEFILES=${EPREFIX}/usr/share/GNUstep/Makefiles
- else
- GS_MAKEFILES=${GNUSTEP_PREFIX}/System/Library/Makefiles
- fi
- if [[ -f ${GS_MAKEFILES}/GNUstep.sh ]] ; then
- # Reset GNUstep variables
- source "${GS_MAKEFILES}"/GNUstep-reset.sh
- source "${GS_MAKEFILES}"/GNUstep.sh
-
- # Create compilation GNUstep.conf if it does not exist yet
- if [[ ! -f ${WORKDIR}/GNUstep.conf ]]; then
- cp "${EPREFIX}"/etc/GNUstep/GNUstep.conf "${WORKDIR}" \
- || die "GNUstep.conf copy failed"
- sed -e "s#\(GNUSTEP_USER_.*DIR.*=\)#\1${WORKDIR}/#" \
- -i "${WORKDIR}"/GNUstep.conf || die "GNUstep.conf sed failed"
- fi
-
-
- if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
- # Set rpath in ldflags when available
- case ${CHOST} in
- *-linux-gnu|*-solaris*)
- is-ldflagq -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \
- || append-ldflags \
- -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}"
- ;;
- esac
- fi
-
- # Set up env vars for make operations
- GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \
- ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \
- DESTDIR="${D}" \
- HOME="${T}" \
- GNUSTEP_CONFIG_FILE="${WORKDIR}"/GNUstep.conf \
- GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
- GNUSTEP_ABSOLUTE_INSTALL_PATHS=yes \
- TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \
- messages=yes )
-
- use doc \
- && GS_ENV=( "${GS_ENV[@]}" VARTEXFONTS="${T}"/fonts )
-
- use debug \
- && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \
- || GS_ENV=( "${GS_ENV[@]}" "debug=no" )
-
- # About 20 gnustep packages still use EAPI 0
- if built_with_use --missing false gnustep-base/gnustep-make libobjc2;
- then
- # Set clang for packages that do not respect gnustep-make
- # settings (gnustep-base's configure for example)
- export CC=clang CXX=clang CPP="clang -E" LD="clang"
- fi
-
- return 0
- fi
- die "gnustep-make not installed!"
-}
-
-# Make utilizing GNUstep Makefiles
-egnustep_make() {
- if [[ -f ./Makefile || -f ./makefile || -f ./GNUmakefile ]] ; then
- emake ${*} "${GS_ENV[@]}" all || die "package make failed"
- return 0
- fi
- die "no Makefile found"
-}
-
-# Make-install utilizing GNUstep Makefiles
-egnustep_install() {
- if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
- # avoid problems due to our "weird" prefix, make sure it exists
- mkdir -p "${D}"${GNUSTEP_SYSTEM_TOOLS}
- fi
- if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then
- emake ${*} "${GS_ENV[@]}" install || die "package install failed"
- return 0
- fi
- die "no Makefile found"
-}
-
-# Make and install docs using GNUstep Makefiles
-egnustep_doc() {
- if [[ -d "${S}"/Documentation ]] ; then
- # Check documentation presence
- pushd "${S}"/Documentation || die
- if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then
- emake "${GS_ENV[@]}" all || die "doc make failed"
- emake "${GS_ENV[@]}" install || die "doc install failed"
- fi
- popd || die
- fi
-}
-
-egnustep_install_config() {
- [[ $(type -t gnustep_config_script) != "function" ]] && return 0
-
- local cfile=config-${PN}.sh
-
- cat << 'EOF' > "${T}"/${cfile}
-#!/usr/bin/env bash
-gnustep_append_default() {
- if [[ -z $1 || -z $2 || -z $3 ]]; then
- echo "warning: invalid script invocation"
- return
- fi
- dom=$1
- key=$2
- val=$3
- cur=$(defaults read ${dom} ${key}) 2> /dev/null
- if [[ -z $cur ]] ; then
- echo " * setting ${dom} ${key}"
- defaults write ${dom} ${key} "( ${val} )"
- elif [[ ${cur} != *${val}* ]] ; then
- echo " * adding ${val} to ${dom} ${key}"
- echo "${cur%)\'}, \"${val}\" )'" | defaults write
- else
- echo " * ${val} already present in ${dom} ${key}"
- fi
-}
-
-gnustep_set_default() {
- if [[ -z $1 || -z $2 || -z $3 ]]; then
- echo "warning: invalid script invocation"
- return
- fi
- dom=$1
- key=$2
- val=$3
- echo " * setting ${dom} ${key}"
- defaults write ${dom} ${key} ${val}
-}
-
-EOF
-
- echo "echo \"Applying ${P} default configuration ...\"" >> "${T}"/${cfile}
-
- gnustep_config_script | \
- while read line ; do
- echo "${line}" >> "${T}"/${cfile}
- done
- echo 'echo "done"' >> "${T}"/${cfile}
-
- if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
- exeinto /usr/bin
- else
- exeinto ${GNUSTEP_SYSTEM_TOOLS#${EPREFIX}}/Gentoo
- fi
- doexe "${T}"/${cfile}
-}
-
-case ${EAPI:-0} in
- 0|1) EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst ;;
- *) EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst ;;
-esac
diff --git a/eclass/mozcoreconf-2.eclass b/eclass/mozcoreconf-2.eclass
deleted file mode 100644
index caabacf602..0000000000
--- a/eclass/mozcoreconf-2.eclass
+++ /dev/null
@@ -1,273 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozcoreconf-2.eclass,v 1.32 2014/01/17 16:33:15 jer Exp $
-#
-# mozcoreconf.eclass : core options for mozilla
-# inherit mozconfig-2 if you need USE flags
-
-PYTHON_COMPAT=( python2_7 )
-PYTHON_REQ_USE='threads,sqlite'
-
-inherit multilib flag-o-matic python-any-r1 versionator
-
-IUSE="${IUSE} custom-cflags custom-optimization"
-
-RDEPEND="x11-libs/libXrender
- x11-libs/libXt
- >=sys-libs/zlib-1.1.4"
-
-DEPEND="${RDEPEND}
- virtual/pkgconfig
- ${PYTHON_DEPS}"
-
-# mozconfig_annotate: add an annotated line to .mozconfig
-#
-# Example:
-# mozconfig_annotate "building on ultrasparc" --enable-js-ultrasparc
-# => ac_add_options --enable-js-ultrasparc # building on ultrasparc
-mozconfig_annotate() {
- declare reason=$1 x ; shift
- [[ $# -gt 0 ]] || die "mozconfig_annotate missing flags for ${reason}\!"
- for x in ${*}; do
- echo "ac_add_options ${x} # ${reason}" >>.mozconfig
- done
-}
-
-# mozconfig_use_enable: add a line to .mozconfig based on a USE-flag
-#
-# Example:
-# mozconfig_use_enable truetype freetype2
-# => ac_add_options --enable-freetype2 # +truetype
-mozconfig_use_enable() {
- declare flag=$(use_enable "$@")
- mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
-}
-
-# mozconfig_use_with: add a line to .mozconfig based on a USE-flag
-#
-# Example:
-# mozconfig_use_with kerberos gss-api /usr/$(get_libdir)
-# => ac_add_options --with-gss-api=/usr/lib # +kerberos
-mozconfig_use_with() {
- declare flag=$(use_with "$@")
- mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
-}
-
-# mozconfig_use_extension: enable or disable an extension based on a USE-flag
-#
-# Example:
-# mozconfig_use_extension gnome gnomevfs
-# => ac_add_options --enable-extensions=gnomevfs
-mozconfig_use_extension() {
- declare minus=$(use $1 || echo -)
- mozconfig_annotate "${minus:-+}$1" --enable-extensions=${minus}${2}
-}
-
-mozversion_is_new_enough() {
- case ${PN} in
- firefox|thunderbird)
- if [[ $(get_version_component_range 1) -ge 17 ]] ; then
- return 0
- fi
- ;;
- seamonkey)
- if [[ $(get_version_component_range 1) -eq 2 ]] && [[ $(get_version_component_range 2) -ge 14 ]] ; then
- return 0
- fi
- ;;
- esac
-
- return 1
-}
-
-moz_pkgsetup() {
- # Ensure we use C locale when building
- export LANG="C"
- export LC_ALL="C"
- export LC_MESSAGES="C"
- export LC_CTYPE="C"
-
- # Ensure that we have a sane build enviroment
- export MOZILLA_CLIENT=1
- export BUILD_OPT=1
- export NO_STATIC_LIB=1
- export USE_PTHREADS=1
- export ALDFLAGS=${LDFLAGS}
- # ensure MOZCONFIG is not defined
- eval unset MOZCONFIG
-
- # nested configure scripts in mozilla products generate unrecognized options
- # false positives when toplevel configure passes downwards.
- export QA_CONFIGURE_OPTIONS=".*"
-
- if [[ $(gcc-major-version) -eq 3 ]]; then
- ewarn "Unsupported compiler detected, DO NOT file bugs for"
- ewarn "outdated compilers. Bugs opened with gcc-3 will be closed"
- ewarn "invalid."
- fi
-
- python-any-r1_pkg_setup
-}
-
-mozconfig_init() {
- declare enable_optimize pango_version myext x
- declare XUL=$([[ ${PN} == xulrunner ]] && echo true || echo false)
- declare FF=$([[ ${PN} == firefox ]] && echo true || echo false)
- declare SM=$([[ ${PN} == seamonkey ]] && echo true || echo false)
- declare TB=$([[ ${PN} == thunderbird ]] && echo true || echo false)
-
- ####################################
- #
- # Setup the initial .mozconfig
- # See http://www.mozilla.org/build/configure-build.html
- #
- ####################################
-
- case ${PN} in
- *xulrunner)
- cp xulrunner/config/mozconfig .mozconfig \
- || die "cp xulrunner/config/mozconfig failed" ;;
- *firefox)
- cp browser/config/mozconfig .mozconfig \
- || die "cp browser/config/mozconfig failed" ;;
- seamonkey)
- # Must create the initial mozconfig to enable application
- : >.mozconfig || die "initial mozconfig creation failed"
- mozconfig_annotate "" --enable-application=suite ;;
- *thunderbird)
- # Must create the initial mozconfig to enable application
- : >.mozconfig || die "initial mozconfig creation failed"
- mozconfig_annotate "" --enable-application=mail ;;
- esac
-
- ####################################
- #
- # CFLAGS setup and ARCH support
- #
- ####################################
-
- # Set optimization level
- if [[ ${ARCH} == hppa ]]; then
- mozconfig_annotate "more than -O0 causes a segfault on hppa" --enable-optimize=-O0
- elif [[ ${ARCH} == x86 ]]; then
- mozconfig_annotate "less then -O2 causes a segfault on x86" --enable-optimize=-O2
- elif use custom-optimization || [[ ${ARCH} =~ (alpha|ia64) ]]; then
- # Set optimization level based on CFLAGS
- if is-flag -O0; then
- mozconfig_annotate "from CFLAGS" --enable-optimize=-O0
- elif [[ ${ARCH} == ppc ]] && has_version '>=sys-libs/glibc-2.8'; then
- mozconfig_annotate "more than -O1 segfaults on ppc with glibc-2.8" --enable-optimize=-O1
- elif is-flag -O3; then
- mozconfig_annotate "from CFLAGS" --enable-optimize=-O3
- elif is-flag -O1; then
- mozconfig_annotate "from CFLAGS" --enable-optimize=-O1
- elif is-flag -Os; then
- mozconfig_annotate "from CFLAGS" --enable-optimize=-Os
- else
- mozconfig_annotate "Gentoo's default optimization" --enable-optimize=-O2
- fi
- else
- # Enable Mozilla's default
- mozconfig_annotate "mozilla default" --enable-optimize
- fi
-
- # Strip optimization so it does not end up in compile string
- filter-flags '-O*'
-
- # Strip over-aggressive CFLAGS
- use custom-cflags || strip-flags
-
- # Additional ARCH support
- case "${ARCH}" in
- alpha)
- # Historically we have needed to add -fPIC manually for 64-bit.
- # Additionally, alpha should *always* build with -mieee for correct math
- # operation
- append-flags -fPIC -mieee
- ;;
-
- ia64)
- # Historically we have needed to add this manually for 64-bit
- append-flags -fPIC
- ;;
-
- ppc64)
- append-flags -fPIC -mminimal-toc
- ;;
- esac
-
- # Go a little faster; use less RAM
- append-flags "$MAKEEDIT_FLAGS"
-
- ####################################
- #
- # mozconfig setup
- #
- ####################################
-
- mozconfig_annotate system_libs \
- --with-system-jpeg \
- --with-system-zlib \
- --enable-pango \
- --enable-system-cairo
- if ! $(mozversion_is_new_enough) ; then
- mozconfig_annotate system-libs --enable-svg
- fi
-
- mozconfig_annotate disable_update_strip \
- --disable-pedantic \
- --disable-updater \
- --disable-strip \
- --disable-install-strip
- if ! $(mozversion_is_new_enough) ; then
- mozconfig_annotate disable_update_strip \
- --disable-installer \
- --disable-strip-libs
- fi
-
- if [[ ${PN} != seamonkey ]]; then
- mozconfig_annotate basic_profile \
- --disable-profilelocking
- if ! $(mozversion_is_new_enough) ; then
- mozconfig_annotate basic_profile \
- --enable-single-profile \
- --disable-profilesharing
- fi
- fi
-
- # Here is a strange one...
- if is-flag '-mcpu=ultrasparc*' || is-flag '-mtune=ultrasparc*'; then
- mozconfig_annotate "building on ultrasparc" --enable-js-ultrasparc
- fi
-
- # Currently --enable-elf-dynstr-gc only works for x86,
- if use x86 && [[ ${enable_optimize} != -O0 ]]; then
- mozconfig_annotate "${ARCH} optimized build" --enable-elf-dynstr-gc
- fi
-
- # jemalloc won't build with older glibc
- use elibc_glibc && ! has_version ">=sys-libs/glibc-2.4" && mozconfig_annotate "we have old glibc" --disable-jemalloc
-}
-
-# mozconfig_final: display a table describing all configuration options paired
-# with reasons, then clean up extensions list
-mozconfig_final() {
- declare ac opt hash reason
- echo
- echo "=========================================================="
- echo "Building ${PF} with the following configuration"
- grep ^ac_add_options .mozconfig | while read ac opt hash reason; do
- [[ -z ${hash} || ${hash} == \# ]] \
- || die "error reading mozconfig: ${ac} ${opt} ${hash} ${reason}"
- printf " %-30s %s\n" "${opt}" "${reason:-mozilla.org default}"
- done
- echo "=========================================================="
- echo
-
- # Resolve multiple --enable-extensions down to one
- declare exts=$(sed -n 's/^ac_add_options --enable-extensions=\([^ ]*\).*/\1/p' \
- .mozconfig | xargs)
- sed -i '/^ac_add_options --enable-extensions/d' .mozconfig
- echo "ac_add_options --enable-extensions=${exts// /,}" >> .mozconfig
-}
-
diff --git a/eclass/mozilla-launcher.eclass b/eclass/mozilla-launcher.eclass
deleted file mode 100644
index ad16cbf120..0000000000
--- a/eclass/mozilla-launcher.eclass
+++ /dev/null
@@ -1,123 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozilla-launcher.eclass,v 1.24 2009/05/01 21:42:38 nirbheek Exp $
-
-inherit nsplugins multilib
-
-if [[ ${PN: -4} != "-bin" ]] ; then
- IUSE="moznopango"
-fi
-
-# update_mozilla_launcher_symlinks
-# --------------------------------
-# Create or remove the following symlinks in /usr/bin:
-#
-# firefox -> firefox-bin
-# thunderbird -> thunderbird-bin
-# mozilla -> mozilla-bin
-# sunbird -> sunbird-bin
-# seamonkey -> seamonkey-bin
-#
-# The symlinks are removed if they're found to be dangling. They are
-# created according to the following rules:
-#
-# - If there's a -bin symlink in /usr/bin, and no corresponding
-# non-bin symlink, then create one.
-#
-# - Can't do this in src_install otherwise it overwrites the one
-# for the non-bin package.
-#
-# - Link to the -bin symlink so it's easier to detect when to
-# remove the symlink.
-#
-# NOTE: This eclass does *not* manage the launcher stubs in /usr/bin except
-# when a -bin package is installed and the corresponding from-source
-# package is not installed. The usual stubs are actually installed in
-# src_install so they are included in the package inventory.
-#
-update_mozilla_launcher_symlinks() {
- local f browsers="mozilla firefox thunderbird sunbird seamonkey"
- cd "${EROOT}"/usr/bin
-
- # Remove launcher symlinks that no longer apply
-
- for f in ${browsers}; do
- if [[ -L ${f} && ! -f ${f} ]]; then
- einfo "Removing dangling ${f} launcher"
- rm -f ${f}
- fi
- done
-
- # Create new symlinks
-
- for f in ${browsers}; do
- if [[ -e ${f}-bin && ! -e ${f} ]]; then
- einfo "Adding link from ${f}-bin to ${f}"
- ln -s ${f}-bin ${f}
- fi
- done
-}
-
-# install_mozilla_launcher_stub name libdir
-# -----------------------------------------
-# Install a stub called /usr/bin/$name that executes mozilla-launcher
-#
-# Note: $PLUGINS_DIR comes from nsplugins (specifically the deprecated section).
-#
-install_mozilla_launcher_stub() {
- [[ -n $2 ]] || die "install_launcher_stub requires two arguments"
- declare name=$1
- declare libdir=${EPREFIX}$2
-
- # If we use xulrunner, the name of the binary should be the same
- if [[ ${name: -3} == "xul" ]]; then
- name=${name/xul/}
- declare appname=xulrunner
- declare xulparams="export XUL_PARAMS=${libdir}/application.ini"
- declare libdir="${EPREFIX}/usr/$(get_libdir)/xulrunner-1.9"
- else
- declare appname=${name}
- fi
-
- dodir /usr/bin
-
- if [[ ${PN: -4} == "-bin" ]] || ! use moznopango; then
- cat <<EOF >"${ED}"/usr/bin/${name}
-#!${EPREFIX}/bin/sh
-#
-# Stub script to run mozilla-launcher. We used to use a symlink here
-# but OOo brokenness makes it necessary to use a stub instead:
-# http://bugs.gentoo.org/show_bug.cgi?id=78890
-
-export MOZILLA_LAUNCHER=${appname}
-export MOZILLA_LIBDIR=${libdir}
-export MOZ_PLUGIN_PATH=\${MOZ_PLUGIN_PATH:-${EPREFIX}/usr/$(get_libdir)/$PLUGINS_DIR}
-${xulparams}
-exec ${EPREFIX}/usr/libexec/mozilla-launcher "\$@"
-EOF
- else
- cat <<EOF >"${ED}"/usr/bin/${name}
-#!${EPREFIX}/bin/sh
-#
-# Stub script to run mozilla-launcher. We used to use a symlink here
-# but OOo brokenness makes it necessary to use a stub instead:
-# http://bugs.gentoo.org/show_bug.cgi?id=78890
-
-export MOZILLA_LAUNCHER=${appname}
-export MOZILLA_LIBDIR=${libdir}
-export MOZ_PLUGIN_PATH=\${MOZ_PLUGIN_PATH:-${EPREFIX}/usr/$(get_libdir)/$PLUGINS_DIR}
-${xulparams}
-export MOZ_DISABLE_PANGO=1
-exec ${EPREFIX}/usr/libexec/mozilla-launcher "\$@"
-EOF
- fi
- chmod 0755 "${ED}"/usr/bin/${name}
-}
-
-warn_mozilla_launcher_stub() {
- elog "Not all locales support the disabling of pango."
- elog "If your locale does not support disabling pango,"
- elog "please open a bug report on http://bugs.gentoo.org"
- elog "Then we can filter around the problem with those"
- elog "specific locales."
-}
diff --git a/eclass/pam.eclass b/eclass/pam.eclass
deleted file mode 100644
index cc657c2088..0000000000
--- a/eclass/pam.eclass
+++ /dev/null
@@ -1,264 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.24 2014/07/11 08:21:58 ulm Exp $
-#
-
-# @ECLASS: pam.eclass
-# @MAINTAINER:
-# pam-bugs@gentoo.org
-# @AUTHOR:
-# Diego Pettenò <flameeyes@gentoo.org>
-# @BLURB: Handles pam related tasks
-# @DESCRIPTION:
-# This eclass contains functions to install pamd configuration files and
-# pam modules.
-
-if [[ -z ${_PAM_ECLASS} ]]; then
-_PAM_ECLASS=1
-
-inherit flag-o-matic multilib
-
-# @FUNCTION: dopamd
-# @USAGE: <file> [more files]
-# @DESCRIPTION:
-# Install pam auth config file in /etc/pam.d
-dopamd() {
- [[ -z $1 ]] && die "dopamd requires at least one argument"
-
- if has pam ${IUSE} && ! use pam; then
- return 0;
- fi
-
- ( # dont want to pollute calling env
- insinto /etc/pam.d
- insopts -m 0644
- doins "$@"
- ) || die "failed to install $@"
- cleanpamd "$@"
-}
-
-# @FUNCTION: newpamd
-# @USAGE: <old name> <new name>
-# @DESCRIPTION:
-# Install pam file <old name> as <new name> in /etc/pam.d
-newpamd() {
- [[ $# -ne 2 ]] && die "newpamd requires two arguments"
-
- if has pam ${IUSE} && ! use pam; then
- return 0;
- fi
-
- ( # dont want to pollute calling env
- insinto /etc/pam.d
- insopts -m 0644
- newins "$1" "$2"
- ) || die "failed to install $1 as $2"
- cleanpamd $2
-}
-
-# @FUNCTION: dopamsecurity
-# @USAGE: <section> <file> [more files]
-# @DESCRIPTION:
-# Installs the config files in /etc/security/<section>/
-dopamsecurity() {
- [[ $# -lt 2 ]] && die "dopamsecurity requires at least two arguments"
-
- if has pam ${IUSE} && ! use pam; then
- return 0
- fi
-
- ( # dont want to pollute calling env
- insinto /etc/security/$1
- insopts -m 0644
- doins "${@:2}"
- ) || die "failed to install ${@:2}"
-}
-
-# @FUNCTION: newpamsecurity
-# @USAGE: <section> <old name> <new name>
-# @DESCRIPTION:
-# Installs the config file <old name> as <new name> in /etc/security/<section>/
-newpamsecurity() {
- [[ $# -ne 3 ]] && die "newpamsecurity requires three arguments"
-
- if has pam ${IUSE} && ! use pam; then
- return 0;
- fi
-
- ( # dont want to pollute calling env
- insinto /etc/security/$1
- insopts -m 0644
- newins "$2" "$3"
- ) || die "failed to install $2 as $3"
-}
-
-# @FUNCTION: getpam_mod_dir
-# @DESCRIPTION:
-# Returns the pam modules' directory for current implementation
-getpam_mod_dir() {
- if has_version sys-libs/pam || has_version sys-libs/openpam; then
- PAM_MOD_DIR="${EPREFIX}"/$(get_libdir)/security
- else
- # Unable to find PAM implementation... defaulting
- PAM_MOD_DIR="${EPREFIX}"/$(get_libdir)/security
- fi
-
- echo ${PAM_MOD_DIR}
-}
-
-# @FUNCTION: pammod_hide_symbols
-# @DESCRIPTION:
-# Hide all non-PAM-used symbols from the module; this function creates a
-# simple ld version script that hides all the symbols that are not
-# necessary for PAM to load the module, then uses append-flags to make
-# sure that it gets used.
-pammod_hide_symbols() {
- cat - > "${T}"/pam-eclass-pam_symbols.ver <<EOF
-{
- global: pam_sm_*;
- local: *;
-};
-EOF
-
- append-ldflags -Wl,--version-script="${T}"/pam-eclass-pam_symbols.ver
-}
-
-# @FUNCTION: dopammod
-# @USAGE: <file> [more files]
-# @DESCRIPTION:
-# Install pam module file in the pam modules' dir for current implementation
-dopammod() {
- [[ -z $1 ]] && die "dopammod requires at least one argument"
-
- if has pam ${IUSE} && ! use pam; then
- return 0;
- fi
-
- local dir=$(getpam_mod_dir)
- exeinto ${dir#${EPREFIX}}
- doexe "$@" || die "failed to install $@"
-}
-
-# @FUNCTION: newpammod
-# @USAGE: <old name> <new name>
-# @DESCRIPTION:
-# Install pam module file <old name> as <new name> in the pam
-# modules' dir for current implementation
-newpammod() {
- [[ $# -ne 2 ]] && die "newpammod requires two arguements"
-
- if has pam ${IUSE} && ! use pam; then
- return 0;
- fi
-
- local dir=$(getpam_mod_dir)
- exeinto ${dir#${EPREFIX}}
- newexe "$1" "$2" || die "failed to install $1 as $2"
-}
-
-# @FUNCTION: pamd_mimic_system
-# @USAGE: <pamd file> [auth levels]
-# @DESCRIPTION:
-# This function creates a pamd file which mimics system-auth file
-# for the given levels in the /etc/pam.d directory.
-pamd_mimic_system() {
- [[ $# -lt 2 ]] && die "pamd_mimic_system requires at least two argments"
- pamd_mimic system-auth "$@"
-}
-
-# @FUNCTION: pamd_mimic
-# @USAGE: <stack> <pamd file> [auth levels]
-# @DESCRIPTION:
-# This function creates a pamd file which mimics the given stack
-# for the given levels in the /etc/pam.d directory.
-pamd_mimic() {
- [[ $# -lt 3 ]] && die "pamd_mimic requires at least three argments"
-
- if has pam ${IUSE} && ! use pam; then
- return 0;
- fi
-
- dodir /etc/pam.d
- pamdfile=${ED}/etc/pam.d/$2
- echo -e "# File autogenerated by pamd_mimic in pam eclass\n\n" >> \
- $pamdfile
-
- originalstack=$1
- authlevels="auth account password session"
-
- if has_version '<sys-libs/pam-0.78'; then
- mimic="\trequired\t\tpam_stack.so service=${originalstack}"
- else
- mimic="\tinclude\t\t${originalstack}"
- fi
-
- shift; shift
-
- while [[ -n $1 ]]; do
- has $1 ${authlevels} || die "unknown level type"
-
- echo -e "$1${mimic}" >> ${pamdfile}
-
- shift
- done
-}
-
-# @FUNCTION: cleanpamd
-# @USAGE: <pamd file>
-# @DESCRIPTION:
-# Cleans a pam.d file from modules that might not be present on the system
-# where it's going to be installed
-cleanpamd() {
- while [[ -n $1 ]]; do
- if ! has_version sys-libs/pam; then
- sed -i -e '/pam_shells\|pam_console/s:^:#:' "${ED}/etc/pam.d/$1"
- fi
-
- shift
- done
-}
-
-# @FUNCTION: pam_epam_expand
-# @USAGE: <pamd file>
-# @DESCRIPTION:
-# Steer clear, deprecated, don't use, bad experiment
-pam_epam_expand() {
- sed -n -e 's|#%EPAM-\([[:alpha:]-]\+\):\([-+<>=/.![:alnum:]]\+\)%#.*|\1 \2|p' \
- "$@" | sort -u | while read condition parameter; do
-
- disable="yes"
-
- case "$condition" in
- If-Has)
- message="This can be used only if you have ${parameter} installed"
- has_version "$parameter" && disable="no"
- ;;
- Use-Flag)
- message="This can be used only if you enabled the ${parameter} USE flag"
- use "$parameter" && disable="no"
- ;;
- *)
- eerror "Unknown EPAM condition '${condition}' ('${parameter}')"
- die "Unknown EPAM condition '${condition}' ('${parameter}')"
- ;;
- esac
-
- if [ "${disable}" = "yes" ]; then
- sed -i -e "/#%EPAM-${condition}:${parameter/\//\\/}%#/d" "$@"
- else
- sed -i -e "s|#%EPAM-${condition}:${parameter}%#||" "$@"
- fi
-
- done
-}
-
-# Think about it before uncommenting this one, for now run it by hand
-# pam_pkg_preinst() {
-# eshopts_push -o noglob # so that bash doen't expand "*"
-#
-# pam_epam_expand "${ED}"/etc/pam.d/*
-#
-# eshopts_pop # reset old shell opts
-# }
-
-fi
diff --git a/eclass/php-common-r1.eclass b/eclass/php-common-r1.eclass
deleted file mode 100644
index 89424b5df2..0000000000
--- a/eclass/php-common-r1.eclass
+++ /dev/null
@@ -1,296 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/php-common-r1.eclass,v 1.19 2013/04/28 16:15:33 zmedico Exp $
-
-# Based on robbat2's work on the php4 sapi eclass
-# Based on stuart's work on the php5 sapi eclass
-
-# @ECLASS: php-common-r1.eclass
-# @MAINTAINER:
-# Gentoo PHP team <php-bugs@gentoo.org>
-# @BLURB: Common functions which are shared between the PHP4 and PHP5 packages.
-# @DESCRIPTION:
-# This eclass provides common functions which are shared between the PHP4 and PHP5 packages.
-# It is only used by php*-sapi eclasses currently and the functions are not intended
-# for direct use in ebuilds.
-
-
-# ========================================================================
-# CFLAG SANITY
-# ========================================================================
-
-php_check_cflags() {
- # Fixes bug #14067.
- # Changed order to run it in reverse for bug #32022 and #12021.
- replace-cpu-flags "k6*" "i586"
-}
-
-# ========================================================================
-# IMAP SUPPORT
-# ========================================================================
-
-php_check_imap() {
- if ! use "imap" && ! phpconfutils_usecheck "imap" ; then
- return
- fi
-
- if use "ssl" || phpconfutils_usecheck "ssl" ; then
- if ! built_with_use virtual/imap-c-client ssl ; then
- eerror
- eerror "IMAP with SSL requested, but your IMAP C-Client libraries are built without SSL!"
- eerror
- die "Please recompile the IMAP C-Client libraries with SSL support enabled"
- fi
- else
- if built_with_use virtual/imap-c-client ssl ; then
- eerror
- eerror "IMAP without SSL requested, but your IMAP C-Client libraries are built with SSL!"
- eerror
- die "Please recompile the IMAP C-Client libraries with SSL support disabled"
- fi
- fi
-
- if use "kolab" || phpconfutils_usecheck "kolab" ; then
- if ! built_with_use net-libs/c-client kolab ; then
- eerror
- eerror "IMAP with annotations support requested, but net-libs/c-client is built without it!"
- eerror
- die "Please recompile net-libs/c-client with USE=kolab."
- fi
- fi
-}
-
-# ========================================================================
-# JAVA EXTENSION SUPPORT
-#
-# The bundled java extension is unique to PHP4, but there is
-# now the PHP-Java-Bridge that works under both PHP4 and PHP5.
-# ========================================================================
-
-php_check_java() {
- if ! use "java-internal" && ! phpconfutils_usecheck "java-internal" ; then
- return
- fi
-
- JDKHOME="$(java-config --jdk-home)"
- NOJDKERROR="You need to use the 'java-config' utility to set your JVM to a JDK!"
- if [[ -z "${JDKHOME}" ]] || [[ ! -d "${JDKHOME}" ]] ; then
- eerror "${NOJDKERROR}"
- die "${NOJDKERROR}"
- fi
-
- # stuart@gentoo.org - 2003/05/18
- # Kaffe JVM is not a drop-in replacement for the Sun JDK at this time
- if echo ${JDKHOME} | grep kaffe > /dev/null 2>&1 ; then
- eerror
- eerror "PHP will not build using the Kaffe Java Virtual Machine."
- eerror "Please change your JVM to either Blackdown or Sun's."
- eerror
- eerror "To build PHP without Java support, please re-run this emerge"
- eerror "and place the line:"
- eerror " USE='-java-internal'"
- eerror "in front of your emerge command, for example:"
- eerror " USE='-java-internal' emerge =dev-lang/php-4*"
- eerror
- eerror "or edit your USE flags in /etc/portage/make.conf."
- die "Kaffe JVM not supported"
- fi
-
- JDKVER=$(java-config --java-version 2>&1 | awk '/^java version/ { print $3 }' | xargs )
- einfo "Active JDK version: ${JDKVER}"
- case "${JDKVER}" in
- 1.4.*) ;;
- 1.5.*) ewarn "Java 1.5 is NOT supported at this time, and might not work." ;;
- *) eerror "A Java 1.4 JDK is recommended for Java support in PHP." ; die ;;
- esac
-}
-
-php_install_java() {
- if ! use "java-internal" && ! phpconfutils_usecheck "java-internal" ; then
- return
- fi
-
- # We put these into /usr/lib so that they cannot conflict with
- # other versions of PHP (e.g. PHP 4 & PHP 5)
- insinto "${PHPEXTDIR}"
-
- einfo "Installing PHP java extension"
- doins "modules/java.so"
-
- einfo "Creating PHP java extension symlink"
- dosym "${PHPEXTDIR}/java.so" "${PHPEXTDIR}/libphp_java.so"
-
- einfo "Installing JAR for PHP"
- doins "ext/java/php_java.jar"
-
- einfo "Installing Java test page"
- newins "ext/java/except.php" "java-test.php"
-}
-
-php_install_java_inifile() {
- if ! use "java-internal" && ! phpconfutils_usecheck "java-internal" ; then
- return
- fi
-
- JAVA_LIBRARY="$(grep -- '-DJAVALIB' Makefile | sed -e 's,.\+-DJAVALIB=\"\([^"]*\)\".*$,\1,g;' | sort -u)"
-
- echo "extension = java.so" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
- echo "java.library = ${JAVA_LIBRARY}" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
- echo "java.class.path = ${PHPEXTDIR}/php_java.jar" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
- echo "java.library.path = ${PHPEXTDIR}" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
-
- dosym "${PHP_EXT_INI_DIR}/java.ini" "${PHP_EXT_INI_DIR_ACTIVE}/java.ini"
-}
-
-# ========================================================================
-# MTA SUPPORT
-# ========================================================================
-
-php_check_mta() {
- if ! [[ -x "${ROOT}/usr/sbin/sendmail" ]] ; then
- ewarn
- ewarn "You need a virtual/mta that provides a sendmail compatible binary!"
- ewarn "All major MTAs provide this, and it's usually some symlink created"
- ewarn "as '${ROOT}/usr/sbin/sendmail*'. You should also be able to use other"
- ewarn "MTAs directly, but you'll have to edit the sendmail_path directive"
- ewarn "in your php.ini for this to work."
- ewarn
- fi
-}
-
-# ========================================================================
-# ORACLE SUPPORT
-# ========================================================================
-
-php_check_oracle_all() {
- if use "oci8" && [[ -z "${ORACLE_HOME}" ]] ; then
- eerror
- eerror "You must have the ORACLE_HOME variable set in your environment to"
- eerror "compile the Oracle extension."
- eerror
- die "Oracle configuration incorrect; user error"
- fi
-
- if use "oci8" || use "oracle7" ; then
- if has_version 'dev-db/oracle-instantclient-basic' ; then
- ewarn
- ewarn "Please ensure you have a full install of the Oracle client."
- ewarn "'dev-db/oracle-instantclient-basic' is NOT sufficient."
- ewarn "Please enable the 'oci8-instant-client' USE flag instead, if you"
- ewarn "want to use 'dev-db/oracle-instantclient-basic' as Oracle client."
- ewarn
- fi
- fi
-}
-
-php_check_oracle_8() {
- if use "oci8" && [[ -z "${ORACLE_HOME}" ]] ; then
- eerror
- eerror "You must have the ORACLE_HOME variable set in your environment to"
- eerror "compile the Oracle extension."
- eerror
- die "Oracle configuration incorrect; user error"
- fi
-
- if use "oci8" ; then
- if has_version 'dev-db/oracle-instantclient-basic' ; then
- ewarn
- ewarn "Please ensure you have a full install of the Oracle client."
- ewarn "'dev-db/oracle-instantclient-basic' is NOT sufficient."
- ewarn "Please enable the 'oci8-instant-client' USE flag instead, if you"
- ewarn "want to use 'dev-db/oracle-instantclient-basic' as Oracle client."
- ewarn
- fi
- fi
-}
-
-# ========================================================================
-# POSTGRESQL SUPPORT
-# ========================================================================
-
-php_check_pgsql() {
- if use "postgres" && use "apache2" && use "threads" ; then
- if has_version dev-db/libpq ; then
- if has_version ">=dev-db/libpq-8" && \
- ! built_with_use ">=dev-db/libpq-8" "threads" ; then
- eerror
- eerror "You must build dev-db/libpq with USE=threads"
- eerror "if you want to build PHP with threads support!"
- eerror
- die "Rebuild dev-db/libpq with USE=threads"
- fi
- else
- local pgsql_ver=$(eselect postgresql show)
- if [[ ${pgsql_ver} == "(none)" ]]; then
- eerror "QA: Please select your PostgreSQL version \"eselect postgresql list\""
- die "Can't determine PgSQL."
- fi
- if ! built_with_use "=dev-db/postgresql-base-${pgsql_ver}*" threads ; then
- eerror
- eerror "You must build =dev-db/postgresql-base-${pgsql_ver} with USE=threads"
- eerror "if you want to build PHP with threads support!"
- eerror
- die "Rebuild =dev-db/postgresql-base-${pgsql_ver} with USE=threads"
- fi
- fi
- fi
-}
-
-# ========================================================================
-# MYSQL CHARSET DETECTION SUPPORT ## Thanks to hoffie
-# ========================================================================
-
-php_get_mycnf_charset() {
- # nothing todo if no mysql installed
- if [[ ! -f "${EROOT}/etc/mysql/my.cnf" ]]; then
- echo "empty"
- return
- fi
- local sapi="${1}"
- local section=""
- local client_charset=""
- local sapi_charset=""
-
- # remove comments and pipe the output to our while loop
- while read line ; do
- line=$(echo "${line}" | sed 's:[;#][^\n]*::g')
-
- # skip empty lines
- if [[ "${line}" == "" ]] ; then
- continue
- fi
-
- # capture sections
- tmp=$(echo "${line}" | sed 's:\[\([-a-z0-9\_]*\)\]:\1:')
- if [[ "${line}" != "${tmp}" ]] ; then
- section=${tmp}
- else
- # we don't need to check lines which are not in a section we are interested about
- if [[ "${section}" != "client" && "${section}" != "php-${sapi}" ]] ; then
- continue
- fi
-
- # match default-character-set= lines
- tmp=$(echo "${line}" | sed 's|^[[:space:]\ ]*default-character-set[[:space:]\ ]*=[[:space:]\ ]*\"\?\([a-z0-9\-]*\)\"\?|\1|')
- if [[ "${line}" == "${tmp}" ]] ; then
- # nothing changed, irrelevant line
- continue
- fi
- if [[ "${section}" == "client" ]] ; then
- client_charset="${tmp}"
- else
- if [[ "${section}" == "php-${sapi}" ]] ; then
- sapi_charset="${tmp}"
- fi
- fi
- fi
- done < "${EROOT}/etc/mysql/my.cnf"
- # if a sapi-specific section with a default-character-set= value was found we use it, otherwise we use the client charset (which may be empty)
- if [[ -n "${sapi_charset}" ]] ; then
- echo "${sapi_charset}"
- elif [[ -n "${client_charset}" ]] ; then
- echo "${client_charset}"
- else
- echo "empty"
- fi
-}
diff --git a/eclass/phpconfutils.eclass b/eclass/phpconfutils.eclass
deleted file mode 100644
index 37acb90b25..0000000000
--- a/eclass/phpconfutils.eclass
+++ /dev/null
@@ -1,458 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/phpconfutils.eclass,v 1.10 2011/08/22 04:46:32 vapier Exp $
-
-# @ECLASS: phpconfutils.eclass
-# @MAINTAINER:
-# Gentoo PHP team <php-bugs@gentoo.org>
-# @AUTHOR:
-# Based on Stuart's work on the original confutils eclass
-# Luca Longinotti <chtekk@gentoo.org>
-# @BLURB: Provides utility functions to help with configuring PHP.
-# @DESCRIPTION:
-# This eclass provides utility functions to help with configuring PHP.
-# It is only used by other php eclasses currently and the functions
-# are not generally intended for direct use in ebuilds.
-
-
-# ========================================================================
-# List of USE flags that need deps that aren't yet in Portage
-# or that can't be (fex. certain commercial apps)
-#
-# You must define PHPCONFUTILS_MISSING_DEPS if you need this
-
-# ========================================================================
-# phpconfutils_sort_flags()
-#
-# Sort and remove duplicates of the auto-enabled USE flags
-#
-
-phpconfutils_sort_flags() {
- # Sort the list of auto-magically enabled USE flags
- PHPCONFUTILS_AUTO_USE="$(echo ${PHPCONFUTILS_AUTO_USE} | tr '\040\010' '\012\012' | sort -u)"
-}
-
-# ========================================================================
-# phpconfutils_init()
-#
-# Call this function from your src_compile() function to initialise
-# this eclass first
-#
-
-phpconfutils_init() {
- # Define wheter we shall support shared extensions or not
- if use "sharedext" ; then
- shared="=shared"
- else
- shared=""
- fi
-
- phpconfutils_sort_flags
-}
-
-# ========================================================================
-# phpconfutils_usecheck()
-#
-# Check if the USE flag we want enabled is part of the auto-magical ones
-#
-
-phpconfutils_usecheck() {
- local x
- local use="$1"
-
- for x in ${PHPCONFUTILS_AUTO_USE} ; do
- if [[ "${use}+" == "${x}+" ]] ; then
- return 0
- fi
- done
-
- # If we get here, the USE is not among the auto-enabled ones
- return 1
-}
-
-# ========================================================================
-# phpconfutils_require_any()
-#
-# Use this function to ensure one or more of the specified USE flags have
-# been enabled and output the results
-#
-# $1 - message to output everytime a flag is found
-# $2 - message to output everytime a flag is not found
-# $3 .. - flags to check
-#
-
-phpconfutils_require_any() {
- local success_msg="$1"
- shift
- local fail_msg="$1"
- shift
-
- local required_flags="$@"
- local default_flag="$1"
- local success="0"
-
- while [[ -n "$1" ]] ; do
- if use "$1" ; then
- einfo "${success_msg} $1"
- success="1"
- else
- einfo "${fail_msg} $1"
- fi
- shift
- done
-
- # Did we find what we are looking for?
- if [[ "${success}" == "1" ]] ; then
- return
- fi
-
- # If we get here, then none of the required USE flags were enabled
- eerror
- eerror "You should enable one or more of the following USE flags:"
- eerror " ${required_flags}"
- eerror
- eerror "You can do this by enabling these flags in /etc/portage/package.use:"
- eerror " =${CATEGORY}/${PN}-${PVR} ${required_flags}"
- eerror
- eerror "The ${default_flag} USE flag was automatically enabled now."
- eerror
- PHPCONFUTILS_AUTO_USE="${PHPCONFUTILS_AUTO_USE} ${default_flag}"
-}
-
-# ========================================================================
-# phpconfutils_use_conflict()
-#
-# Use this function to automatically complain to the user if USE flags
-# that directly conflict have been enabled
-#
-# $1 - flag that conflicts with other flags
-# $2 .. - flags that conflict
-#
-
-phpconfutils_use_conflict() {
- phpconfutils_sort_flags
-
- if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
- return
- fi
-
- local my_flag="$1"
- shift
-
- local my_present=""
- local my_remove=""
-
- while [[ "$1+" != "+" ]] ; do
- if use "$1" || phpconfutils_usecheck "$1" ; then
- my_present="${my_present} $1"
- my_remove="${my_remove} -$1"
- fi
- shift
- done
-
- if [[ -n "${my_present}" ]] ; then
- eerror
- eerror "USE flag '${my_flag}' conflicts with these USE flag(s):"
- eerror " ${my_present}"
- eerror
- eerror "You must disable these conflicting flags before you can emerge this package."
- eerror "You can do this by disabling these flags in /etc/portage/package.use:"
- eerror " =${CATEGORY}/${PN}-${PVR} ${my_remove}"
- eerror
- die "Conflicting USE flags found"
- fi
-}
-
-# ========================================================================
-# phpconfutils_use_depend_all()
-#
-# Use this function to specify USE flags that depend on eachother,
-# they will be automatically enabled and used for checks later
-#
-# $1 - flag that depends on other flags
-# $2 .. - the flags that must be set for $1 to be valid
-#
-
-phpconfutils_use_depend_all() {
- phpconfutils_sort_flags
-
- if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
- return
- fi
-
- local my_flag="$1"
- shift
-
- local my_missing=""
-
- while [[ "$1+" != "+" ]] ; do
- if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
- my_missing="${my_missing} $1"
- fi
- shift
- done
-
- if [[ -n "${my_missing}" ]] ; then
- PHPCONFUTILS_AUTO_USE="${PHPCONFUTILS_AUTO_USE} ${my_missing}"
- ewarn
- ewarn "USE flag '${my_flag}' needs these additional flag(s) set:"
- ewarn " ${my_missing}"
- ewarn
- ewarn "'${my_missing}' was automatically enabled and the required extensions will be"
- ewarn "built. In any case it is recommended to enable those flags for"
- ewarn "future reference, by adding the following to /etc/portage/package.use:"
- ewarn " =${CATEGORY}/${PN}-${PVR} ${my_missing}"
- ewarn
- fi
-}
-
-# ========================================================================
-# phpconfutils_use_depend_any()
-#
-# Use this function to automatically complain to the user if a USE flag
-# depends on another USE flag that hasn't been enabled
-#
-# $1 - flag that depends on other flags
-# $2 - flag that is used as default if none is enabled
-# $3 .. - flags that must be set for $1 to be valid
-#
-
-phpconfutils_use_depend_any() {
- phpconfutils_sort_flags
-
- if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
- return
- fi
-
- local my_flag="$1"
- shift
-
- local my_default_flag="$1"
- shift
-
- local my_found=""
- local my_missing=""
-
- while [[ "$1+" != "+" ]] ; do
- if use "$1" || phpconfutils_usecheck "$1" ; then
- my_found="${my_found} $1"
- else
- my_missing="${my_missing} $1"
- fi
- shift
- done
-
- if [[ -z "${my_found}" ]] ; then
- PHPCONFUTILS_AUTO_USE="${PHPCONFUTILS_AUTO_USE} ${my_default_flag}"
- ewarn
- ewarn "USE flag '${my_flag}' needs one of these additional flag(s) set:"
- ewarn " ${my_missing}"
- ewarn
- ewarn "'${my_default_flag}' was automatically selected and enabled."
- ewarn "You can change that by enabling/disabling those flags accordingly"
- ewarn "in /etc/portage/package.use."
- ewarn
- fi
-}
-
-# ========================================================================
-# phpconfutils_extension_disable()
-#
-# Use this function to disable an extension that is enabled by default.
-# This is provided for those rare configure scripts that don't support
-# a --enable for the corresponding --disable
-#
-# $1 - extension name
-# $2 - USE flag
-# $3 - optional message to einfo() to the user
-#
-
-phpconfutils_extension_disable() {
- if ! use "$2" && ! phpconfutils_usecheck "$2" ; then
- my_conf="${my_conf} --disable-$1"
- [[ -n "$3" ]] && einfo " Disabling $1"
- else
- [[ -n "$3" ]] && einfo " Enabling $1"
- fi
-}
-
-# ========================================================================
-# phpconfutils_extension_enable()
-#
-# This function is like use_enable(), except that it knows about
-# enabling modules as shared libraries, and it supports passing
-# additional data with the switch
-#
-# $1 - extension name
-# $2 - USE flag
-# $3 - 1 = support shared, 0 = never support shared
-# $4 - additional setting for configure
-# $5 - additional message to einfo out to the user
-#
-
-phpconfutils_extension_enable() {
- local my_shared
-
- if [[ "$3" == "1" ]] ; then
- if [[ "${shared}+" != "+" ]] ; then
- my_shared="${shared}"
- if [[ "$4+" != "+" ]] ; then
- my_shared="${my_shared},$4"
- fi
- elif [[ "$4+" != "+" ]] ; then
- my_shared="=$4"
- fi
- else
- if [[ "$4+" != "+" ]] ; then
- my_shared="=$4"
- fi
- fi
-
- if use "$2" || phpconfutils_usecheck "$2" ; then
- my_conf="${my_conf} --enable-$1${my_shared}"
- einfo " Enabling $1"
- else
- my_conf="${my_conf} --disable-$1"
- einfo " Disabling $1"
- fi
-}
-
-# ========================================================================
-# phpconfutils_extension_without()
-#
-# Use this function to disable an extension that is enabled by default
-# This function is provided for those rare configure scripts that support
-# --without but not the corresponding --with
-#
-# $1 - extension name
-# $2 - USE flag
-# $3 - optional message to einfo() to the user
-#
-
-phpconfutils_extension_without() {
- if ! use "$2" && ! phpconfutils_usecheck "$2" ; then
- my_conf="${my_conf} --without-$1"
- einfo " Disabling $1"
- else
- einfo " Enabling $1"
- fi
-}
-
-# ========================================================================
-# phpconfutils_extension_with()
-#
-# This function is a replacement for use_with. It supports building
-# extensions as shared libraries,
-#
-# $1 - extension name
-# $2 - USE flag
-# $3 - 1 = support shared, 0 = never support shared
-# $4 - additional setting for configure
-# $5 - optional message to einfo() out to the user
-#
-
-phpconfutils_extension_with() {
- local my_shared
-
- if [[ "$3" == "1" ]] ; then
- if [[ "${shared}+" != "+" ]] ; then
- my_shared="${shared}"
- if [[ "$4+" != "+" ]] ; then
- my_shared="${my_shared},$4"
- fi
- elif [[ "$4+" != "+" ]] ; then
- my_shared="=$4"
- fi
- else
- if [[ "$4+" != "+" ]] ; then
- my_shared="=$4"
- fi
- fi
-
- if use "$2" || phpconfutils_usecheck "$2" ; then
- my_conf="${my_conf} --with-$1${my_shared}"
- einfo " Enabling $1"
- else
- my_conf="${my_conf} --without-$1"
- einfo " Disabling $1"
- fi
-}
-
-# ========================================================================
-# phpconfutils_warn_about_external_deps()
-#
-# This will output a warning to the user if he enables commercial or other
-# software not currently present in Portage
-#
-
-phpconfutils_warn_about_external_deps() {
- phpconfutils_sort_flags
-
- local x
- local my_found="0"
-
- for x in ${PHPCONFUTILS_MISSING_DEPS} ; do
- if use "${x}" || phpconfutils_usecheck "${x}" ; then
- ewarn "USE flag ${x} enables support for software not present in Portage!"
- my_found="1"
- fi
- done
-
- if [[ "${my_found}" == "1" ]] ; then
- ewarn
- ewarn "This ebuild will continue, but if you haven't already installed the"
- ewarn "software required to satisfy the list above, this package will probably"
- ewarn "fail to compile later on."
- ewarn "*DO NOT* file bugs about compile failures or issues you're having"
- ewarn "when using one of those flags, as we aren't able to support them."
- ewarn "|=|=|=|=|=|=| You are on your own if you use them! |=|=|=|=|=|=|"
- ewarn
- ebeep 5
- fi
-}
-
-# ========================================================================
-# phpconfutils_built_with_use()
-#
-# Sobstitute for built_with_use() to support the magically enabled USE flags
-#
-
-phpconfutils_built_with_use() {
- local opt="$1"
- [[ ${opt:0:1} = "-" ]] && shift || opt="-a"
-
- local PHP_PKG=$(best_version $1)
- shift
-
- local PHP_USEFILE="${EROOT}/var/lib/php-pkg/${PHP_PKG}/PHP_USEFILE"
-
- [[ ! -e "${PHP_USEFILE}" ]] && return 0
-
- local PHP_USE_BUILT=$(<${PHP_USEFILE})
- while [[ $# -gt 0 ]] ; do
- if [[ ${opt} = "-o" ]] ; then
- has $1 ${PHP_USE_BUILT} && return 0
- else
- has $1 ${PHP_USE_BUILT} || return 1
- fi
- shift
- done
- [[ ${opt} = "-a" ]]
-}
-
-# ========================================================================
-# phpconfutils_generate_usefile()
-#
-# Generate the file used by phpconfutils_built_with_use() to check it's
-# USE flags
-#
-
-phpconfutils_generate_usefile() {
- phpconfutils_sort_flags
-
- local PHP_USEFILE="${ED}/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/PHP_USEFILE"
-
- # Write the auto-enabled USEs into the correct file
- dodir "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
- echo "${PHPCONFUTILS_AUTO_USE}" > "${PHP_USEFILE}"
-}
diff --git a/eclass/ssl-cert.eclass b/eclass/ssl-cert.eclass
deleted file mode 100644
index 7a850135f7..0000000000
--- a/eclass/ssl-cert.eclass
+++ /dev/null
@@ -1,250 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ssl-cert.eclass,v 1.24 2014/03/20 19:33:13 vapier Exp $
-
-# @ECLASS: ssl-cert.eclass
-# @MAINTAINER:
-# @AUTHOR:
-# Max Kalika <max@gentoo.org>
-# @BLURB: Eclass for SSL certificates
-# @DESCRIPTION:
-# This eclass implements a standard installation procedure for installing
-# self-signed SSL certificates.
-# @EXAMPLE:
-# "install_cert /foo/bar" installs ${EROOT}/foo/bar.{key,csr,crt,pem}
-
-# @ECLASS-VARIABLE: SSL_CERT_MANDATORY
-# @DESCRIPTION:
-# Set to non zero if ssl-cert is mandatory for ebuild.
-: ${SSL_CERT_MANDATORY:=0}
-
-# @ECLASS-VARIABLE: SSL_CERT_USE
-# @DESCRIPTION:
-# Use flag to append dependency to.
-: ${SSL_CERT_USE:=ssl}
-
-if [[ "${SSL_CERT_MANDATORY}" == "0" ]]; then
- DEPEND="${SSL_CERT_USE}? ( dev-libs/openssl )"
- IUSE="${SSL_CERT_USE}"
-else
- DEPEND="dev-libs/openssl"
-fi
-
-# @FUNCTION: gen_cnf
-# @USAGE:
-# @DESCRIPTION:
-# Initializes variables and generates the needed
-# OpenSSL configuration file and a CA serial file
-#
-# Access: private
-gen_cnf() {
- # Location of the config file
- SSL_CONF="${T}/${$}ssl.cnf"
- # Location of the CA serial file
- SSL_SERIAL="${T}/${$}ca.ser"
- # Location of some random files OpenSSL can use: don't use
- # /dev/u?random here -- doesn't work properly on all platforms
- SSL_RANDOM="${T}/environment:${T}/eclass-debug.log:/etc/resolv.conf"
-
- # These can be overridden in the ebuild
- SSL_DAYS="${SSL_DAYS:-730}"
- SSL_BITS="${SSL_BITS:-1024}"
- SSL_COUNTRY="${SSL_COUNTRY:-US}"
- SSL_STATE="${SSL_STATE:-California}"
- SSL_LOCALITY="${SSL_LOCALITY:-Santa Barbara}"
- SSL_ORGANIZATION="${SSL_ORGANIZATION:-SSL Server}"
- SSL_UNIT="${SSL_UNIT:-For Testing Purposes Only}"
- SSL_COMMONNAME="${SSL_COMMONNAME:-localhost}"
- SSL_EMAIL="${SSL_EMAIL:-root@localhost}"
-
- # Create the CA serial file
- echo "01" > "${SSL_SERIAL}"
-
- # Create the config file
- ebegin "Generating OpenSSL configuration${1:+ for CA}"
- cat <<-EOF > "${SSL_CONF}"
- [ req ]
- prompt = no
- default_bits = ${SSL_BITS}
- distinguished_name = req_dn
- [ req_dn ]
- C = ${SSL_COUNTRY}
- ST = ${SSL_STATE}
- L = ${SSL_LOCALITY}
- O = ${SSL_ORGANIZATION}
- OU = ${SSL_UNIT}
- CN = ${SSL_COMMONNAME}${1:+ CA}
- emailAddress = ${SSL_EMAIL}
- EOF
- eend $?
-
- return $?
-}
-
-# @FUNCTION: get_base
-# @USAGE: [if_ca]
-# @RETURN: <base path>
-# @DESCRIPTION:
-# Simple function to determine whether we're creating
-# a CA (which should only be done once) or final part
-#
-# Access: private
-get_base() {
- if [ "${1}" ] ; then
- echo "${T}/${$}ca"
- else
- echo "${T}/${$}server"
- fi
-}
-
-# @FUNCTION: gen_key
-# @USAGE: <base path>
-# @DESCRIPTION:
-# Generates an RSA key
-#
-# Access: private
-gen_key() {
- local base=$(get_base "$1")
- ebegin "Generating ${SSL_BITS} bit RSA key${1:+ for CA}"
- openssl genrsa -rand "${SSL_RANDOM}" \
- -out "${base}.key" "${SSL_BITS}" &> /dev/null
- eend $?
-
- return $?
-}
-
-# @FUNCTION: gen_csr
-# @USAGE: <base path>
-# @DESCRIPTION:
-# Generates a certificate signing request using
-# the key made by gen_key()
-#
-# Access: private
-gen_csr() {
- local base=$(get_base "$1")
- ebegin "Generating Certificate Signing Request${1:+ for CA}"
- openssl req -config "${SSL_CONF}" -new \
- -key "${base}.key" -out "${base}.csr" &>/dev/null
- eend $?
-
- return $?
-}
-
-# @FUNCTION: gen_crt
-# @USAGE: <base path>
-# @DESCRIPTION:
-# Generates either a self-signed CA certificate using
-# the csr and key made by gen_csr() and gen_key() or
-# a signed server certificate using the CA cert previously
-# created by gen_crt()
-#
-# Access: private
-gen_crt() {
- local base=$(get_base "$1")
- if [ "${1}" ] ; then
- ebegin "Generating self-signed X.509 Certificate for CA"
- openssl x509 -extfile "${SSL_CONF}" \
- -days ${SSL_DAYS} -req -signkey "${base}.key" \
- -in "${base}.csr" -out "${base}.crt" &>/dev/null
- else
- local ca=$(get_base 1)
- ebegin "Generating authority-signed X.509 Certificate"
- openssl x509 -extfile "${SSL_CONF}" \
- -days ${SSL_DAYS} -req -CAserial "${SSL_SERIAL}" \
- -CAkey "${ca}.key" -CA "${ca}.crt" \
- -in "${base}.csr" -out "${base}.crt" &>/dev/null
- fi
- eend $?
-
- return $?
-}
-
-# @FUNCTION: gen_pem
-# @USAGE: <base path>
-# @DESCRIPTION:
-# Generates a PEM file by concatinating the key
-# and cert file created by gen_key() and gen_cert()
-#
-# Access: private
-gen_pem() {
- local base=$(get_base "$1")
- ebegin "Generating PEM Certificate"
- (cat "${base}.key"; echo; cat "${base}.crt") > "${base}.pem"
- eend $?
-
- return $?
-}
-
-# @FUNCTION: install_cert
-# @USAGE: <certificates>
-# @DESCRIPTION:
-# Uses all the private functions above to generate and install the
-# requested certificates.
-# <certificates> are full pathnames relative to ROOT, without extension.
-#
-# Example: "install_cert /foo/bar" installs ${EROOT}/foo/bar.{key,csr,crt,pem}
-#
-# Access: public
-install_cert() {
- if [ $# -lt 1 ] ; then
- eerror "At least one argument needed"
- return 1;
- fi
-
- case ${EBUILD_PHASE} in
- unpack|prepare|configure|compile|test|install)
- die "install_cert cannot be called in ${EBUILD_PHASE}"
- ;;
- esac
-
- # Generate a CA environment #164601
- gen_cnf 1 || return 1
- gen_key 1 || return 1
- gen_csr 1 || return 1
- gen_crt 1 || return 1
- echo
-
- gen_cnf || return 1
- echo
-
- local count=0
- for cert in "$@" ; do
- # Check the requested certificate
- if [ -z "${cert##*/}" ] ; then
- ewarn "Invalid certification requested, skipping"
- continue
- fi
-
- # Check for previous existence of generated files
- for type in key csr crt pem ; do
- if [ -e "${EROOT}${cert}.${type}" ] ; then
- ewarn "${EROOT}${cert}.${type}: exists, skipping"
- continue 2
- fi
- done
-
- # Generate the requested files
- gen_key || continue
- gen_csr || continue
- gen_crt || continue
- gen_pem || continue
- echo
-
- # Install the generated files and set sane permissions
- local base=$(get_base)
- install -d "${EROOT}${cert%/*}"
- install -m0400 "${base}.key" "${EROOT}${cert}.key"
- install -m0444 "${base}.csr" "${EROOT}${cert}.csr"
- install -m0444 "${base}.crt" "${EROOT}${cert}.crt"
- install -m0400 "${base}.pem" "${EROOT}${cert}.pem"
- : $(( ++count ))
- done
-
- # Resulting status
- if [ ${count} = 0 ] ; then
- eerror "No certificates were generated"
- return 1
- elif [ ${count} != ${#} ] ; then
- ewarn "Some requested certificates were not generated"
- fi
-}
diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass
deleted file mode 100644
index 009c033d43..0000000000
--- a/eclass/webapp.eclass
+++ /dev/null
@@ -1,583 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.72 2012/07/18 14:59:29 blueness Exp $
-
-# @ECLASS: webapp.eclass
-# @MAINTAINER:
-# web-apps@gentoo.org
-# @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
-
-# @ECLASS-VARIABLE: WEBAPP_DEPEND
-# @DESCRIPTION:
-# An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be built, most
-# notably in combination with WEBAPP_OPTIONAL.
-WEBAPP_DEPEND=">=app-admin/webapp-config-1.50.15"
-
-# @ECLASS-VARIABLE: WEBAPP_NO_AUTO_INSTALL
-# @DESCRIPTION:
-# An ebuild sets this to `yes' if an automatic installation and/or upgrade is
-# not possible. The ebuild should overwrite pkg_postinst() and explain the
-# reason for this BEFORE calling webapp_pkg_postinst().
-
-# @ECLASS-VARIABLE: WEBAPP_OPTIONAL
-# @DESCRIPTION:
-# An ebuild sets this to `yes' to make webapp support optional, in which case
-# you also need to take care of USE-flags and dependencies.
-
-if [[ "${WEBAPP_OPTIONAL}" != "yes" ]]; then
- [[ "${WEBAPP_NO_AUTO_INSTALL}" == "yes" ]] || IUSE="vhosts"
- SLOT="${PVR}"
- DEPEND="${WEBAPP_DEPEND}"
- RDEPEND="${DEPEND}"
-fi
-
-EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm
-
-INSTALL_DIR="/${PN}"
-IS_UPGRADE=0
-IS_REPLACE=0
-
-INSTALL_CHECK_FILE="installed_by_webapp_eclass"
-SETUP_CHECK_FILE="setup_by_webapp_eclass"
-
-ETC_CONFIG="${EROOT}etc/vhosts/webapp-config"
-WEBAPP_CONFIG="${EROOT}usr/sbin/webapp-config"
-WEBAPP_CLEANER="${EROOT}usr/sbin/webapp-cleaner"
-
-# ==============================================================================
-# INTERNAL FUNCTIONS
-# ==============================================================================
-
-# Load the config file /etc/vhosts/webapp-config
-# Supports both the old bash version, and the new python version
-webapp_read_config() {
- debug-print-function $FUNCNAME $*
-
- if has_version '>=app-admin/webapp-config-1.50'; then
- ENVVAR=$(${WEBAPP_CONFIG} --query ${PN} ${PVR}) || die "Could not read settings from webapp-config!"
- eval ${ENVVAR}
- elif [[ "${WEBAPP_OPTIONAL}" != "yes" ]]; then
- # ETC_CONFIG might not be available
- . ${ETC_CONFIG} || die "Unable to read ${ETC_CONFIG}"
- elif [[ -f "${ETC_CONFIG}" ]]; then
- # WEBAPP_OPTIONAL is set to yes
- # and this must run only if ETC_CONFIG actually exists
- . ${ETC_CONFIG} || die "Unable to read ${ETC_CONFIG}"
- fi
-}
-
-# Check whether a specified file exists in the given directory (`.' by default)
-webapp_checkfileexists() {
- debug-print-function $FUNCNAME $*
-
- local my_prefix=${2:+${2}/}
-
- if [[ ! -e "${my_prefix}${1}" ]]; then
- msg="ebuild fault: file '${1}' not found"
- eerror "$msg"
- eerror "Please report this as a bug at http://bugs.gentoo.org/"
- die "$msg"
- fi
-}
-
-webapp_check_installedat() {
- debug-print-function $FUNCNAME $*
- ${WEBAPP_CONFIG} --show-installed -h localhost -d "${INSTALL_DIR}" 2> /dev/null
-}
-
-webapp_strip_appdir() {
- debug-print-function $FUNCNAME $*
- echo "${1#${MY_APPDIR}/}"
-}
-
-webapp_strip_d() {
- debug-print-function $FUNCNAME $*
- echo "${1#${ED}}"
-}
-
-webapp_strip_cwd() {
- debug-print-function $FUNCNAME $*
- echo "${1/#.\///}"
-}
-
-webapp_getinstalltype() {
- debug-print-function $FUNCNAME $*
-
- if ! has vhosts ${IUSE} || use vhosts; then
- return
- fi
-
- local my_output
- my_output="$(webapp_check_installedat)"
-
- if [[ $? -eq 0 ]]; then
- # something is already installed there
- # make sure it isn't the same version
-
- local my_pn="$(echo ${my_output} | awk '{ print $1 }')"
- local my_pvr="$(echo ${my_output} | awk '{ print $2 }')"
-
- REMOVE_PKG="${my_pn}-${my_pvr}"
-
- if [[ "${my_pn}" == "${PN}" ]]; then
- if [[ "${my_pvr}" != "${PVR}" ]]; then
- elog "This is an upgrade"
- IS_UPGRADE=1
- # for binpkgs, reset status, var declared in global scope
- IS_REPLACE=0
- else
- elog "This is a re-installation"
- IS_REPLACE=1
- # for binpkgs, reset status, var declared in global scope
- IS_UPGRADE=0
- fi
- else
- elog "${my_output} is installed there"
- fi
- else
- # for binpkgs, reset status, var declared in global scope
- IS_REPLACE=0
- IS_UPGRADE=0
- elog "This is an installation"
- fi
-}
-
-# ==============================================================================
-# PUBLIC FUNCTIONS
-# ==============================================================================
-
-# @FUNCTION: need_httpd
-# @DESCRIPTION:
-# Call this function AFTER your ebuilds DEPEND line if any of the available
-# webservers are able to run this application.
-need_httpd() {
- DEPEND="${DEPEND}
- || ( virtual/httpd-basic virtual/httpd-cgi virtual/httpd-fastcgi )"
-}
-
-# @FUNCTION: need_httpd_cgi
-# @DESCRIPTION:
-# Call this function AFTER your ebuilds DEPEND line if any of the available
-# CGI-capable webservers are able to run this application.
-need_httpd_cgi() {
- DEPEND="${DEPEND}
- || ( virtual/httpd-cgi virtual/httpd-fastcgi )"
-}
-
-# @FUNCTION: need_httpd_fastcgi
-# @DESCRIPTION:
-# Call this function AFTER your ebuilds DEPEND line if any of the available
-# FastCGI-capabale webservers are able to run this application.
-need_httpd_fastcgi() {
- DEPEND="${DEPEND}
- virtual/httpd-fastcgi"
-}
-
-# @FUNCTION: webapp_configfile
-# @USAGE: <file> [more files ...]
-# @DESCRIPTION:
-# Mark a file config-protected for a web-based application.
-webapp_configfile() {
- debug-print-function $FUNCNAME $*
-
- local m
- for m in "$@"; do
- webapp_checkfileexists "${m}" "${ED}"
-
- local my_file="$(webapp_strip_appdir "${m}")"
- my_file="$(webapp_strip_cwd "${my_file}")"
-
- elog "(config) ${my_file}"
- echo "${my_file}" >> ${ED}/${WA_CONFIGLIST}
- done
-}
-
-# @FUNCTION: webapp_hook_script
-# @USAGE: <file>
-# @DESCRIPTION:
-# Install a script that will run after a virtual copy is created, and
-# before a virtual copy has been removed.
-webapp_hook_script() {
- debug-print-function $FUNCNAME $*
-
- webapp_checkfileexists "${1}"
-
- elog "(hook) ${1}"
- cp "${1}" "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")" || die "Unable to install ${1} into ${D}/${MY_HOOKSCRIPTSDIR}/"
- chmod 555 "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")"
-}
-
-# @FUNCTION: webapp_postinst_txt
-# @USAGE: <lang> <file>
-# @DESCRIPTION:
-# Install a text file containing post-installation instructions.
-webapp_postinst_txt() {
- debug-print-function $FUNCNAME $*
-
- webapp_checkfileexists "${2}"
-
- elog "(info) ${2} (lang: ${1})"
- cp "${2}" "${D}/${MY_APPDIR}/postinst-${1}.txt"
-}
-
-# @FUNCTION: webapp_postupgrade_txt
-# @USAGE: <lang> <file>
-# @DESCRIPTION:
-# Install a text file containing post-upgrade instructions.
-webapp_postupgrade_txt() {
- debug-print-function $FUNCNAME $*
-
- webapp_checkfileexists "${2}"
-
- elog "(info) ${2} (lang: ${1})"
- cp "${2}" "${D}/${MY_APPDIR}/postupgrade-${1}.txt"
-}
-
-# helper for webapp_serverowned()
-_webapp_serverowned() {
- debug-print-function $FUNCNAME $*
-
- webapp_checkfileexists "${1}" "${ED}"
- local my_file="$(webapp_strip_appdir "${1}")"
- my_file="$(webapp_strip_cwd "${my_file}")"
-
- elog "(server owned) ${my_file}"
- echo "${my_file}" >> "${D}/${WA_SOLIST}"
-}
-
-# @FUNCTION: webapp_serverowned
-# @USAGE: [-R] <file> [more files ...]
-# @DESCRIPTION:
-# Identify a file which must be owned by the webserver's user:group settings.
-# The ownership of the file is NOT set until the application is installed using
-# the webapp-config tool. If -R is given directories are handled recursively.
-webapp_serverowned() {
- debug-print-function $FUNCNAME $*
-
- local a m
- if [[ "${1}" == "-R" ]]; then
- shift
- for m in "$@"; do
- find "${ED}${m}" | while read a; do
- a=$(webapp_strip_d "${a}")
- _webapp_serverowned "${a}"
- done
- done
- else
- for m in "$@"; do
- _webapp_serverowned "${m}"
- done
- fi
-}
-
-# @FUNCTION: webapp_server_configfile
-# @USAGE: <server> <file> [new name]
-# @DESCRIPTION:
-# Install a configuration file for the webserver. You need to specify a
-# webapp-config supported <server>. if no new name is given `basename $2' is
-# used by default. Note: this function will automagically prepend $1 to the
-# front of your config file's name.
-webapp_server_configfile() {
- debug-print-function $FUNCNAME $*
-
- webapp_checkfileexists "${2}"
-
- # WARNING:
- #
- # do NOT change the naming convention used here without changing all
- # the other scripts that also rely upon these names
-
- local my_file="${1}-${3:-$(basename "${2}")}"
-
- elog "(${1}) config file '${my_file}'"
- cp "${2}" "${D}/${MY_SERVERCONFIGDIR}/${my_file}"
-}
-
-# @FUNCTION: webapp_sqlscript
-# @USAGE: <db> <file> [version]
-# @DESCRIPTION:
-# Install a SQL script that creates/upgrades a database schema for the web
-# application. Currently supported database engines are mysql and postgres.
-# If a version is given the script should upgrade the database schema from
-# the given version to $PVR.
-webapp_sqlscript() {
- debug-print-function $FUNCNAME $*
-
- webapp_checkfileexists "${2}"
-
- dodir "${MY_SQLSCRIPTSDIR}/${1}"
-
- # WARNING:
- #
- # do NOT change the naming convention used here without changing all
- # the other scripts that also rely upon these names
-
- if [[ -n "${3}" ]]; then
- elog "(${1}) upgrade script for ${PN}-${3} to ${PVR}"
- cp "${2}" "${D}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
- chmod 600 "${D}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
- else
- elog "(${1}) create script for ${PN}-${PVR}"
- cp "${2}" "${D}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
- chmod 600 "${D}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
- fi
-}
-
-# @FUNCTION: webapp_src_preinst
-# @DESCRIPTION:
-# You need to call this function in src_install() BEFORE anything else has run.
-# For now we just create required webapp-config directories.
-webapp_src_preinst() {
- debug-print-function $FUNCNAME $*
-
- # sanity checks, to catch bugs in the ebuild
- if [[ ! -f "${T}/${SETUP_CHECK_FILE}" ]]; then
- eerror
- eerror "This ebuild did not call webapp_pkg_setup() at the beginning"
- eerror "of the pkg_setup() function"
- eerror
- eerror "Please log a bug on http://bugs.gentoo.org"
- eerror
- eerror "You should use emerge -C to remove this package, as the"
- eerror "installation is incomplete"
- eerror
- die "Ebuild did not call webapp_pkg_setup() - report to http://bugs.gentoo.org"
- fi
-
- # Hint, see the webapp_read_config() function to find where these are
- # defined.
- dodir "${MY_HTDOCSDIR#${EPREFIX}}"
- dodir "${MY_HOSTROOTDIR#${EPREFIX}}"
- dodir "${MY_CGIBINDIR#${EPREFIX}}"
- dodir "${MY_ICONSDIR#${EPREFIX}}"
- dodir "${MY_ERRORSDIR#${EPREFIX}}"
- dodir "${MY_SQLSCRIPTSDIR#${EPREFIX}}"
- dodir "${MY_HOOKSCRIPTSDIR#${EPREFIX}}"
- dodir "${MY_SERVERCONFIGDIR#${EPREFIX}}"
-}
-
-# ==============================================================================
-# EXPORTED FUNCTIONS
-# ==============================================================================
-
-# @FUNCTION: webapp_pkg_setup
-# @DESCRIPTION:
-# The default pkg_setup() for this eclass. This will gather required variables
-# from webapp-config and check if there is an application installed to
-# `${EROOT}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set.
-#
-# You need to call this function BEFORE anything else has run in your custom
-# pkg_setup().
-webapp_pkg_setup() {
- debug-print-function $FUNCNAME $*
-
- # to test whether or not the ebuild has correctly called this function
- # we add an empty file to the filesystem
- #
- # we used to just set a variable in the shell script, but we can
- # no longer rely on Portage calling both webapp_pkg_setup() and
- # webapp_src_install() within the same shell process
- touch "${T}/${SETUP_CHECK_FILE}"
-
- # special case - some ebuilds *do* need to overwride the SLOT
- if [[ "${SLOT}+" != "${PVR}+" && "${WEBAPP_MANUAL_SLOT}" != "yes" ]]; then
- die "Set WEBAPP_MANUAL_SLOT=\"yes\" if you need to SLOT manually"
- fi
-
- # pull in the shared configuration file
- G_HOSTNAME="localhost"
- webapp_read_config
-
- local my_dir="${EROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
-
- # if USE=vhosts is enabled OR no application is installed we're done here
- if ! has vhosts ${IUSE} || use vhosts || [[ ! -d "${my_dir}" ]]; then
- return
- fi
-
- local my_output
- my_output="$(webapp_check_installedat)"
-
- if [[ $? -ne 0 ]]; then
- # okay, whatever is there, it isn't webapp-config-compatible
- echo
- ewarn
- ewarn "You already have something installed in ${my_dir}"
- ewarn
- ewarn "Whatever is in ${my_dir}, it's not"
- ewarn "compatible with webapp-config."
- ewarn
- ewarn "This ebuild may be overwriting important files."
- ewarn
- echo
- if has "${EAPI:-0}" 0 1 2; then
- ebeep 10
- fi
- elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then
- echo
- eerror "You already have ${my_output} installed in ${my_dir}"
- eerror
- eerror "I cannot upgrade a different application"
- eerror
- echo
- die "Cannot upgrade contents of ${my_dir}"
- fi
-
-}
-
-# @FUNCTION: webapp_src_install
-# @DESCRIPTION:
-# This is the default src_install(). For now, we just make sure that root owns
-# everything, and that there are no setuid files.
-#
-# You need to call this function AFTER everything else has run in your custom
-# src_install().
-webapp_src_install() {
- debug-print-function $FUNCNAME $*
-
- # to test whether or not the ebuild has correctly called this function
- # we add an empty file to the filesystem
- #
- # we used to just set a variable in the shell script, but we can
- # no longer rely on Portage calling both webapp_src_install() and
- # webapp_pkg_postinst() within the same shell process
- touch "${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE}"
-
- use prefix || chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${ED}/"
- chmod -R u-s "${ED}/"
- chmod -R g-s "${ED}/"
-
- keepdir "${MY_PERSISTDIR#${EPREFIX}}"
- #don't chown to root in prefix
- use prefix || fowners "root:0" "${MY_PERSISTDIR#${EPREFIX}}"
- fperms 755 "${MY_PERSISTDIR#${EPREFIX}}"
-}
-
-# @FUNCTION: webapp_pkg_postinst
-# @DESCRIPTION:
-# The default pkg_postinst() for this eclass. This installs the web application to
-# `${EROOT}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set. Otherwise
-# display a short notice how to install this application with webapp-config.
-#
-# You need to call this function AFTER everything else has run in your custom
-# pkg_postinst().
-webapp_pkg_postinst() {
- debug-print-function $FUNCNAME $*
-
- webapp_read_config
-
- # sanity checks, to catch bugs in the ebuild
- if [[ ! -f "${ROOT}${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]]; then
- eerror
- eerror "This ebuild did not call webapp_src_install() at the end"
- eerror "of the src_install() function"
- eerror
- eerror "Please log a bug on http://bugs.gentoo.org"
- eerror
- eerror "You should use emerge -C to remove this package, as the"
- eerror "installation is incomplete"
- eerror
- die "Ebuild did not call webapp_src_install() - report to http://bugs.gentoo.org"
- fi
-
- if has vhosts ${IUSE}; then
- if ! use vhosts; then
- echo
- elog "vhosts USE flag not set - auto-installing using webapp-config"
-
- G_HOSTNAME="localhost"
- webapp_read_config
-
- local my_mode=-I
- webapp_getinstalltype
-
- if [[ "${IS_REPLACE}" == "1" ]]; then
- elog "${PN}-${PVR} is already installed - replacing"
- my_mode=-I
- elif [[ "${IS_UPGRADE}" == "1" ]]; then
- elog "${REMOVE_PKG} is already installed - upgrading"
- my_mode=-U
- else
- elog "${PN}-${PVR} is not installed - using install mode"
- fi
-
- my_cmd="${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTALL_DIR} ${PN} ${PVR}"
- elog "Running ${my_cmd}"
- ${my_cmd}
-
- echo
- local cleaner="${WEBAPP_CLEANER} -p -C /${PN}"
- einfo "Running ${cleaner}"
- ${cleaner}
- else
- elog
- elog "The 'vhosts' USE flag is switched ON"
- elog "This means that Portage will not automatically run webapp-config to"
- elog "complete the installation."
- elog
- elog "To install ${PN}-${PVR} into a virtual host, run the following command:"
- elog
- elog " webapp-config -I -h <host> -d ${PN} ${PN} ${PVR}"
- elog
- elog "For more details, see the webapp-config(8) man page"
- fi
- else
- elog
- elog "This ebuild does not support the 'vhosts' USE flag."
- elog "This means that Portage will not automatically run webapp-config to"
- elog "complete the installation."
- elog
- elog "To install ${PN}-${PVR} into a virtual host, run the following command:"
- elog
- elog " webapp-config -I -h <host> -d ${PN} ${PN} ${PVR}"
- elog
- elog "For more details, see the webapp-config(8) man page"
- fi
-}
-
-# @FUNCTION: webapp_pkg_prerm
-# @DESCRIPTION:
-# This is the default pkg_prerm() for this eclass. If USE=vhosts is not set
-# remove all installed copies of this web application. Otherwise instruct the
-# user to manually remove those copies. See bug #136959.
-webapp_pkg_prerm() {
- debug-print-function $FUNCNAME $*
-
- local my_output=
- my_output="$(${WEBAPP_CONFIG} --list-installs ${PN} ${PVR})"
- [[ $? -ne 0 ]] && return
-
- local x
- if has vhosts ${IUSE} && ! use vhosts; then
- echo "${my_output}" | while read x; do
- if [[ -f "${x}"/.webapp ]]; then
- . "${x}"/.webapp
- if [[ -n "${WEB_HOSTNAME}" && -n "${WEB_INSTALLDIR}" ]]; then
- ${WEBAPP_CONFIG} -C -h ${WEB_HOSTNAME} -d ${WEB_INSTALLDIR} ${PN} ${PVR}
- fi
- else
- ewarn "Cannot find file ${x}/.webapp"
- fi
- done
- elif [[ "${my_output}" != "" ]]; then
- echo
- ewarn
- ewarn "Don't forget to use webapp-config to remove any copies of"
- ewarn "${PN}-${PVR} installed in"
- ewarn
-
- echo "${my_output}" | while read x; do
- if [[ -f "${x}"/.webapp ]]; then
- ewarn " ${x}"
- else
- ewarn "Cannot find file ${x}/.webapp"
- fi
- done
-
- ewarn
- echo
- fi
-}
diff --git a/eclass/x-modular.eclass b/eclass/x-modular.eclass
deleted file mode 100644
index 592c7346d8..0000000000
--- a/eclass/x-modular.eclass
+++ /dev/null
@@ -1,634 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.126 2013/07/05 17:39:10 ulm Exp $
-#
-# DEPRECATED
-# This eclass has been superseded by xorg-2
-# Please modify your ebuilds to use that instead
-#
-# @ECLASS: x-modular.eclass
-# @MAINTAINER:
-# Donnie Berkholz <dberkholz@gentoo.org>
-# x11@gentoo.org
-# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
-# @DESCRIPTION:
-# This eclass makes trivial X ebuilds possible for apps, fonts, drivers,
-# and more. Many things that would normally be done in various functions
-# can be accessed by setting variables instead, such as patching,
-# running eautoreconf, passing options to configure and installing docs.
-#
-# All you need to do in a basic ebuild is inherit this eclass and set
-# DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted
-# with the other X packages, you don't need to set SRC_URI. Pretty much
-# everything else should be automatic.
-
-if [[ ${PV} = 9999* ]]; then
- GIT_ECLASS="git"
- SNAPSHOT="yes"
- SRC_URI=""
-fi
-
-# If we're a font package, but not the font.alias one
-FONT_ECLASS=""
-if [[ "${PN/#font-}" != "${PN}" ]] \
- && [[ "${CATEGORY}" = "media-fonts" ]] \
- && [[ "${PN}" != "font-alias" ]] \
- && [[ "${PN}" != "font-util" ]]; then
- # Activate font code in the rest of the eclass
- FONT="yes"
-
- # Whether to inherit the font eclass
- FONT_ECLASS="font"
-fi
-
-inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
- ${FONT_ECLASS} ${GIT_ECLASS}
-
-EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm"
-
-case "${EAPI:-0}" in
- 0|1)
- ;;
- 2)
- EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure"
- ;;
- *)
- die "Unknown EAPI ${EAPI}"
- ;;
-esac
-
-# exports must be ALWAYS after inherit
-EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
-
-# @ECLASS-VARIABLE: XDIR
-# @DESCRIPTION:
-# Directory prefix to use for everything. If you want to install to a
-# non-default prefix (e.g., /opt/xorg), change XDIR. This has not been
-# recently tested. You may need to uncomment the setting of datadir and
-# mandir in x-modular_src_install() or add it back in if it's no longer
-# there. You may also want to change the SLOT.
-XDIR="${EPREFIX}/usr"
-
-IUSE=""
-HOMEPAGE="http://xorg.freedesktop.org/"
-
-# @ECLASS-VARIABLE: SNAPSHOT
-# @DESCRIPTION:
-# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
-# before inheriting this eclass.
-: ${SNAPSHOT:=no}
-
-# Set up SRC_URI for individual modular releases
-BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"
-# @ECLASS-VARIABLE: MODULE
-# @DESCRIPTION:
-# The subdirectory to download source from. Possible settings are app,
-# doc, data, util, driver, font, lib, proto, xserver. Set above the
-# inherit to override the default autoconfigured module.
-if [[ -z ${MODULE} ]]; then
- case ${CATEGORY} in
- app-doc) MODULE="doc" ;;
- media-fonts) MODULE="font" ;;
- x11-apps|x11-wm) MODULE="app" ;;
- x11-misc|x11-themes) MODULE="util" ;;
- x11-drivers) MODULE="driver" ;;
- x11-base) MODULE="xserver" ;;
- x11-proto) MODULE="proto" ;;
- x11-libs) MODULE="lib" ;;
- esac
-fi
-
-if [[ -n ${GIT_ECLASS} ]]; then
- EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}"
-else
- SRC_URI="${SRC_URI} ${BASE_INDIVIDUAL_URI}/${MODULE}/${P}.tar.bz2"
-fi
-
-SLOT="0"
-
-# Set the license for the package. This can be overridden by setting
-# LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages
-# are under the MIT license. (This is what Red Hat does in their rpms)
-LICENSE="MIT"
-
-# Set up shared dependencies
-if [[ -n "${SNAPSHOT}" ]]; then
-# FIXME: What's the minimal libtool version supporting arbitrary versioning?
- DEPEND="${DEPEND}
- >=sys-devel/libtool-1.5
- >=sys-devel/m4-1.4"
- WANT_AUTOCONF="latest"
- WANT_AUTOMAKE="latest"
-fi
-
-if [[ -n "${FONT}" ]]; then
- RDEPEND="${RDEPEND}
- media-fonts/encodings
- x11-apps/mkfontscale
- x11-apps/mkfontdir"
- PDEPEND="${PDEPEND}
- media-fonts/font-alias"
-
- # Starting with 7.0RC3, we can specify the font directory
- # But oddly, we can't do the same for encodings or font-alias
-
-# @ECLASS-VARIABLE: FONT_DIR
-# @DESCRIPTION:
-# If you're creating a font package and the suffix of PN is not equal to
-# the subdirectory of /usr/share/fonts/ it should install into, set
-# FONT_DIR to that directory or directories. Set before inheriting this
-# eclass.
- : ${FONT_DIR:=${PN##*-}}
-
- # Fix case of font directories
- FONT_DIR=${FONT_DIR/ttf/TTF}
- FONT_DIR=${FONT_DIR/otf/OTF}
- FONT_DIR=${FONT_DIR/type1/Type1}
- FONT_DIR=${FONT_DIR/speedo/Speedo}
-
- # Set up configure options, wrapped so ebuilds can override if need be
- if [[ -z ${FONT_OPTIONS} ]]; then
- FONT_OPTIONS="--with-fontdir=\"${EPREFIX}/usr/share/fonts/${FONT_DIR}\""
- fi
-
- if [[ -n "${FONT}" ]]; then
- if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then
- IUSE="${IUSE} nls"
- fi
- fi
-fi
-
-# If we're a driver package
-if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then
- # Enable driver code in the rest of the eclass
- DRIVER="yes"
-fi
-
-# Debugging -- ignore packages that can't be built with debugging
-if [[ -z "${FONT}" ]] \
- && [[ "${CATEGORY/app-doc}" = "${CATEGORY}" ]] \
- && [[ "${CATEGORY/x11-proto}" = "${CATEGORY}" ]] \
- && [[ "${PN/util-macros}" = "${PN}" ]] \
- && [[ "${PN/xbitmaps}" = "${PN}" ]] \
- && [[ "${PN/xkbdata}" = "${PN}" ]] \
- && [[ "${PN/xorg-cf-files}" = "${PN}" ]] \
- && [[ "${PN/xcursor}" = "${PN}" ]] \
- ; then
- DEBUGGABLE="yes"
- IUSE="${IUSE} debug"
-fi
-
-DEPEND="${DEPEND}
- virtual/pkgconfig"
-
-if [[ "${PN/util-macros}" = "${PN}" ]]; then
- DEPEND="${DEPEND}
- >=x11-misc/util-macros-1.3.0"
-fi
-
-RDEPEND="${RDEPEND}
- !<=x11-base/xorg-x11-6.9"
-# Provides virtual/x11 for temporary use until packages are ported
-# x11-base/x11-env"
-
-# @FUNCTION: x-modular_specs_check
-# @USAGE:
-# @DESCRIPTION:
-# Make any necessary changes related to gcc specs (generally hardened)
-x-modular_specs_check() {
- if [[ ${PN:0:11} = "xorg-server" ]] || [[ -n "${DRIVER}" ]]; then
- append-ldflags -Wl,-z,lazy
- # (#116698) breaks loading
- filter-ldflags -Wl,-z,now
- fi
-}
-
-# @FUNCTION: x-modular_dri_check
-# @USAGE:
-# @DESCRIPTION:
-# Ensures the server supports DRI if building a driver with DRI support
-x-modular_dri_check() {
- # (#120057) Enabling DRI in drivers requires that the server was built with
- # support for it
- # Starting with xorg-server 1.5.3, DRI support is always enabled unless
- # USE=minimal is set (see bug #252084)
- if [[ -n "${DRIVER}" ]]; then
- if has dri ${IUSE} && use dri; then
- einfo "Checking for direct rendering capabilities ..."
- if has_version '>=x11-base/xorg-server-1.5.3'; then
- if built_with_use x11-base/xorg-server minimal; then
- die "You must build x11-base/xorg-server with USE=-minimal."
- fi
- else
- if ! built_with_use x11-base/xorg-server dri; then
- die "You must build x11-base/xorg-server with USE=dri."
- fi
- fi
- fi
- fi
-}
-
-# @FUNCTION: x-modular_server_supports_drivers_check
-# @USAGE:
-# @DESCRIPTION:
-# Ensures the server SDK is installed if a driver is being built
-x-modular_server_supports_drivers_check() {
- # (#135873) Only certain servers will actually use or be capable of
- # building external drivers, including binary drivers.
- if [[ -n "${DRIVER}" ]]; then
- if has_version '>=x11-base/xorg-server-1.1'; then
- if ! built_with_use x11-base/xorg-server xorg; then
- eerror "x11-base/xorg-server is not built with support for external drivers."
- die "You must build x11-base/xorg-server with USE=xorg."
- fi
- fi
- fi
-}
-
-# @FUNCTION: x-modular_unpack_source
-# @USAGE:
-# @DESCRIPTION:
-# Simply unpack source code. Nothing else.
-x-modular_unpack_source() {
- if [[ -n ${GIT_ECLASS} ]]; then
- git_src_unpack
- else
- unpack ${A}
- fi
- cd "${S}"
-
- if [[ -n ${FONT_OPTIONS} ]]; then
- einfo "Detected font directory: ${FONT_DIR}"
- fi
-}
-
-# @FUNCTION: x-modular_patch_source
-# @USAGE:
-# @DESCRIPTION:
-# Apply all patches
-x-modular_patch_source() {
- # Use standardized names and locations with bulk patching
- # Patch directory is ${WORKDIR}/patch
- # See epatch() in eutils.eclass for more documentation
- if [[ -z "${EPATCH_SUFFIX}" ]] ; then
- EPATCH_SUFFIX="patch"
- fi
-
-# @VARIABLE: PATCHES
-# @DESCRIPTION:
-# If you have any patches to apply, set PATCHES to their locations and epatch
-# will apply them. It also handles epatch-style bulk patches, if you know how to
-# use them and set the correct variables. If you don't, read eutils.eclass.
- if [[ ${#PATCHES[@]} -gt 1 ]]; then
- for x in "${PATCHES[@]}"; do
- epatch "${x}"
- done
- elif [[ -n "${PATCHES}" ]]; then
- for x in ${PATCHES}; do
- epatch "${x}"
- done
- # For non-default directory bulk patching
- elif [[ -n "${PATCH_LOC}" ]] ; then
- epatch ${PATCH_LOC}
- # For standard bulk patching
- elif [[ -d "${EPATCH_SOURCE}" ]] ; then
- epatch
- fi
-}
-
-# @FUNCTION: x-modular_reconf_source
-# @USAGE:
-# @DESCRIPTION:
-# Run eautoreconf if necessary, and run elibtoolize.
-x-modular_reconf_source() {
- if [[ "${SNAPSHOT}" = "yes" ]]
- then
- # If possible, generate configure if it doesn't exist
- if [ -f "./configure.ac" ]
- then
- eautoreconf
- return $?
- fi
- fi
-
- case ${CHOST} in
- *-interix* | *-aix* | *-winnt*)
- # Need recent libtool for interix, aix, winnt.
- # For performance reasons do it where really required only.
- # <haubi@gentoo.org> - July 21, 2008
- eautoreconf
- ;;
- *)
- # Joshua Baergen - October 23, 2005
- # Fix shared lib issues on MIPS, FBSD, etc etc
- elibtoolize
- ;;
- esac
-}
-
-# @FUNCTION: x-modular_src_prepare
-# @USAGE:
-# @DESCRIPTION:
-# Prepare a package after unpacking, performing all X-related tasks.
-x-modular_src_prepare() {
- [[ -n ${GIT_ECLASS} ]] && has src_prepare ${EXPORTED_FUNCTIONS} \
- && git_src_prepare
- x-modular_patch_source
- x-modular_reconf_source
-}
-
-# @FUNCTION: x-modular_src_unpack
-# @USAGE:
-# @DESCRIPTION:
-# Unpack a package, performing all X-related tasks.
-x-modular_src_unpack() {
- x-modular_specs_check
- x-modular_server_supports_drivers_check
- x-modular_dri_check
- x-modular_unpack_source
- has src_prepare ${EXPORTED_FUNCTIONS} || x-modular_src_prepare
-}
-
-# @FUNCTION: x-modular_font_configure
-# @USAGE:
-# @DESCRIPTION:
-# If a font package, perform any necessary configuration steps
-x-modular_font_configure() {
- if [[ -n "${FONT}" ]]; then
- # Might be worth adding an option to configure your desired font
- # and exclude all others. Also, should this USE be nls or minimal?
- if has nls ${IUSE//+} && ! use nls; then
- FONT_OPTIONS="${FONT_OPTIONS}
- --disable-iso8859-2
- --disable-iso8859-3
- --disable-iso8859-4
- --disable-iso8859-5
- --disable-iso8859-6
- --disable-iso8859-7
- --disable-iso8859-8
- --disable-iso8859-9
- --disable-iso8859-10
- --disable-iso8859-11
- --disable-iso8859-12
- --disable-iso8859-13
- --disable-iso8859-14
- --disable-iso8859-15
- --disable-iso8859-16
- --disable-jisx0201
- --disable-koi8-r"
- fi
- fi
-}
-
-# @FUNCTION: x-modular_debug_setup
-# @USAGE:
-# @DESCRIPTION:
-# Set up CFLAGS for a debug build
-x-modular_debug_setup() {
- if [[ -n "${DEBUGGABLE}" ]]; then
- if use debug; then
- strip-flags
- append-flags -g
- fi
- fi
-}
-
-# @FUNCTION: x-modular_src_configure
-# @USAGE:
-# @DESCRIPTION:
-# Perform any necessary pre-configuration steps, then run configure
-x-modular_src_configure() {
- x-modular_font_configure
- x-modular_debug_setup
-
- [[ ${CHOST} == *-winnt* ]] && append-flags -DWIN32 -D__STDC__
-
-# @VARIABLE: CONFIGURE_OPTIONS
-# @DESCRIPTION:
-# Any extra options to pass to configure
-
- # If prefix isn't set here, .pc files cause problems
- if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
- econf --prefix=${XDIR} \
- --datadir=${XDIR}/share \
- ${FONT_OPTIONS} \
- ${DRIVER_OPTIONS} \
- ${CONFIGURE_OPTIONS}
- fi
-}
-
-# @FUNCTION: x-modular_src_make
-# @USAGE:
-# @DESCRIPTION:
-# Run make.
-x-modular_src_make() {
- emake || die "emake failed"
-}
-
-# @FUNCTION: x-modular_src_compile
-# @USAGE:
-# @DESCRIPTION:
-# Compile a package, performing all X-related tasks.
-x-modular_src_compile() {
- has src_configure ${EXPORTED_FUNCTIONS} || x-modular_src_configure
- x-modular_src_make
-}
-
-# @FUNCTION: x-modular_src_install
-# @USAGE:
-# @DESCRIPTION:
-# Install a built package to ${ED}, performing any necessary steps.
-# Creates a ChangeLog from git if using live ebuilds.
-x-modular_src_install() {
- # Install everything to ${XDIR}
- if [[ ${CATEGORY} = x11-proto ]]; then
- make \
- ${PN/proto/}docdir=${EPREFIX}/usr/share/doc/${PF} \
- DESTDIR="${D}" \
- install \
- || die
- else
- make \
- docdir="${EPREFIX}"/usr/share/doc/${PF} \
- DESTDIR="${D}" \
- install \
- || die
- fi
-# Shouldn't be necessary in XDIR=/usr
-# einstall forces datadir, so we need to re-force it
-# datadir=${XDIR}/share \
-# mandir=${XDIR}/share/man \
-
- if [[ -n ${GIT_ECLASS} ]]; then
- pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
- git log ${GIT_TREE} > "${S}"/ChangeLog
- popd
- fi
-
- if [[ -e ${S}/ChangeLog ]]; then
- dodoc "${S}"/ChangeLog
- fi
-# @VARIABLE: DOCS
-# @DESCRIPTION:
-# Any documentation to install via dodoc
- [[ -n ${DOCS} ]] && dodoc ${DOCS}
-
- # Don't install libtool archives for server modules
- if [[ -e ${ED}/usr/$(get_libdir)/xorg/modules ]]; then
- find "${ED}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
- | xargs rm -f
- fi
-
- if [[ -n "${FONT}" ]]; then
- remove_font_metadata
- fi
-
- if [[ -n "${DRIVER}" ]]; then
- install_driver_hwdata
- fi
-}
-
-# @FUNCTION: x-modular_pkg_preinst
-# @USAGE:
-# @DESCRIPTION:
-# This function doesn't do anything right now, but it may in the future.
-x-modular_pkg_preinst() {
- # We no longer do anything here, but we can't remove it from the API
- :
-}
-
-# @FUNCTION: x-modular_pkg_postinst
-# @USAGE:
-# @DESCRIPTION:
-# Run X-specific post-installation tasks on the live filesystem. The
-# only task right now is some setup for font packages.
-x-modular_pkg_postinst() {
- if [[ -n "${FONT}" ]]; then
- setup_fonts
- fi
-}
-
-# @FUNCTION: x-modular_pkg_postrm
-# @USAGE:
-# @DESCRIPTION:
-# Run X-specific post-removal tasks on the live filesystem. The only
-# task right now is some cleanup for font packages.
-x-modular_pkg_postrm() {
- if [[ -n "${FONT}" ]]; then
- font_pkg_postrm
- fi
-}
-
-# @FUNCTION: setup_fonts
-# @USAGE:
-# @DESCRIPTION:
-# Generates needed files for fonts and fixes font permissions
-setup_fonts() {
- if [[ ! -n "${FONT_DIR}" ]]; then
- msg="FONT_DIR is empty. The ebuild should set it to at least one subdir of /usr/share/fonts."
- eerror "${msg}"
- die "${msg}"
- fi
-
- create_fonts_scale
- create_fonts_dir
- create_font_cache
-}
-
-# @FUNCTION: remove_font_metadata
-# @USAGE:
-# @DESCRIPTION:
-# Don't let the package install generated font files that may overlap
-# with other packages. Instead, they're generated in pkg_postinst().
-remove_font_metadata() {
- local DIR
- for DIR in ${FONT_DIR}; do
- if [[ "${DIR}" != "Speedo" ]] && \
- [[ "${DIR}" != "CID" ]] ; then
- # Delete font metadata files
- # fonts.scale, fonts.dir, fonts.cache-1
- rm -f "${ED}"/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
- fi
- done
-}
-
-# @FUNCTION: install_driver_hwdata
-# @USAGE:
-# @DESCRIPTION:
-# Installs device-to-driver mappings for system-config-display and
-# anything else that uses hwdata.
-install_driver_hwdata() {
- insinto /usr/share/hwdata/videoaliases
- for i in "${FILESDIR}"/*.xinf; do
- # We need this for the case when none exist,
- # so *.xinf doesn't expand
- if [[ -e $i ]]; then
- doins $i
- fi
- done
-}
-
-# @FUNCTION: discover_font_dirs
-# @USAGE:
-# @DESCRIPTION:
-# Deprecated. Sets up the now-unused FONT_DIRS variable.
-discover_font_dirs() {
- FONT_DIRS="${FONT_DIR}"
-}
-
-# @FUNCTION: create_fonts_scale
-# @USAGE:
-# @DESCRIPTION:
-# Create fonts.scale file, used by the old server-side fonts subsystem.
-create_fonts_scale() {
- ebegin "Creating fonts.scale files"
- local x
- for DIR in ${FONT_DIR}; do
- x=${EROOT}/usr/share/fonts/${DIR}
- [[ -z "$(ls ${x}/)" ]] && continue
- [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
-
- # Only generate .scale files if truetype, opentype or type1
- # fonts are present ...
-
- # NOTE: There is no way to regenerate Speedo/CID fonts.scale
- # <dberkholz@gentoo.org> 2 August 2004
- if [[ "${x/encodings}" = "${x}" ]] \
- && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then
- mkfontscale \
- -a "${EROOT}"/usr/share/fonts/encodings/encodings.dir \
- -- ${x}
- fi
- done
- eend 0
-}
-
-# @FUNCTION: create_fonts_dir
-# @USAGE:
-# @DESCRIPTION:
-# Create fonts.dir file, used by the old server-side fonts subsystem.
-create_fonts_dir() {
- ebegin "Generating fonts.dir files"
- for DIR in ${FONT_DIR}; do
- x=${EROOT}/usr/share/fonts/${DIR}
- [[ -z "$(ls ${x}/)" ]] && continue
- [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
-
- if [[ "${x/encodings}" = "${x}" ]]; then
- mkfontdir \
- -e "${EROOT}"/usr/share/fonts/encodings \
- -e "${EROOT}"/usr/share/fonts/encodings/large \
- -- ${x}
- fi
- done
- eend 0
-}
-
-# @FUNCTION: create_font_cache
-# @USAGE:
-# @DESCRIPTION:
-# Create fonts.cache-1 files, used by the new client-side fonts
-# subsystem.
-create_font_cache() {
- font_pkg_postinst
-}