eclass: Drop unused eclasses

This commit is contained in:
Krzesimir Nowak 2022-01-11 12:24:43 +01:00
parent d133e03f4a
commit d9f1012c1e
11 changed files with 0 additions and 1556 deletions

View File

@ -1,90 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: aspell-dict-r1.eclass
# @MAINTAINER:
# maintainer-needed@gentoo.org
# @AUTHOR:
# Original author: Seemant Kulleen
# -r1 author: David Seifert
# @SUPPORTED_EAPIS: 6
# @BLURB: An eclass to streamline the construction of ebuilds for new aspell dicts
# @DESCRIPTION:
# The aspell-dict-r1 eclass is designed to streamline the construction of
# ebuilds for the new aspell dictionaries (from gnu.org) which support
# aspell-0.50. Support for aspell-0.60 has been added by Sergey Ulanov.
# @ECLASS-VARIABLE: ASPELL_LANG
# @REQUIRED
# @DESCRIPTION:
# Pure cleartext string that is included into DESCRIPTION. This is the name
# of the language, for instance "Hungarian". Needs to be defined before
# inheriting the eclass.
# @ECLASS-VARIABLE: ASPELL_VERSION
# @DESCRIPTION:
# What major version of aspell is this dictionary for? Valid values are 5, 6 or undefined.
# This value is used to construct SRC_URI and *DEPEND strings. If defined to 6,
# >=app-text/aspell-0.60 will be added to DEPEND and RDEPEND, otherwise,
# >=app-text/aspell-0.50 is added to DEPEND and RDEPEND. If the value is to be overridden,
# it needs to be overridden before inheriting the eclass.
case ${EAPI:-0} in
[0-5])
die "aspell-dict-r1.eclass is banned in EAPI ${EAPI:-0}"
;;
6)
;;
*)
die "Unknown EAPI ${EAPI:-0}"
;;
esac
EXPORT_FUNCTIONS src_configure src_install
if [[ ! ${_ASPELL_DICT_R1} ]]; then
# aspell packages have an idiosyncratic versioning scheme, that is
# the last separating version separator is replaced by a '-'.
_ASPELL_P=aspell${ASPELL_VERSION}-${PN/aspell-/}-${PV%.*}-${PV##*.}
# @ECLASS-VARIABLE: ASPELL_SPELLANG
# @DESCRIPTION:
# Short (readonly) form of the language code, generated from ${PN}
# For instance, 'aspell-hu' yields the value 'hu'.
readonly ASPELL_SPELLANG=${PN/aspell-/}
S="${WORKDIR}/${_ASPELL_P}"
DESCRIPTION="${ASPELL_LANG} language dictionary for aspell"
HOMEPAGE="http://aspell.net"
SRC_URI="mirror://gnu/aspell/dict/${ASPELL_SPELLANG}/${_ASPELL_P}.tar.bz2"
unset _ASPELL_P
IUSE=""
SLOT="0"
_ASPELL_MAJOR_VERSION=${ASPELL_VERSION:-5}
[[ ${_ASPELL_MAJOR_VERSION} != [56] ]] && die "${ASPELL_VERSION} is not a valid version"
RDEPEND=">=app-text/aspell-0.${_ASPELL_MAJOR_VERSION}0"
DEPEND="${RDEPEND}"
unset _ASPELL_MAJOR_VERSION
# @FUNCTION: aspell-dict-r1_src_configure
# @DESCRIPTION:
# The aspell-dict-r1 src_configure function which is exported.
aspell-dict-r1_src_configure() {
# non-autoconf based script, cannot be used with econf
./configure || die
}
# @FUNCTION: aspell-dict-r1_src_install
# @DESCRIPTION:
# The aspell-dict-r1 src_install function which is exported.
aspell-dict-r1_src_install() {
default
[[ -s info ]] && dodoc info
}
_ASPELL_DICT_R1=1
fi

View File

@ -1,269 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: bzr.eclass
# @MAINTAINER:
# Ulrich Müller <ulm@gentoo.org>
# @AUTHOR:
# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
# Mark Lee <bzr-gentoo-overlay@lazymalevolence.com>
# Ulrich Müller <ulm@gentoo.org>
# Christian Faulhammer <fauli@gentoo.org>
# @SUPPORTED_EAPIS: 2 3 4 5 6 7
# @BLURB: generic fetching functions for the Bazaar VCS
# @DESCRIPTION:
# The bzr.eclass provides functions to fetch and unpack sources from
# repositories of the Bazaar distributed version control system.
# The eclass was originally derived from git.eclass.
#
# Note: Just set EBZR_REPO_URI to the URI of the branch and src_unpack()
# of this eclass will export the branch to ${WORKDIR}/${P}.
EBZR="bzr.eclass"
if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then
DEPEND=">=dev-vcs/bzr-2.6.0[sftp]"
else
DEPEND=">=dev-vcs/bzr-2.6.0"
fi
case ${EAPI:-0} in
2|3|4|5|6) ;;
7) BDEPEND="${DEPEND}"; DEPEND="" ;;
*) die "${EBZR}: EAPI ${EAPI:-0} is not supported" ;;
esac
EXPORT_FUNCTIONS src_unpack
# @ECLASS-VARIABLE: EBZR_STORE_DIR
# @DESCRIPTION:
# The directory to store all fetched Bazaar live sources.
: ${EBZR_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/bzr-src}
# @ECLASS-VARIABLE: EBZR_UNPACK_DIR
# @DESCRIPTION:
# The working directory where the sources are copied to.
: ${EBZR_UNPACK_DIR:=${WORKDIR}/${P}}
# @ECLASS-VARIABLE: EBZR_INIT_REPO_CMD
# @DESCRIPTION:
# The Bazaar command to initialise a shared repository.
: ${EBZR_INIT_REPO_CMD:="bzr init-repository --no-trees"}
# @ECLASS-VARIABLE: EBZR_FETCH_CMD
# @DESCRIPTION:
# The Bazaar command to fetch the sources.
: ${EBZR_FETCH_CMD:="bzr branch --no-tree"}
# @ECLASS-VARIABLE: EBZR_UPDATE_CMD
# @DESCRIPTION:
# The Bazaar command to update the sources.
: ${EBZR_UPDATE_CMD:="bzr pull --overwrite-tags"}
# @ECLASS-VARIABLE: EBZR_EXPORT_CMD
# @DESCRIPTION:
# The Bazaar command to export a branch.
: ${EBZR_EXPORT_CMD:="bzr export"}
# @ECLASS-VARIABLE: EBZR_CHECKOUT_CMD
# @DESCRIPTION:
# The Bazaar command to checkout a branch.
: ${EBZR_CHECKOUT_CMD:="bzr checkout --lightweight -q"}
# @ECLASS-VARIABLE: EBZR_REVNO_CMD
# @DESCRIPTION:
# The Bazaar command to list a revision number of the branch.
: ${EBZR_REVNO_CMD:="bzr revno"}
# @ECLASS-VARIABLE: EBZR_OPTIONS
# @DEFAULT_UNSET
# @DESCRIPTION:
# The options passed to the fetch and update commands.
# @ECLASS-VARIABLE: EBZR_REPO_URI
# @DEFAULT_UNSET
# @REQUIRED
# @DESCRIPTION:
# The repository URI for the source package.
#
# Note: If the ebuild uses an sftp:// URI, then the eclass will depend
# on dev-vcs/bzr[sftp].
# @ECLASS-VARIABLE: EBZR_INITIAL_URI
# @DEFAULT_UNSET
# @DESCRIPTION:
# The URI used for initial branching of the source repository. If this
# variable is set, the initial branch will be cloned from the location
# specified, followed by a pull from ${EBZR_REPO_URI}. This is intended
# for special cases, e.g. when download from the original repository is
# slow, but a fast mirror exists but may be out of date.
#
# Normally, this variable needs not be set.
# @ECLASS-VARIABLE: EBZR_PROJECT
# @DESCRIPTION:
# The project name of your ebuild. Normally, the branch will be stored
# in the ${EBZR_STORE_DIR}/${EBZR_PROJECT} directory.
#
# If EBZR_BRANCH is set (see below), then a shared repository will be
# created in that directory, and the branch will be located in
# ${EBZR_STORE_DIR}/${EBZR_PROJECT}/${EBZR_BRANCH}.
: ${EBZR_PROJECT:=${PN}}
# @ECLASS-VARIABLE: EBZR_BRANCH
# @DEFAULT_UNSET
# @DESCRIPTION:
# The directory where to store the branch within a shared repository,
# relative to ${EBZR_STORE_DIR}/${EBZR_PROJECT}.
#
# This variable should be set if there are several live ebuilds for
# different branches of the same upstream project. The branches can
# then share the same repository in EBZR_PROJECT, which will save both
# data traffic volume and disk space.
#
# If there is only a live ebuild for one single branch, EBZR_BRANCH
# needs not be set. In this case, the branch will be stored in a
# stand-alone repository directly in EBZR_PROJECT.
# @ECLASS-VARIABLE: EBZR_REVISION
# @DEFAULT_UNSET
# @DESCRIPTION:
# Revision to fetch, defaults to the latest
# (see http://bazaar-vcs.org/BzrRevisionSpec or bzr help revisionspec).
# @ECLASS-VARIABLE: EBZR_OFFLINE
# @DESCRIPTION:
# Set this variable to a non-empty value to disable automatic updating
# of a bzr source tree. This is intended to be set outside the ebuild
# by users.
: ${EBZR_OFFLINE=${EVCS_OFFLINE}}
# @ECLASS-VARIABLE: EBZR_WORKDIR_CHECKOUT
# @DEFAULT_UNSET
# @DESCRIPTION:
# If this variable is set to a non-empty value, EBZR_CHECKOUT_CMD will
# be used instead of EBZR_EXPORT_CMD to copy the sources to WORKDIR.
# @FUNCTION: bzr_initial_fetch
# @USAGE: <repository URI> <branch directory>
# @DESCRIPTION:
# Internal function, retrieves the source code from a repository for the
# first time, using ${EBZR_FETCH_CMD}.
bzr_initial_fetch() {
local repo_uri=$1 branch_dir=$2
if [[ -n "${EBZR_OFFLINE}" ]]; then
ewarn "EBZR_OFFLINE cannot be used when there is no local branch yet."
fi
# fetch branch
einfo "bzr branch start -->"
einfo " repository: ${repo_uri} => ${branch_dir}"
${EBZR_FETCH_CMD} ${EBZR_OPTIONS} "${repo_uri}" "${branch_dir}" \
|| die "${EBZR}: can't branch from ${repo_uri}"
}
# @FUNCTION: bzr_update
# @USAGE: <repository URI> <branch directory>
# @DESCRIPTION:
# Internal function, updates the source code from a repository, using
# ${EBZR_UPDATE_CMD}.
bzr_update() {
local repo_uri=$1 branch_dir=$2
if [[ -n "${EBZR_OFFLINE}" ]]; then
einfo "skipping bzr pull -->"
einfo " repository: ${repo_uri}"
else
# update branch
einfo "bzr pull start -->"
einfo " repository: ${repo_uri}"
pushd "${branch_dir}" > /dev/null \
|| die "${EBZR}: can't chdir to ${branch_dir}"
${EBZR_UPDATE_CMD} ${EBZR_OPTIONS} "${repo_uri}" \
|| die "${EBZR}: can't pull from ${repo_uri}"
popd > /dev/null
fi
}
# @FUNCTION: bzr_fetch
# @DESCRIPTION:
# Wrapper function to fetch sources from a Bazaar repository with
# bzr branch or bzr pull, depending on whether there is an existing
# working copy.
bzr_fetch() {
local repo_dir branch_dir
local save_sandbox_write=${SANDBOX_WRITE}
[[ -n ${EBZR_REPO_URI} ]] || die "${EBZR}: EBZR_REPO_URI is empty"
if [[ ! -d ${EBZR_STORE_DIR} ]] ; then
addwrite /
mkdir -p "${EBZR_STORE_DIR}" \
|| die "${EBZR}: can't mkdir ${EBZR_STORE_DIR}"
SANDBOX_WRITE=${save_sandbox_write}
fi
pushd "${EBZR_STORE_DIR}" > /dev/null \
|| die "${EBZR}: can't chdir to ${EBZR_STORE_DIR}"
repo_dir=${EBZR_STORE_DIR}/${EBZR_PROJECT}
branch_dir=${repo_dir}${EBZR_BRANCH:+/${EBZR_BRANCH}}
addwrite "${EBZR_STORE_DIR}"
if [[ ! -d ${branch_dir}/.bzr ]]; then
if [[ ${repo_dir} != "${branch_dir}" && ! -d ${repo_dir}/.bzr ]]; then
einfo "creating shared bzr repository: ${repo_dir}"
${EBZR_INIT_REPO_CMD} "${repo_dir}" \
|| die "${EBZR}: can't create shared repository"
fi
if [[ -z ${EBZR_INITIAL_URI} ]]; then
bzr_initial_fetch "${EBZR_REPO_URI}" "${branch_dir}"
else
# Workaround for faster initial download. This clones the
# branch from a fast server (which may be out of date), and
# subsequently pulls from the slow original repository.
bzr_initial_fetch "${EBZR_INITIAL_URI}" "${branch_dir}"
if [[ ${EBZR_REPO_URI} != "${EBZR_INITIAL_URI}" ]]; then
EBZR_UPDATE_CMD="${EBZR_UPDATE_CMD} --remember --overwrite" \
EBZR_OFFLINE="" \
bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
fi
fi
else
bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
fi
# Restore sandbox environment
SANDBOX_WRITE=${save_sandbox_write}
cd "${branch_dir}" || die "${EBZR}: can't chdir to ${branch_dir}"
# Save revision number in environment. #311101
export EBZR_REVNO=$(${EBZR_REVNO_CMD})
if [[ -n ${EBZR_WORKDIR_CHECKOUT} ]]; then
einfo "checking out ..."
${EBZR_CHECKOUT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
. "${EBZR_UNPACK_DIR}" || die "${EBZR}: checkout failed"
else
einfo "exporting ..."
${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
"${EBZR_UNPACK_DIR}" . || die "${EBZR}: export failed"
fi
einfo \
"revision ${EBZR_REVISION:-${EBZR_REVNO}} is now in ${EBZR_UNPACK_DIR}"
popd > /dev/null
}
# @FUNCTION: bzr_src_unpack
# @DESCRIPTION:
# Default src_unpack(), calls bzr_fetch.
bzr_src_unpack() {
bzr_fetch
}

View File

@ -1,52 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: freedict.eclass
# @MAINTAINER:
# maintainer-needed@gentoo.org
# @AUTHOR:
# Original author: Seemant Kulleen
# @SUPPORTED_EAPIS: 6
# @BLURB: Ease the installation of freedict translation dictionaries
# @DESCRIPTION:
# This eclass exists to ease the installation of freedict translation
# dictionaries. The only variables which need to be defined in the actual
# ebuilds are FORLANG and TOLANG for the source and target languages,
# respectively.
# @ECLASS-VARIABLE: FORLANG
# @DESCRIPTION:
# Please see above for a description.
# @ECLASS-VARIABLE: TOLANG
# @DESCRIPTION:
# Please see above for a description.
case ${EAPI:-0} in
6) ;;
*) die "${ECLASS}.eclass is banned in EAPI=${EAPI}" ;;
esac
MY_P=${PN/freedict-/}
DESCRIPTION="Freedict for language translation from ${FORLANG} to ${TOLANG}"
HOMEPAGE="http://freedict.sourceforge.net/"
SRC_URI="http://freedict.sourceforge.net/download/linux/${MY_P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
RDEPEND="app-text/dictd"
S="${WORKDIR}"
# @FUNCTION: freedict_src_install
# @DESCRIPTION:
# The freedict src_install function, which is exported
freedict_src_install() {
insinto /usr/$(get_libdir)/dict
doins ${MY_P}.dict.dz
doins ${MY_P}.index
}
EXPORT_FUNCTIONS src_install

View File

@ -1,122 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: l10n.eclass
# @MAINTAINER:
# Ulrich Müller <ulm@gentoo.org>
# @AUTHOR:
# Ben de Groot <yngwin@gentoo.org>
# @BLURB: convenience functions to handle localizations
# @DESCRIPTION:
# The l10n (localization) eclass offers a number of functions to more
# conveniently handle localizations (translations) offered by packages.
# These are meant to prevent code duplication for such boring tasks as
# determining the cross-section between the user's set LINGUAS and what
# is offered by the package.
# @ECLASS-VARIABLE: PLOCALES
# @DEFAULT_UNSET
# @DESCRIPTION:
# Variable listing the locales for which localizations are offered by
# the package.
#
# Example: PLOCALES="cy de el_GR en_US pt_BR vi zh_CN"
# @ECLASS-VARIABLE: PLOCALE_BACKUP
# @DEFAULT_UNSET
# @DESCRIPTION:
# In some cases the package fails when none of the offered PLOCALES are
# selected by the user. In that case this variable should be set to a
# default locale (usually 'en' or 'en_US') as backup.
#
# Example: PLOCALE_BACKUP="en_US"
# @FUNCTION: l10n_for_each_locale_do
# @USAGE: <function>
# @DESCRIPTION:
# Convenience function for processing localizations. The parameter should
# be a function (defined in the consuming eclass or ebuild) which takes
# an individual localization as (last) parameter.
#
# Example: l10n_for_each_locale_do install_locale
l10n_for_each_locale_do() {
local locs x
locs=$(l10n_get_locales)
for x in ${locs}; do
"${@}" ${x} || die "failed to process enabled ${x} locale"
done
}
# @FUNCTION: l10n_for_each_disabled_locale_do
# @USAGE: <function>
# @DESCRIPTION:
# Complementary to l10n_for_each_locale_do, this function will process
# locales that are disabled. This could be used for example to remove
# locales from a Makefile, to prevent them from being built needlessly.
l10n_for_each_disabled_locale_do() {
local locs x
locs=$(l10n_get_locales disabled)
for x in ${locs}; do
"${@}" ${x} || die "failed to process disabled ${x} locale"
done
}
# @FUNCTION: l10n_find_plocales_changes
# @USAGE: <translations dir> <filename pre pattern> <filename post pattern>
# @DESCRIPTION:
# Ebuild maintenance helper function to find changes in package offered
# locales when doing a version bump. This could be added for example to
# src_prepare
#
# Example: l10n_find_plocales_changes "${S}/src/translations" "${PN}_" '.ts'
l10n_find_plocales_changes() {
[[ $# -ne 3 ]] && die "Exactly 3 arguments are needed!"
ebegin "Looking in ${1} for new locales"
pushd "${1}" >/dev/null || die "Cannot access ${1}"
local current= x=
for x in ${2}*${3} ; do
x=${x#"${2}"}
x=${x%"${3}"}
current+="${x} "
done
popd >/dev/null
# RHS will be sorted with single spaces so ensure the LHS is too
# before attempting to compare them for equality. See bug #513242.
# Run them both through the same sorting algorithm so we don't have
# to worry about them being the same.
if [[ "$(printf '%s\n' ${PLOCALES} | LC_ALL=C sort)" != "$(printf '%s\n' ${current} | LC_ALL=C sort)" ]] ; then
eend 1 "There are changes in locales! This ebuild should be updated to:"
eerror "PLOCALES=\"${current%[[:space:]]}\""
return 1
else
eend 0
fi
}
# @FUNCTION: l10n_get_locales
# @USAGE: [disabled]
# @DESCRIPTION:
# Determine which LINGUAS the user has enabled that are offered by the
# package, as listed in PLOCALES, and return them. In case no locales
# are selected, fall back on PLOCALE_BACKUP. When the disabled argument
# is given, return the disabled locales instead of the enabled ones.
l10n_get_locales() {
local loc locs
if [[ -z ${LINGUAS+set} ]]; then
# enable all if unset
locs=${PLOCALES}
else
for loc in ${LINGUAS}; do
has ${loc} ${PLOCALES} && locs+="${loc} "
done
fi
[[ -z ${locs} ]] && locs=${PLOCALE_BACKUP}
if [[ ${1} == disabled ]]; then
local disabled_locs
for loc in ${PLOCALES}; do
has ${loc} ${locs} || disabled_locs+="${loc} "
done
locs=${disabled_locs}
fi
printf "%s" "${locs}"
}

View File

@ -1,117 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: myspell-r2.eclass
# @MAINTAINER:
# maintainer-needed@gentoo.org
# @AUTHOR:
# Tomáš Chvátal <scarabeus@gentoo.org>
# @BLURB: An eclass to ease the construction of ebuilds for myspell dicts
# @DESCRIPTION:
EXPORT_FUNCTIONS src_unpack src_install
# @ECLASS-VARIABLE: MYSPELL_DICT
# @DEFAULT_UNSET
# @DESCRIPTION:
# Array variable containing list of all dictionary files.
# MYSPELL_DICT=( "file.dic" "dir/file2.aff" )
# @ECLASS-VARIABLE: MYSPELL_HYPH
# @DESCRIPTION:
# Array variable containing list of all hyphenation files.
# MYSPELL_HYPH=( "file.dic" "dir/file2.dic" )
# @ECLASS-VARIABLE: MYSPELL_THES
# @DESCRIPTION:
# Array variable containing list of all thesarus files.
# MYSPELL_THES=( "file.dat" "dir/file2.idx" )
# Basically no extra deps needed.
# Unzip is required for .oxt libreoffice extensions
# which are just fancy zip files.
DEPEND="app-arch/unzip"
RDEPEND=""
# by default this stuff does not have any folder in the pack
S="${WORKDIR}"
# @FUNCTION: myspell-r2_src_unpack
# @DESCRIPTION:
# Unpack all variants of weird stuff.
# In our case .oxt packs.
myspell-r2_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
local f
for f in ${A}; do
case ${f} in
*.oxt)
echo ">>> Unpacking "${DISTDIR}/${f}" to ${PWD}"
unzip -qoj ${DISTDIR}/${f}
assert "failed unpacking ${DISTDIR}/${f}"
;;
*) unpack ${f} ;;
esac
done
}
# @FUNCTION: myspell-r2_src_install
# @DESCRIPTION:
# Install the dictionaries to the right places.
myspell-r2_src_install() {
debug-print-function ${FUNCNAME} "$@"
local x target
# Following the debian directory layout here.
# DICT: /usr/share/hunspell
# THES: /usr/share/mythes
# HYPH: /usr/share/hyphen
# We just need to copy the required files to proper places.
# TODO: backcompat dosym remove when all dictionaries and libreoffice
# ebuilds in tree use only the new paths
# Very old installs have hunspell to be symlink to myspell.
# This results in fcked up install/symlink stuff.
if [[ -L "${EPREFIX}/usr/share/hunspell" ]] ; then
eerror "\"${EPREFIX}/usr/share/hunspell\" is a symlink."
eerror "Please remove it so it is created properly as folder"
die "\"${EPREFIX}/usr/share/hunspell\" is a symlink."
fi
insinto /usr/share/hunspell
for x in "${MYSPELL_DICT[@]}"; do
target="${x##*/}"
newins "${x}" "${target}" || die
dosym ../hunspell/"${target}" /usr/share/myspell/"${target}" || die
done
insinto /usr/share/mythes
for x in "${MYSPELL_THES[@]}"; do
target="${x##*/}"
newins "${x}" "${target}" || die
dosym ../mythes/"${target}" /usr/share/myspell/"${target}" || die
done
insinto /usr/share/hyphen
for x in "${MYSPELL_HYPH[@]}"; do
target="${x##*/}"
newins "${x}" "${target}" || die
dosym ../hyphen/"${target}" /usr/share/myspell/"${target}" || die
done
# Remove licenses as they suffix them with .txt too
rm -rf COPYING*
rm -rf LICENSE*
rm -rf LICENCE*
rm -rf license*
rm -rf licence*
# Readme and so on
for x in *.txt README*; do
if [[ -f ${x} ]]; then
dodoc ${x} || die
fi
done
}

View File

@ -1,51 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: opam.eclass
# @MAINTAINER:
# Gentoo ML Project <ml@gentoo.org>
# @AUTHOR:
# Alexis Ballier <aballier@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: Provides functions for installing opam packages.
# @DESCRIPTION:
# Provides dependencies on opam and ocaml, opam-install and a default
# src_install for opam-based packages.
case ${EAPI:-0} in
5|6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
RDEPEND=">=dev-lang/ocaml-4:="
DEPEND="${RDEPEND}
dev-ml/opam"
# @FUNCTION: opam-install
# @USAGE: <list of packages>
# @DESCRIPTION:
# Installs the opam packages given as arguments. For each "${pkg}" element in
# that list, "${pkg}.install" must be readable from current working directory.
opam-install() {
local pkg
for pkg ; do
opam-installer -i \
--prefix="${ED%/}/usr" \
--libdir="${D%/}/$(ocamlc -where)" \
--docdir="${ED%/}/usr/share/doc/${PF}" \
--mandir="${ED%/}/usr/share/man" \
"${pkg}.install" || die
done
}
opam_src_install() {
local pkg="${1:-${PN}}"
opam-install "${pkg}"
# Handle opam putting doc in a subdir
if [ -d "${ED%/}/usr/share/doc/${PF}/${pkg}" ] ; then
mv "${ED%/}/usr/share/doc/${PF}/${pkg}/"* "${ED%/}/usr/share/doc/${PF}/" || die
rmdir "${ED%/}/usr/share/doc/${PF}/${pkg}" || die
fi
}
EXPORT_FUNCTIONS src_install

View File

@ -1,127 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: php-pear-r2.eclass
# @MAINTAINER:
# Gentoo PHP Team <php-bugs@gentoo.org>
# @AUTHOR:
# Author: Brian Evans <grknight@gentoo.org>
# @SUPPORTED_EAPIS: 6 7
# @BLURB: Provides means for an easy installation of PEAR packages.
# @DESCRIPTION:
# This eclass provides means for an easy installation of PEAR packages.
# For more information on PEAR, see https://pear.php.net/
# Note that this eclass doesn't handle dependencies of PEAR packages
# on purpose; please use (R)DEPEND to define them correctly!
EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
case "${EAPI:-0}" in
6|7)
;;
*)
die "Unsupported EAPI=${EAPI} for ${ECLASS}"
;;
esac
RDEPEND=">=dev-php/pear-1.8.1"
# @ECLASS-VARIABLE: PHP_PEAR_PKG_NAME
# @DESCRIPTION:
# Set this if the PEAR package name differs from ${PN/PEAR-/}
# (generally shouldn't be the case).
: ${PHP_PEAR_PKG_NAME:=${PN/PEAR-/}}
# @ECLASS-VARIABLE: PEAR_PV
# @DESCRIPTION:
# Set in ebuild if the ${PV} breaks SRC_URI for alpha/beta/rc versions
: ${PEAR_PV:=${PV}}
# @ECLASS-VARIABLE: PEAR-P
# @INTERNAL
# @DESCRIPTION: Combines PHP_PEAR_PKG_NAME and PEAR_PV
PEAR_P="${PHP_PEAR_PKG_NAME}-${PEAR_PV}"
# @ECLASS-VARIABLE: PHP_PEAR_DOMAIN
# @DESCRIPTION:
# Set in ebuild to the domain name of the channel if not pear.php.net
# When the domain is not pear.php.net, setting the SRC_URI is required
: ${PHP_PEAR_DOMAIN:=pear.php.net}
# @ECLASS-VARIABLE: PHP_PEAR_CHANNEL
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set in ebuild to the path of channel.xml file which is necessary for
# 3rd party pear channels (besides pear.php.net) to be added to PEAR
# Default is unset to do nothing
# set default SRC_URI for pear.php.net packages
if [[ "${PHP_PEAR_DOMAIN}" == "pear.php.net" ]] ; then
SRC_URI="https://pear.php.net/get/${PEAR_P}.tgz"
fi
: ${HOMEPAGE:=https://${PHP_PEAR_DOMAIN}/package/${PHP_PEAR_PKG_NAME}}
S="${WORKDIR}/${PEAR_P}"
# @FUNCTION: php-pear-r2_install_packagexml
# @DESCRIPTION:
# Copies the package2.xml or package.xml file and, optionally, the channel.xml
# file to a Gentoo-specific location so that pkg_postinst can install the package
# to the local PEAR database
php-pear-r2_install_packagexml() {
insinto /usr/share/php/.packagexml
if [[ -f "${WORKDIR}/package2.xml" ]] ; then
newins "${WORKDIR}/package2.xml" "${PEAR_P}.xml"
elif [[ -f "${WORKDIR}/package.xml" ]] ; then
newins "${WORKDIR}/package.xml" "${PEAR_P}.xml"
fi
if [[ -f "${PHP_PEAR_CHANNEL}" ]] ; then
newins "${PHP_PEAR_CHANNEL}" "${PEAR_P}-channel.xml"
fi
}
# @FUNCTION: php-pear-r2_src_install
# @DESCRIPTION:
# Takes care of standard install for PEAR packages.
# Override src_install if the package installs more than "${PHP_PEAR_PKG_NAME}.php"
# or "${PHP_PEAR_PKG_NAME%%_*}/" as a directory
php-pear-r2_src_install() {
insinto /usr/share/php
[[ -f "${PHP_PEAR_PKG_NAME}.php" ]] && doins "${PHP_PEAR_PKG_NAME}.php"
[[ -d "${PHP_PEAR_PKG_NAME%%_*}" ]] && doins -r "${PHP_PEAR_PKG_NAME%%_*}/"
php-pear-r2_install_packagexml
einstalldocs
}
# @FUNCTION: php-pear-r2_pkg_postinst
# @DESCRIPTION:
# Register package with the local PEAR database.
php-pear-r2_pkg_postinst() {
# Add unknown channels
if [[ -f "${EROOT%/}/usr/share/php/.packagexml/${PEAR_P}-channel.xml" ]] ; then
"${EROOT%/}/usr/bin/peardev" channel-info "${PHP_PEAR_DOMAIN}" &> /dev/null
if [[ $? -ne 0 ]]; then
"${EROOT%/}/usr/bin/peardev" channel-add \
"${EROOT%/}/usr/share/php/.packagexml/${PEAR_P}-channel.xml" \
|| einfo "Ignore any errors about existing channels"
fi
fi
# Register the package from the package{,2}.xml file
# It is not critical to complete so only warn on failure
if [[ -f "${EROOT%/}/usr/share/php/.packagexml/${PEAR_P}.xml" ]] ; then
"${EROOT%/}/usr/bin/peardev" install -nrO --force \
"${EROOT%/}/usr/share/php/.packagexml/${PEAR_P}.xml" 2> /dev/null \
|| ewarn "Failed to insert package into local PEAR database"
fi
}
# @FUNCTION: php-pear-r2_pkg_postrm
# @DESCRIPTION:
# Deregister package from the local PEAR database
php-pear-r2_pkg_postrm() {
# Uninstall known dependency
"${EROOT%/}/usr/bin/peardev" uninstall -nrO "${PHP_PEAR_DOMAIN}/${PHP_PEAR_PKG_NAME}"
}

View File

@ -1,59 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Author : Alastair Tse <liquidx@gentoo.org>
#
# Convienence class to do stardict dictionary installations.
#
# Usage:
# - Variables to set :
# * FROM_LANG - From this language
# * TO_LANG - To this language
# * DICT_PREFIX - SRC_URI prefix, like "dictd_www.mova.org_"
# * DICT_SUFFIX - SRC_URI after the prefix.
RESTRICT="strip"
[ -z "${DICT_SUFFIX}" ] && DICT_SUFFIX=${PN#stardict-[[:lower:]]*-}
[ -z "${DICT_P}" ] && DICT_P=stardict-${DICT_PREFIX}${DICT_SUFFIX}-${PV}
if [ -n "${FROM_LANG}" -a -n "${TO_LANG}" ]; then
DESCRIPTION="Stardict Dictionary ${FROM_LANG} to ${TO_LANG}"
elif [ -z "${DESCRIPTION}" ]; then
DESCRIPTION="Another Stardict Dictionary"
fi
HOMEPAGE="http://stardict.sourceforge.net/"
SRC_URI="mirror://sourceforge/stardict/${DICT_P}.tar.bz2"
IUSE="gzip"
SLOT="0"
LICENSE="GPL-2"
DEPEND="|| ( >=app-text/stardict-2.4.2
app-text/sdcv
app-text/goldendict )
gzip? ( app-arch/gzip
app-text/dictd )"
S=${WORKDIR}/${DICT_P}
stardict_src_compile() {
if use gzip; then
for file in *.idx; do
[[ -f $file ]] && gzip ${file}
done
for file in *.dict; do
[[ -f $file ]] && dictzip ${file}
done
fi
}
stardict_src_install() {
insinto /usr/share/stardict/dic
doins *.dict.dz*
doins *.idx*
doins *.ifo
}
EXPORT_FUNCTIONS src_compile src_install

View File

@ -1,33 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# eclass to simplify installation of Sword modules
# Bugs to theology@gentoo.org
#
HOMEPAGE="http://www.crosswire.org/sword/modules/"
# Sword packages are generally released as FooBar.zip in their 'rawzip' form
# The files are also unversioned, so the packager will need to rename the
# original file to something else and host it somewhere to avoid breaking
# the digest when new versions are released.
SRC_URI="mirror://gentoo/${SWORD_MODULE}-${PV}.zip"
SLOT="0"
IUSE=""
S="${WORKDIR}"
RDEPEND="app-text/sword"
DEPEND="app-arch/unzip"
sword-module_src_install() {
insinto /usr/share/sword/modules
doins -r "${S}"/modules/*
insinto /usr/share/sword/mods.d
doins "${S}"/mods.d/*
}
EXPORT_FUNCTIONS src_install

View File

@ -1,577 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @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="${ROOT%/}/etc/vhosts/webapp-config"
WEBAPP_CONFIG="${ROOT%/}/usr/sbin/webapp-config"
WEBAPP_CLEANER="${ROOT%/}/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 https://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#${D}}"
}
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}" "${D}"
local my_file="$(webapp_strip_appdir "${m}")"
my_file="$(webapp_strip_cwd "${my_file}")"
elog "(config) ${my_file}"
echo "${my_file}" >> ${D}/${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}" "${D}"
local my_file="$(webapp_strip_appdir "${1}")"
my_file="$(webapp_strip_cwd "${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 "${D}${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 https://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 https://bugs.gentoo.org"
fi
# Hint, see the webapp_read_config() function to find where these are
# defined.
dodir "${MY_HTDOCSDIR}"
dodir "${MY_HOSTROOTDIR}"
dodir "${MY_CGIBINDIR}"
dodir "${MY_ICONSDIR}"
dodir "${MY_ERRORSDIR}"
dodir "${MY_SQLSCRIPTSDIR}"
dodir "${MY_HOOKSCRIPTSDIR}"
dodir "${MY_SERVERCONFIGDIR}"
}
# ==============================================================================
# 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
# `${ROOT%/}/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="${ROOT%/}/${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
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}"
chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/"
chmod -R u-s "${D}/"
chmod -R g-s "${D}/"
keepdir "${MY_PERSISTDIR}"
fowners "root:0" "${MY_PERSISTDIR}"
fperms 755 "${MY_PERSISTDIR}"
}
# @FUNCTION: webapp_pkg_postinst
# @DESCRIPTION:
# The default pkg_postinst() for this eclass. This installs the web application to
# `${ROOT%/}/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 https://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 https://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} -h localhost -u root -d ${INSTALL_DIR} ${my_mode} ${PN} ${PVR}"
elog "Running ${my_cmd}"
${my_cmd}
echo
local cleaner="${WEBAPP_CLEANER} -p -C ${CATEGORY}/${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 -h <host> -d ${PN} -I ${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 -h <host> -d ${PN} -I ${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} -h ${WEB_HOSTNAME} -d ${WEB_INSTALLDIR} -C ${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
}

View File

@ -1,59 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: xemacs-packages.eclass
# @MAINTAINER:
# xemacs@gentoo.org
# @BLURB: Eclass to support elisp packages distributed by XEmacs.
# @DESCRIPTION:
# This eclass supports ebuilds for packages distributed by XEmacs.
# @ECLASS-VARIABLE: XEMACS_PKG_CAT
# @REQUIRED
# @DESCRIPTION:
# The package category that the package is in. Can be either standard,
# mule, or contrib.
# @ECLASS-VARIABLE: XEMACS_EXPERIMENTAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set then the package is downloaded from the experimental packages
# repository, which is the staging area for packages upstream. Packages
# in the experimental repository are auto-generated from XEmacs VCS, so
# they may not be well-tested.
EXPORT_FUNCTIONS src_unpack src_install
RDEPEND="app-editors/xemacs"
S="${WORKDIR}"
: ${HOMEPAGE:="http://xemacs.org/"}
: ${LICENSE:="GPL-2+"}
# Backwards compatibility code, to be removed after 2017-05-03
: ${XEMACS_PKG_CAT:=${PKG_CAT}}
: ${XEMACS_EXPERIMENTAL:=${EXPERIMENTAL}}
if [[ -n ${XEMACS_EXPERIMENTAL} ]]; then
: ${SRC_URI:="http://ftp.xemacs.org/pub/xemacs/beta/experimental/packages/${P}-pkg.tar.gz"}
else
: ${SRC_URI:="http://ftp.xemacs.org/pub/xemacs/packages/${P}-pkg.tar.gz"}
fi
xemacs-packages_src_unpack() { :; }
xemacs-packages_src_install() {
local install_dir
case ${XEMACS_PKG_CAT} in
standard) install_dir="/usr/lib/xemacs/xemacs-packages" ;;
mule) install_dir="/usr/lib/xemacs/mule-packages" ;;
contrib) install_dir="/usr/lib/xemacs/site-packages" ;;
*) die "Unsupported package category in XEMACS_PKG_CAT (or unset)" ;;
esac
debug-print "install_dir is ${install_dir}"
dodir "${install_dir}"
cd "${D}${EPREFIX}${install_dir}" || die
unpack ${A}
}