You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/eclass
root b0187db9ba
Sync with portage [Thu Jun 18 21:35:04 MSK 2015].
10 years ago
..
ELT-patches
tests
ChangeLog-2013
alternatives.eclass
ant-tasks.eclass
apache-2.eclass
apache-module.eclass
aspell-dict.eclass
autotools-multilib.eclass
autotools-utils.eclass
autotools.eclass
base.eclass
bash-completion-r1.eclass
bash-completion.eclass
bitcoincore.eclass
bsdmk.eclass
bzr.eclass
cannadic.eclass
cdrom.eclass
check-reqs.eclass
chromium.eclass
clutter.eclass
cmake-multilib.eclass
cmake-utils.eclass
common-lisp-3.eclass
common-lisp-common-2.eclass
common-lisp-common-3.eclass
common-lisp-common.eclass
common-lisp.eclass
confutils.eclass
cron.eclass
cuda.eclass
cvs.eclass
darcs.eclass
db-use.eclass
db.eclass
depend.apache.eclass
depend.php.eclass Sync with portage [Thu Jun 18 21:35:04 MSK 2015]. 10 years ago
distutils-r1.eclass
distutils.eclass
elisp-common.eclass
elisp.eclass
embassy.eclass
emboss-r1.eclass
emul-linux-x86.eclass
enlightenment.eclass Sync with portage [Fri Jul 11 23:20:23 MSK 2014]. 10 years ago
eutils.eclass
fcaps.eclass
fdo-mime.eclass
findlib.eclass
fixheadtails.eclass
flag-o-matic.eclass
font-ebdftopcf.eclass
font.eclass
fortran-2.eclass
fox.eclass
freebsd.eclass
freedict.eclass
games-mods.eclass
games.eclass
gdesklets.eclass
ghc-package.eclass
git-2.eclass
git-r3.eclass
gkrellm-plugin.eclass
gnat.eclass
gnatbuild.eclass
gnome-games.eclass
gnome-python-common-r1.eclass
gnome.org.eclass
gnome2-utils.eclass
gnome2.eclass
gnuconfig.eclass
gnustep-2.eclass
gnustep-base.eclass
go-mono.eclass
golang-vcs.eclass Sync with portage [Thu Jun 18 21:35:04 MSK 2015]. 10 years ago
gpe.eclass
gst-plugins-bad.eclass
gst-plugins-base.eclass
gst-plugins-good.eclass
gst-plugins-ugly.eclass
gst-plugins10.eclass
gstreamer.eclass
gtk-sharp-module.eclass
haskell-cabal.eclass
horde.eclass
intel-sdp.eclass
java-ant-2.eclass
java-mvn-src.eclass
java-osgi.eclass
java-pkg-2.eclass
java-pkg-opt-2.eclass
java-pkg-simple.eclass
java-utils-2.eclass
java-virtuals-2.eclass
java-vm-2.eclass
kde4-base.eclass
kde4-functions.eclass
kde4-meta-pkg.eclass
kde4-meta.eclass
kde5-functions.eclass
kde5.eclass
kernel-2.eclass
l10n.eclass
latex-package.eclass
leechcraft.eclass
libtool.eclass
linux-info.eclass
linux-mod.eclass
makeedit.eclass
mercurial.eclass
mono-env.eclass
mono.eclass
mount-boot.eclass
mozconfig-3.eclass
mozconfig-v4.31.eclass
mozconfig-v5.31.eclass
mozconfig-v5.33.eclass
mozconfig-v5.34.eclass
mozconfig-v5.36.eclass
mozconfig-v5.38.eclass
mozcoreconf-2.eclass
mozcoreconf-v3.eclass
mozextension.eclass
mozilla-launcher.eclass
mozlinguas.eclass
multibuild.eclass
multilib-build.eclass
multilib-minimal.eclass
multilib.eclass
multiprocessing.eclass
myspell-r2.eclass
myspell.eclass
mysql-cmake.eclass
mysql-multilib.eclass
mysql-v2.eclass
mysql_fx.eclass
mythtv-plugins.eclass
mythtv.eclass
netsurf.eclass
nsplugins.eclass
nvidia-driver.eclass
oasis.eclass
obs-download.eclass
obs-service.eclass
office-ext-r1.eclass
openib.eclass
pam.eclass
pax-utils.eclass
perl-app.eclass
perl-module.eclass
php-common-r1.eclass
php-ext-base-r1.eclass
php-ext-pecl-r2.eclass
php-ext-source-r2.eclass
php-ezc.eclass
php-lib-r1.eclass
php-pear-lib-r1.eclass
php-pear-r1.eclass
phpconfutils.eclass
portability.eclass
prefix.eclass
python-any-r1.eclass
python-r1.eclass
python-single-r1.eclass
python-utils-r1.eclass
python.eclass
qmail.eclass
qmake-utils.eclass
qt4-build-multilib.eclass
qt4-build.eclass
qt4-r2.eclass
qt5-build.eclass
readme.gentoo.eclass
rpm.eclass
ruby-fakegem.eclass
ruby-ng-gnome2.eclass
ruby-ng.eclass
ruby-single.eclass
ruby-utils.eclass
s6.eclass
savedconfig.eclass
scons-utils.eclass
scsh.eclass
selinux-policy-2.eclass
sgml-catalog.eclass
ssl-cert.eclass
stardict.eclass
subversion.eclass
sword-module.eclass
systemd.eclass
texlive-common.eclass
texlive-module.eclass
toolchain-binutils.eclass
toolchain-funcs.eclass
toolchain.eclass
twisted-r1.eclass
udev.eclass
unpacker.eclass
user.eclass
vala.eclass
vcs-snapshot.eclass
vdr-plugin-2.eclass
versionator.eclass
vim-doc.eclass
vim-plugin.eclass
vim-spell.eclass
virtualx.eclass
virtuoso.eclass
vmware-bundle.eclass
waf-utils.eclass
webapp.eclass
wxwidgets.eclass
x-modular.eclass
xemacs-elisp-common.eclass
xemacs-elisp.eclass
xemacs-packages.eclass
xfconf.eclass
xorg-2.eclass

readme.gentoo.eclass

# Copyright 1999-2014 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/readme.gentoo.eclass,v 1.12 2014/07/11 08:21:58 ulm Exp $

# @ECLASS: readme.gentoo
# @MAINTAINER:
# Pacho Ramos <pacho@gentoo.org>
# @AUTHOR:
# Author: Pacho Ramos <pacho@gentoo.org>
# @BLURB: An eclass for installing a README.gentoo doc file recording tips
# shown via elog messages.
# @DESCRIPTION:
# An eclass for installing a README.gentoo doc file recording tips
# shown via elog messages. With this eclass, those elog messages will only be
# shown at first package installation and a file for later reviewing will be
# installed under /usr/share/doc/${PF}

if [[ -z ${_README_GENTOO_ECLASS} ]]; then
_README_GENTOO_ECLASS=1

inherit eutils

case "${EAPI:-0}" in
0|1|2|3)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
4|5)
# EAPI>=4 is required for REPLACING_VERSIONS preventing us
# from needing to export another pkg_preinst phase to save has_version
# result. Also relies on EAPI >=4 default src_install phase.
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
esac

EXPORT_FUNCTIONS src_install pkg_postinst

# @ECLASS-VARIABLE: DISABLE_AUTOFORMATTING
# @DEFAULT_UNSET
# @DESCRIPTION:
# If non-empty, DOC_CONTENTS information will be strictly respected,
# not getting it automatically formatted by fmt. If empty, it will
# rely on fmt for formatting and 'echo -e' options to tweak lines a bit.

# @ECLASS-VARIABLE: FORCE_PRINT_ELOG
# @DEFAULT_UNSET
# @DESCRIPTION:
# If non-empty this variable forces elog messages to be printed.

# @ECLASS-VARIABLE: README_GENTOO_SUFFIX
# @DESCRIPTION:
# If you want to specify a suffix for README.gentoo file please export it.
: ${README_GENTOO_SUFFIX:=""}

# @FUNCTION: readme.gentoo_create_doc
# @DESCRIPTION:
# Create doc file with ${DOC_CONTENTS} variable (preferred) and, if not set,
# look for "${FILESDIR}/README.gentoo" contents. You can use
# ${FILESDIR}/README.gentoo-${SLOT} also.
# Usually called at src_install phase.
readme.gentoo_create_doc() {
debug-print-function ${FUNCNAME} "${@}"

if [[ -n "${DOC_CONTENTS}" ]]; then
eshopts_push
set -f
if [[ -n "${DISABLE_AUTOFORMATTING}" ]]; then
echo "${DOC_CONTENTS}" > "${T}"/README.gentoo
else
echo -e ${DOC_CONTENTS} | fold -s -w 70 \
| sed 's/[[:space:]]*$//' > "${T}"/README.gentoo
fi
eshopts_pop
elif [[ -f "${FILESDIR}/README.gentoo-${SLOT%/*}" ]]; then
cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo || die
elif [[ -f "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" ]]; then
cp "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" "${T}"/README.gentoo || die
else
die "You are not specifying README.gentoo contents!"
fi

dodoc "${T}"/README.gentoo
README_GENTOO_DOC_VALUE=$(< "${T}/README.gentoo")
}

# @FUNCTION: readme.gentoo_print_elog
# @DESCRIPTION:
# Print elog messages with "${T}"/README.gentoo contents. They will be
# shown only when package is installed at first time.
# Usually called at pkg_postinst phase.
#
# If you want to show them always, please set FORCE_PRINT_ELOG to a non empty
# value in your ebuild before this function is called.
# This can be useful when, for example, DOC_CONTENTS is modified, then, you can
# rely on specific REPLACING_VERSIONS handling in your ebuild to print messages
# when people update from versions still providing old message.
readme.gentoo_print_elog() {
debug-print-function ${FUNCNAME} "${@}"

if [[ -z "${README_GENTOO_DOC_VALUE}" ]]; then
die "readme.gentoo_print_elog invoked without matching readme.gentoo_create_doc call!"
elif ! [[ -n "${REPLACING_VERSIONS}" ]] || [[ -n "${FORCE_PRINT_ELOG}" ]]; then
echo -e "${README_GENTOO_DOC_VALUE}" | while read -r ELINE; do elog "${ELINE}"; done
elog ""
elog "(Note: Above message is only printed the first time package is"
elog "installed. Please look at ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
elog "for future reference)"
fi
}


# @FUNCTION: readme.gentoo_src_install
# @DESCRIPTION:
# Install generated doc file automatically.
readme.gentoo_src_install() {
debug-print-function ${FUNCNAME} "${@}"
default
readme.gentoo_create_doc
}

# @FUNCTION: readme.gentoo_pkg_postinst
# @DESCRIPTION:
# Show elog messages from from just generated doc file.
readme.gentoo_pkg_postinst() {
debug-print-function ${FUNCNAME} "${@}"
readme.gentoo_print_elog
}

fi