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 5581ccad8a
Sync with portage [Sun Dec 8 22:24:06 MSK 2019].
5 years ago
..
tests Sync with portage [Sun Dec 8 22:24:06 MSK 2019]. 5 years ago
Manifest.gz Sync with portage [Sun Dec 8 22:24:06 MSK 2019]. 5 years ago
acct-group.eclass Sync with portage [Sat Oct 12 18:50:50 MSK 2019]. 5 years ago
acct-user.eclass Sync with portage [Sat Oct 12 18:50:50 MSK 2019]. 5 years ago
ada.eclass Sync with portage [Thu Oct 24 10:41:19 MSK 2019]. 5 years ago
alternatives.eclass
ant-tasks.eclass
apache-2.eclass
apache-module.eclass
aspell-dict-r1.eclass
autotools-multilib.eclass
autotools-utils.eclass
autotools.eclass Sync with portage [Sat Nov 9 18:33:57 MSK 2019]. 5 years ago
base.eclass
bash-completion-r1.eclass
bazel.eclass Sync with portage [Tue Oct 1 23:26:32 MSK 2019]. 5 years ago
bsdmk.eclass Sync with portage [Sat Oct 12 18:50:50 MSK 2019]. 5 years ago
bzr.eclass Sync with portage [Thu Oct 24 10:41:19 MSK 2019]. 5 years ago
cannadic.eclass
cargo.eclass Sync with portage [Sat Dec 7 08:52:25 MSK 2019]. 5 years ago
cdrom.eclass
check-reqs.eclass
chromium-2.eclass
cmake-multilib.eclass
cmake-utils.eclass Sync with portage [Sat Dec 7 08:52:25 MSK 2019]. 5 years ago
common-lisp-3.eclass
cron.eclass Sync with portage [Fri Oct 11 00:10:47 MSK 2019]. 5 years ago
cuda.eclass
cvs.eclass
darcs.eclass
db-use.eclass
db.eclass
depend.apache.eclass
desktop.eclass
distutils-r1.eclass Sync with portage [Sun Dec 8 22:24:06 MSK 2019]. 5 years ago
dotnet.eclass
eapi7-ver.eclass
ecm.eclass Sync with portage [Tue Dec 3 09:03:21 MSK 2019]. 5 years ago
elisp-common.eclass
elisp.eclass
emboss-r2.eclass
epatch.eclass
epunt-cxx.eclass
estack.eclass Sync with portage [Thu Nov 28 10:06:18 MSK 2019]. 5 years ago
eutils.eclass Sync with portage [Thu Nov 28 10:06:18 MSK 2019]. 5 years ago
fcaps.eclass
fdo-mime.eclass
findlib.eclass
fixheadtails.eclass
flag-o-matic.eclass Sync with portage [Mon Sep 30 22:23:22 MSK 2019]. 5 years ago
font-ebdftopcf.eclass
font.eclass Sync with portage [Thu Oct 17 08:46:04 MSK 2019]. 5 years ago
fortran-2.eclass
fox.eclass
freedict.eclass
games-mods.eclass
games.eclass
ghc-package.eclass
git-2.eclass
git-r3.eclass Sync with portage [Sun Dec 8 22:24:06 MSK 2019]. 5 years ago
gkrellm-plugin.eclass
gnome-python-common-r1.eclass
gnome.org.eclass
gnome2-utils.eclass
gnome2.eclass
gnuconfig.eclass
gnustep-2.eclass
gnustep-base.eclass
go-module.eclass Sync with portage [Fri Oct 4 14:19:54 MSK 2019]. 5 years ago
golang-base.eclass
golang-build.eclass
golang-vcs-snapshot.eclass
golang-vcs.eclass
gstreamer.eclass
haskell-cabal.eclass Sync with portage [Sun Dec 8 22:24:06 MSK 2019]. 5 years ago
java-ant-2.eclass Sync with portage [Thu Oct 31 08:55:48 MSK 2019]. 5 years ago
java-osgi.eclass
java-pkg-2.eclass
java-pkg-opt-2.eclass
java-pkg-simple.eclass
java-utils-2.eclass Sync with portage [Thu Oct 31 08:55:48 MSK 2019]. 5 years ago
java-virtuals-2.eclass
java-vm-2.eclass
kde.org.eclass Sync with portage [Tue Dec 3 09:03:21 MSK 2019]. 5 years ago
kde5-functions.eclass Sync with portage [Tue Nov 19 09:19:53 MSK 2019]. 5 years ago
kde5.eclass Sync with portage [Tue Nov 19 09:19:53 MSK 2019]. 5 years ago
kernel-2.eclass Sync with portage [Sat Dec 7 08:52:25 MSK 2019]. 5 years ago
kodi-addon.eclass
l10n.eclass
latex-package.eclass
leechcraft.eclass
libretro-core.eclass
libtool.eclass
linux-info.eclass
linux-mod.eclass
llvm.eclass
llvm.org.eclass Sync with portage [Mon Nov 25 12:31:45 MSK 2019]. 5 years ago
ltprune.eclass
mate-desktop.org.eclass
mate.eclass
mercurial.eclass
meson.eclass
mono-env.eclass
mono.eclass
mount-boot.eclass
mozconfig-v6.52.eclass
mozconfig-v6.60.eclass Sync with portage [Mon Oct 7 20:29:57 MSK 2019]. 5 years ago
mozcoreconf-v4.eclass
mozcoreconf-v5.eclass
mozcoreconf-v6.eclass
mozextension.eclass
mozlinguas-v2.eclass
multibuild.eclass
multilib-build.eclass
multilib-minimal.eclass
multilib.eclass
multiprocessing.eclass
myspell-r2.eclass
netsurf.eclass
ninja-utils.eclass
nsplugins.eclass
nvidia-driver.eclass Sync with portage [Tue Dec 3 09:03:21 MSK 2019]. 5 years ago
oasis.eclass
obs-download.eclass
obs-service.eclass
office-ext-r1.eclass Sync with portage [Fri Oct 11 00:10:47 MSK 2019]. 5 years ago
opam.eclass
openib.eclass
out-of-source.eclass
pam.eclass Sync with portage [Tue Dec 3 09:03:21 MSK 2019]. 5 years ago
pax-utils.eclass Sync with portage [Fri Oct 11 00:10:47 MSK 2019]. 5 years ago
perl-functions.eclass
perl-module.eclass Sync with portage [Thu Oct 17 08:46:04 MSK 2019]. 5 years ago
php-ext-pecl-r3.eclass
php-ext-source-r2.eclass
php-ext-source-r3.eclass
php-pear-r2.eclass
portability.eclass
postgres-multi.eclass
postgres.eclass
prefix.eclass
preserve-libs.eclass
python-any-r1.eclass Sync with portage [Wed Nov 20 08:33:35 MSK 2019]. 5 years ago
python-r1.eclass Sync with portage [Sun Dec 8 22:24:06 MSK 2019]. 5 years ago
python-single-r1.eclass Sync with portage [Sun Dec 8 22:24:06 MSK 2019]. 5 years ago
python-utils-r1.eclass Sync with portage [Sun Dec 8 22:24:06 MSK 2019]. 5 years ago
qmail.eclass Sync with portage [Tue Nov 12 21:57:57 MSK 2019]. 5 years ago
qmake-utils.eclass Sync with portage [Tue Dec 3 09:03:21 MSK 2019]. 5 years ago
qt5-build.eclass Sync with portage [Thu Oct 24 10:41:19 MSK 2019]. 5 years ago
readme.gentoo-r1.eclass
readme.gentoo.eclass
rebar.eclass
ros-catkin.eclass
rpm.eclass
ruby-fakegem.eclass Sync with portage [Tue Nov 5 08:46:51 MSK 2019]. 5 years ago
ruby-ng-gnome2.eclass
ruby-ng.eclass Sync with portage [Tue Nov 5 08:46:51 MSK 2019]. 5 years ago
ruby-single.eclass
ruby-utils.eclass
rust-toolchain.eclass
s6.eclass
savedconfig.eclass Sync with portage [Tue Nov 26 17:50:05 MSK 2019]. 5 years ago
scons-utils.eclass
selinux-policy-2.eclass
sgml-catalog-r1.eclass Sync with portage [Mon Nov 25 12:31:45 MSK 2019]. 5 years ago
sgml-catalog.eclass
ssl-cert.eclass
stardict.eclass
subversion.eclass
sword-module.eclass
systemd.eclass
texlive-common.eclass Sync with portage [Tue Nov 5 08:46:51 MSK 2019]. 5 years ago
texlive-module.eclass Sync with portage [Tue Nov 5 08:46:51 MSK 2019]. 5 years ago
tmpfiles.eclass
toolchain-autoconf.eclass Sync with portage [Thu Nov 28 21:43:10 MSK 2019]. 5 years ago
toolchain-binutils.eclass Sync with portage [Sat Nov 9 18:33:57 MSK 2019]. 5 years ago
toolchain-funcs.eclass Sync with portage [Thu Nov 7 17:20:29 MSK 2019]. 5 years ago
toolchain-glibc.eclass Sync with portage [Mon Oct 21 08:44:36 MSK 2019]. 5 years ago
toolchain.eclass Sync with portage [Mon Dec 2 00:44:31 MSK 2019]. 5 years ago
twisted-r1.eclass
udev.eclass
unpacker.eclass
user.eclass
usr-ldscript.eclass
vala.eclass
vcs-clean.eclass
vcs-snapshot.eclass
vdr-plugin-2.eclass
versionator.eclass
vim-doc.eclass
vim-plugin.eclass
vim-spell.eclass
virtualx.eclass
waf-utils.eclass
webapp.eclass
wxwidgets.eclass
xdg-utils.eclass
xdg.eclass
xemacs-elisp-common.eclass
xemacs-elisp.eclass
xemacs-packages.eclass
xorg-2.eclass
xorg-3.eclass

readme.gentoo.eclass

# Copyright 1999-2018 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# @ECLASS: readme.gentoo.eclass
# @MAINTAINER:
# Pacho Ramos <pacho@gentoo.org>
# @AUTHOR:
# Author: Pacho Ramos <pacho@gentoo.org>
# @SUPPORTED_EAPIS: 4 5
# @BLURB: install a doc file 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}
#
# This eclass is DEPRECATED. Please use readme.gentoo-r1 instead.

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.
EXPORT_FUNCTIONS src_install pkg_postinst
;;
6)
die "Unsupported EAPI=${EAPI} for ${ECLASS}"
die "Please migrate to readme.gentoo-r1.eclass and note that"
die "it stops to export any ebuild phases and, then, you will"
die "need to ensure readme.gentoo_create_doc is called in"
die "src_install and readme.gentoo_print_elog in pkg_postinst"
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
esac

# @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} "${@}"

eqawarn "${CATEGORY}/${PN} is using the deprecated readme.gentoo.eclass."
eqawarn "Please use readme.gentoo-r1 instead."

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