From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2DE6D15808B for ; Fri, 15 Apr 2022 20:34:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C810EE097D; Fri, 15 Apr 2022 20:34:32 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1453AE097E for ; Fri, 15 Apr 2022 20:34:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ED9DB3420F7 for ; Fri, 15 Apr 2022 20:34:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7CEEA434 for ; Fri, 15 Apr 2022 20:34:27 +0000 (UTC) From: "Alessandro Barbieri" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alessandro Barbieri" Message-ID: <1650054861.b2710c1d1c0ff01dbe02764a127291b55331b455.Alessandro-Barbieri@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/octaveforge.eclass X-VCS-Directories: eclass/ X-VCS-Committer: Alessandro-Barbieri X-VCS-Committer-Name: Alessandro Barbieri X-VCS-Revision: b2710c1d1c0ff01dbe02764a127291b55331b455 X-VCS-Branch: dev Date: Fri, 15 Apr 2022 20:34:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5384931e-fd69-4b79-81dd-6ca35a064660 X-Archives-Hash: cd4831a0907a7cfa7a390b4d6b082ecc commit: b2710c1d1c0ff01dbe02764a127291b55331b455 Author: Alessandro Barbieri gmail com> AuthorDate: Fri Apr 15 17:47:32 2022 +0000 Commit: Alessandro Barbieri gmail com> CommitDate: Fri Apr 15 20:34:21 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b2710c1d octaveforge.eclass: add documentation comments Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 86 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 19 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index 8a7fe0396..b9303884c 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -1,43 +1,72 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# -# Original Author: Rafael G. Martins -# Purpose: octaveforge helper eclass. -# +# @ECLASS: octaveforge.eclass +# @AUTHOR: +# Rafael G. Martins +# Alessandro Barbieri +# @BLURB: octaveforge helper eclass. +# @MAINTAINER: +# Alessandro Barbieri +# @SUPPORTED_EAPIS: 8 + +inherit autotools + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." +esac + +EXPORT_FUNCTIONS src_unpack src_prepare src_install pkg_postinst pkg_prerm pkg_postrm # @ECLASS-VARIABLE: OCTAVEFORGE_CAT # @DESCRIPTION: # the octave-forge category of the package. OCTAVEFORGE_CAT="${OCTAVEFORGE_CAT:-main}" +# @ECLASS-VARIABLE: REPO_URI +# @DESCRIPTION: +# URI to the sourceforge octave-forge repository REPO_URI="http://svn.code.sf.net/p/octave/code/trunk/octave-forge" -inherit autotools -SRC_URI="mirror://sourceforge/octave/${P}.tar.gz" +# defining some paths + +# @ECLASS-VARIABLE: OCT_ROOT +# @DESCRIPTION: +# full path to octave share +OCT_ROOT="/usr/share/octave" + +# @ECLASS-VARIABLE: OCT_PKGDIR +# @DESCRIPTION: +# path to octave pkgdir +OCT_PKGDIR="${OCT_ROOT}/packages" + +# @ECLASS-VARIABLE: OCT_BIN +# @DESCRIPTION: +# full path to octave binary +OCT_BIN="$(type -p octave)" SRC_URI=" - ${SRC_URI} + mirror://sourceforge/octave/${P}.tar.gz ${REPO_URI}/packages/package_Makefile.in -> octaveforge_Makefile ${REPO_URI}/packages/package_configure.in -> octaveforge_configure " SLOT="0" -# defining some paths -OCT_ROOT="/usr/share/octave" -OCT_PKGDIR="${OCT_ROOT}/packages" -OCT_BIN="$(type -p octave)" - -EXPORT_FUNCTIONS src_unpack src_prepare src_install pkg_postinst pkg_prerm pkg_postrm - +# @FUNCTION: octaveforge_src_unpack +# @DESCRIPTION: +# function to unpack and set the correct S octaveforge_src_unpack() { default if [ ! -d "${WORKDIR}/${P}" ]; then S="${WORKDIR}/${PN}" - cd "${S}" || die + pushd "${S}" || die fi } +# @FUNCTION: octaveforge_src_prepare +# @DESCRIPTION: +# function to add octaveforge specific makefile and configure and run autogen.sh if available octaveforge_src_prepare() { for filename in Makefile configure; do cp "${DISTDIR}/octaveforge_${filename}" "${S}/${filename}" || die @@ -48,7 +77,9 @@ octaveforge_src_prepare() { chmod 0755 "${S}/configure" || die if [ -e "${S}/src/autogen.sh" ]; then - cd "${S}/src" && ./autogen.sh || die 'failed to run autogen.sh' + pushd "${S}/src" || die + ./autogen.sh || die 'failed to run autogen.sh' + popd || die fi if [ -e "${S}/src/Makefile" ]; then sed -i 's/ -s / /g' "${S}/src/Makefile" || die 'sed failed.' @@ -56,6 +87,10 @@ octaveforge_src_prepare() { eapply_user } +# @FUNCTION: octaveforge_src_install +# @DESCRIPTION: +# function to install the octave package +# documentation to docsdir octaveforge_src_install() { emake DESTDIR="${D}" DISTPKG='Gentoo' install if [ -d doc/ ]; then @@ -63,12 +98,20 @@ octaveforge_src_install() { fi } +# @FUNCTION: octaveforge_pkg_postinst +# @DESCRIPTION: +# function that will rebuild the octave package database octaveforge_pkg_postinst() { einfo "Registering ${CATEGORY}/${PF} on the Octave package database." - [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" || die + if [ ! -d "${OCT_PKGDIR}" ] ; then + mkdir -p "${OCT_PKGDIR}" || die + fi "${OCT_BIN}" -H -q --no-site-file --eval "pkg('rebuild');" &> /dev/null || die 'failed to register the package.' } +# @FUNCTION: octaveforge_pkg_prerm +# @DESCRIPTION: +# function that will run on_uninstall routines to prepare the package to remove octaveforge_pkg_prerm() { einfo 'Running on_uninstall routines to prepare the package to remove.' local pkgdir=$( @@ -89,8 +132,13 @@ octaveforge_pkg_prerm() { fi } +# @FUNCTION: octaveforge_pkg_postrm +# @DESCRIPTION: +# function that will rebuild the octave package database octaveforge_pkg_postrm() { einfo 'Rebuilding the Octave package database.' - [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" || die + if [ ! -d "${OCT_PKGDIR}" ] ; then + mkdir -p "${OCT_PKGDIR}" || die + fi "${OCT_BIN}" -H --silent --eval 'pkg rebuild' &> /dev/null || die 'failed to rebuild the package database' }