logo

overlay

My (experimental) gentoo overlay
commit: 01bb537580cc4bc37f0fdd169e80494acf0b6a63
parent: 5d9a1436d45e042436ed3a2d945e7548b4a4d69d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 14 Feb 2019 22:32:32 +0100

eclass: Remove unused eclass/es

Diffstat:

Declass/common-lisp-common.eclass209-------------------------------------------------------------------------------
Declass/cron.eclass161-------------------------------------------------------------------------------
Declass/fcaps.eclass220-------------------------------------------------------------------------------
Declass/python-whatever.eclass9---------
4 files changed, 0 insertions(+), 599 deletions(-)

diff --git a/eclass/common-lisp-common.eclass b/eclass/common-lisp-common.eclass @@ -1,209 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ -# -# 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 SuperUser 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 "${D}"/usr/share/${impl}/portage-timestamp-compensate -C "${D}"/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 0: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/cron.eclass b/eclass/cron.eclass @@ -1,161 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -# @ECLASS: cron.eclass -# @MAINTAINER: -# cron-bugs@gentoo.org -# @AUTHOR: -# Original Author: Aaron Walker <ka0ttic@gentoo.org> -# @BLURB: Some functions for cron -# @DESCRIPTION: -# Purpose: The main motivation for this eclass was to simplify -# the jungle known as src_install() in cron ebuilds. Using these -# functions also ensures that permissions are *always* reset, -# preventing the accidental installation of files with wrong perms. -# -# NOTE on defaults: the default settings in the below functions were -# chosen based on the most common setting among cron ebuilds. -# -# Please assign any bugs regarding this eclass to cron-bugs@gentoo.org. - -inherit eutils flag-o-matic - -EXPORT_FUNCTIONS pkg_postinst - -SLOT="0" - -DEPEND=">=sys-apps/sed-4.0.5" - -RDEPEND=">=sys-process/cronbase-0.3.2" -for pn in vixie-cron bcron cronie dcron fcron; do - [[ ${pn} == "${PN}" ]] || RDEPEND="${RDEPEND} !sys-process/${pn}" -done - -# @FUNCTION: docrondir -# @USAGE: [ dir ] [ perms ] -# @DESCRIPTION: -# Creates crontab directory -# -# Both arguments are optional. Everything after 'dir' is considered -# the permissions (same format as insopts). -# -# ex: docrondir /some/dir -m 0770 -o 0 -g cron -# docrondir /some/dir (uses default perms) -# docrondir -m0700 (uses default dir) - -docrondir() { - # defaults - local perms="-m0750 -o 0 -g cron" dir="/var/spool/cron/crontabs" - - if [[ -n $1 ]] ; then - case "$1" in - */*) - dir=$1 - shift - [[ -n $1 ]] && perms="$@" - ;; - *) - perms="$@" - ;; - esac - fi - - diropts ${perms} - keepdir ${dir} - - # reset perms to default - diropts -m0755 -} - -# @FUNCTION: docron -# @USAGE: [ exe ] [ perms ] -# @DESCRIPTION: -# Install cron executable -# -# Both arguments are optional. -# -# ex: docron -m 0700 -o -0 -g 0 ('exe' defaults to "cron") -# docron crond -m 0110 - -docron() { - local cron="cron" perms="-m 0750 -o 0 -g 0" - - if [[ -n $1 ]] ; then - case "$1" in - -*) - perms="$@" - ;; - *) - cron=$1 - shift - [[ -n $1 ]] && perms="$@" - ;; - esac - fi - - exeopts ${perms} - exeinto /usr/sbin - doexe ${cron} || die "failed to install ${cron}" - - # reset perms to default - exeopts -m0755 -} - -# @FUNCTION: docrontab -# @USAGE: [ exe ] [ perms ] -# @DESCRIPTION: -# Install crontab executable -# -# Uses same semantics as docron. - -docrontab() { - local crontab="crontab" perms="-m 4750 -o 0 -g cron" - - if [[ -n $1 ]] ; then - case "$1" in - -*) - perms="$@" - ;; - *) - crontab=$1 - shift - [[ -n $1 ]] && perms="$@" - ;; - esac - fi - - exeopts ${perms} - exeinto /usr/bin - doexe ${crontab} || die "failed to install ${crontab}" - - # reset perms to default - exeopts -m0755 - - # users expect /usr/bin/crontab to exist... - if [[ "${crontab##*/}" != "crontab" ]] ; then - dosym ${crontab##*/} /usr/bin/crontab || \ - die "failed to create /usr/bin/crontab symlink" - fi -} - -# @FUNCTION: cron_pkg_postinst -# @DESCRIPTION: -# Outputs a message about system crontabs -# daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes" -cron_pkg_postinst() { - echo - # daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes" - if [ "${CRON_SYSTEM_CRONTAB:-no}" != "yes" ] ; then - einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:" - einfo " crontab /etc/crontab" - einfo - einfo "!!! That will replace SuperUser's current crontab !!!" - einfo - fi - - einfo "You may wish to read the Gentoo Linux Cron Guide, which can be" - einfo "found online at:" - einfo " https://www.gentoo.org/doc/en/cron-guide.xml" - echo -} diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass @@ -1,220 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -# @ECLASS: fcaps.eclass -# @MAINTAINER: -# Constanze Hausner <constanze@gentoo.org> -# base-system@gentoo.org -# @BLURB: function to set POSIX file-based capabilities -# @DESCRIPTION: -# This eclass provides a function to set file-based capabilities on binaries. -# This is not the same as USE=caps which controls runtime capability changes, -# often via packages like libcap. -# -# Due to probable capability-loss on moving or copying, this happens in -# pkg_postinst-phase (at least for now). -# -# @EXAMPLE: -# You can manually set the caps on ping and ping6 by doing: -# @CODE -# pkg_postinst() { -# fcaps cap_net_raw bin/ping bin/ping6 -# } -# @CODE -# -# Or set it via the global ebuild var FILECAPS: -# @CODE -# FILECAPS=( -# cap_net_raw bin/ping bin/ping6 -# ) -# @CODE - -if [[ -z ${_FCAPS_ECLASS} ]]; then -_FCAPS_ECLASS=1 - -IUSE="+filecaps" - -# We can't use libcap-ng atm due to #471414. -DEPEND="filecaps? ( sys-libs/libcap )" - -# @ECLASS-VARIABLE: FILECAPS -# @DEFAULT_UNSET -# @DESCRIPTION: -# An array of fcap arguments to use to automatically execute fcaps. See that -# function for more details. -# -# All args are consumed until the '--' marker is found. So if you have: -# @CODE -# FILECAPS=( moo cow -- fat cat -- chubby penguin ) -# @CODE -# -# This will end up executing: -# @CODE -# fcaps moo cow -# fcaps fat cat -# fcaps chubby penguin -# @CODE -# -# Note: If you override pkg_postinst, you must call fcaps_pkg_postinst yourself. - -# @FUNCTION: fcaps -# @USAGE: [-o <owner>] [-g <group>] [-m <mode>] [-M <caps mode>] <capabilities> <file[s]> -# @DESCRIPTION: -# Sets the specified capabilities on the specified files. -# -# The caps option takes the form as expected by the cap_from_text(3) man page. -# If no action is specified, then "=ep" will be used as a default. -# -# If the file is a relative path (e.g. bin/foo rather than /bin/foo), then the -# appropriate path var ($D/$ROOT/etc...) will be prefixed based on the current -# ebuild phase. -# -# The caps mode (default 711) is used to set the permission on the file if -# capabilities were properly set on the file. -# -# If the system is unable to set capabilities, it will use the specified user, -# group, and mode (presumably to make the binary set*id). The defaults there -# are 0:0 and 4711. Otherwise, the ownership and permissions will be -# unchanged. -fcaps() { - debug-print-function ${FUNCNAME} "$@" - - # Process the user options first. - local owner='0' - local group='0' - local mode='4711' - local caps_mode='711' - - while [[ $# -gt 0 ]] ; do - case $1 in - -o) owner=$2; shift;; - -g) group=$2; shift;; - -m) mode=$2; shift;; - -M) caps_mode=$2; shift;; - *) break;; - esac - shift - done - - [[ $# -lt 2 ]] && die "${FUNCNAME}: wrong arg count" - - local caps=$1 - [[ ${caps} == *[-=+]* ]] || caps+="=ep" - shift - - local root - case ${EBUILD_PHASE} in - compile|install|preinst) - root=${ED:-${D}} - ;; - postinst) - root=${EROOT:-${ROOT}} - ;; - esac - - # Process every file! - local file - for file ; do - [[ ${file} != /* ]] && file="${root}${file}" - - if use filecaps ; then - # Try to set capabilities. Ignore errors when the - # fs doesn't support it, but abort on all others. - debug-print "${FUNCNAME}: setting caps '${caps}' on '${file}'" - - # If everything goes well, we don't want the file to be readable - # by people. - chmod ${caps_mode} "${file}" || die - - # Set/verify funcs for sys-libs/libcap. - _libcap() { setcap "${caps}" "${file}" ; } - _libcap_verify() { setcap -v "${caps}" "${file}" >/dev/null ; } - - # Set/verify funcs for sys-libs/libcap-ng. - # Note: filecap only supports =ep mode. - # It also expects a different form: - # setcap cap_foo,cap_bar - # filecap foo bar - _libcap_ng() { - local caps=",${caps%=ep}" - filecap "${file}" "${caps//,cap_}" - } - _libcap_ng_verify() { - # libcap-ng has a crappy interface - local rcaps icaps caps=",${caps%=ep}" - rcaps=$(filecap "${file}" | \ - sed -nr \ - -e "s:^.{${#file}} +::" \ - -e 's:, +:\n:g' \ - -e 2p | \ - LC_ALL=C sort) - [[ ${PIPESTATUS[0]} -eq 0 ]] || return 1 - icaps=$(echo "${caps//,cap_}" | LC_ALL=C sort) - [[ ${rcaps} == ${icaps} ]] - } - - local out cmd notfound=0 - for cmd in _libcap _libcap_ng ; do - if ! out=$(LC_ALL=C ${cmd} 2>&1) ; then - case ${out} in - *"command not found"*) - : $(( ++notfound )) - continue - ;; - # ENOTSUP and EOPNOTSUPP might be the same value which means - # strerror() on them is unstable -- we can get both. #559608 - *"Not supported"*|\ - *"Operation not supported"*) - local fstype=$(stat -f -c %T "${file}") - ewarn "Could not set caps on '${file}' due to missing filesystem support:" - ewarn "* enable XATTR support for '${fstype}' in your kernel (if configurable)" - ewarn "* mount the fs with the user_xattr option (if not the default)" - ewarn "* enable the relevant FS_SECURITY option (if configurable)" - break - ;; - *) - eerror "Setting caps '${caps}' on file '${file}' failed:" - eerror "${out}" - die "could not set caps" - ;; - esac - else - # Sanity check that everything took. - ${cmd}_verify || die "Checking caps '${caps}' on '${file}' failed" - - # Everything worked. Move on to the next file. - continue 2 - fi - done - if [[ ${notfound} -eq 2 ]] && [[ -z ${_FCAPS_WARNED} ]] ; then - _FCAPS_WARNED="true" - ewarn "Could not find cap utils; make sure libcap or libcap-ng is available." - fi - fi - - # If we're still here, setcaps failed. - debug-print "${FUNCNAME}: setting owner/mode on '${file}'" - chown "${owner}:${group}" "${file}" || die - chmod ${mode} "${file}" || die - done -} - -# @FUNCTION: fcaps_pkg_postinst -# @DESCRIPTION: -# Process the FILECAPS array. -fcaps_pkg_postinst() { - local arg args=() - for arg in "${FILECAPS[@]}" "--" ; do - if [[ ${arg} == "--" ]] ; then - fcaps "${args[@]}" - args=() - else - args+=( "${arg}" ) - fi - done -} - -EXPORT_FUNCTIONS pkg_postinst - -fi diff --git a/eclass/python-whatever.eclass b/eclass/python-whatever.eclass @@ -1,9 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: python-whatever -# @MAINTAINER: Haelwenn (lanodan) Monnier <contact@hacktivis.me> -# @AUTHOR: Haelwenn (lanodan) Monnier <contact@hacktivis.me> -# @BLURB: For packages needing whatever python version - -PYTHON_COMPAT=(${PYTHON_TARGETS}) # Hacky Hacky