commit:     e524e80e019e084297d8ef63e5eec2051a296121
Author:     Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com>
AuthorDate: Sat Dec 14 09:15:09 2019 +0000
Commit:     Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com>
CommitDate: Sat Dec 14 09:15:09 2019 +0000
URL:        https://gitweb.gentoo.org/repo/user/ssnb.git/commit/?id=e524e80e

add phoronix-test-suite, missing dependencies and eclass xdg-utils-r1

Signed-off-by: Samuel Bernardo <samuelbernardo.mail <AT> gmail.com>

 app-benchmarks/phoronix-test-suite/Manifest        |   6 +
 app-benchmarks/phoronix-test-suite/metadata.xml    |   7 +
 .../phoronix-test-suite-8.8.1.ebuild               | 144 ++++++++++++++++
 .../phoronix-test-suite-9.0.1.ebuild               | 144 ++++++++++++++++
 .../phoronix-test-suite-9999.ebuild                | 144 ++++++++++++++++
 dev-php/fpdf/Manifest                              |   3 +
 dev-php/fpdf/fpdf-1.81.ebuild                      |  34 ++++
 dev-php/fpdf/metadata.xml                          |  21 +++
 eclass/xdg-utils-r1.eclass                         | 186 +++++++++++++++++++++
 9 files changed, 689 insertions(+)

diff --git a/app-benchmarks/phoronix-test-suite/Manifest 
b/app-benchmarks/phoronix-test-suite/Manifest
new file mode 100644
index 0000000..e10ce27
--- /dev/null
+++ b/app-benchmarks/phoronix-test-suite/Manifest
@@ -0,0 +1,6 @@
+DIST phoronix-test-suite-8.8.1.tar.gz 890982 BLAKE2B 
bc8c96bd30c0c1854edef0a0c5f4eda6cd91b20d2ceb8c3a31c5ad2d93223d8ac8b95f112484d62e7523942461c76f17cfb2813ee8685f3b2105318ea2ba2ac2
 SHA512 
5c60ead063be27271654253a1319cf676ea06df89874489da0f2b931b588e6e7c25df823ec647b392fa6606e8b28fa8350cca39c199d950bd11671af7cab160c
+DIST phoronix-test-suite-9.0.1.tar.gz 1263655 BLAKE2B 
dd2be7776c46d7b78135a43214372709b36d87b1d24a959c6baa25afd6562157d212ef4c4d67f2bd17e97aa75e656de236ec7cfcd7c2b816890d1b24749a57f5
 SHA512 
7584f85fb57ca64128d6342c42244fe2498eec51e378bf4265f447b178d24dcde5855b644faa5937953ee262657e24dd5bb689a95e5843c184b205986e29ebce
+EBUILD phoronix-test-suite-8.8.1.ebuild 4766 BLAKE2B 
5594f3852917357b3a0f36b6083fe1178ee9a39e232521bf1018eaec5e69c6ecc1778b85a4cbfe5c0b341ef46c1b6888bc57628748a5bf8b2c57c3e48de22c93
 SHA512 
60a6beb97e21e495e7fc393557dfe39bd4174bb4f843a626db19fa2a2ee8d7e9d25ab2dbfc69172f301bc3cb0f607e301cf9322be191c4a477404f404b04e5cd
+EBUILD phoronix-test-suite-9.0.1.ebuild 4766 BLAKE2B 
5594f3852917357b3a0f36b6083fe1178ee9a39e232521bf1018eaec5e69c6ecc1778b85a4cbfe5c0b341ef46c1b6888bc57628748a5bf8b2c57c3e48de22c93
 SHA512 
60a6beb97e21e495e7fc393557dfe39bd4174bb4f843a626db19fa2a2ee8d7e9d25ab2dbfc69172f301bc3cb0f607e301cf9322be191c4a477404f404b04e5cd
+EBUILD phoronix-test-suite-9999.ebuild 4766 BLAKE2B 
5594f3852917357b3a0f36b6083fe1178ee9a39e232521bf1018eaec5e69c6ecc1778b85a4cbfe5c0b341ef46c1b6888bc57628748a5bf8b2c57c3e48de22c93
 SHA512 
60a6beb97e21e495e7fc393557dfe39bd4174bb4f843a626db19fa2a2ee8d7e9d25ab2dbfc69172f301bc3cb0f607e301cf9322be191c4a477404f404b04e5cd
+MISC metadata.xml 223 BLAKE2B 
6b03411bb798e5da6a370643ce0ffa41f4627cd9125d5c7fddd4bee814de5b8f8dd5fff73a0872c921474022fefc963766cab3a1a8fe52e6752e2501e40a3a63
 SHA512 
258a180336834206986eed33d45839d4a6e399b2bf966401d1fd6ef22e64a2dcdd041e846d0c1daf82ff49da3fd23e77c88a0dcdad2167cd88fc9b16f8ea35e9

diff --git a/app-benchmarks/phoronix-test-suite/metadata.xml 
b/app-benchmarks/phoronix-test-suite/metadata.xml
new file mode 100644
index 0000000..068da26
--- /dev/null
+++ b/app-benchmarks/phoronix-test-suite/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <upstream>
+               <remote-id type="github">phoronix-test-suite</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git 
a/app-benchmarks/phoronix-test-suite/phoronix-test-suite-8.8.1.ebuild 
b/app-benchmarks/phoronix-test-suite/phoronix-test-suite-8.8.1.ebuild
new file mode 100644
index 0000000..ccd32a4
--- /dev/null
+++ b/app-benchmarks/phoronix-test-suite/phoronix-test-suite-8.8.1.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# shellcheck disable=SC2034
+
+EAPI=7
+
+inherit bash-completion-r1 xdg-utils-r1
+
+DESCRIPTION="Phoronix's comprehensive, cross-platform testing and benchmark 
suite"
+HOMEPAGE="http://www.phoronix-test-suite.com";
+
+LICENSE="GPL-3"
+SLOT="0"
+
+if [[ ${PV} == "9999" ]] ; then
+       EGIT_REPO_URI="https://github.com/${PN}/${PN}.git";
+       EGIT3_STORE_DIR="${T}"
+       inherit git-r3
+       SRC_URI=""
+       KEYWORDS=""
+else
+       major_version="$(ver_cut 1-3)"
+       minor_version="$(ver_cut 4-5)"
+       MY_PV="${major_version}"
+       MY_P="${PN}-${MY_PV}"
+       KEYWORDS="~amd64 ~x86"
+       if [ ! -z "${minor_version}" ]; then
+               MY_PV="${MY_PV}${minor_version/pre/m}"
+               MY_P="${MY_P}${minor_version/pre/m}"
+       fi
+       
SRC_URI="https://github.com/phoronix-test-suite/${PN}/archive/v${MY_PV}.tar.gz 
-> ${MY_P}.tar.gz"
+       S="${WORKDIR}/${MY_P}"
+       unset -v minor_version major_version
+fi
+
+IUSE="sdl"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+               app-arch/p7zip
+               media-libs/libpng
+               
>=dev-lang/php-5.3:=[cli,curl,gd,json,posix,pcntl,sockets,ssl,truetype,xml,zip,zlib]
+               dev-php/fpdf
+               www-servers/apache
+               x11-base/xorg-server
+               sdl? (
+                       media-libs/libsdl
+                       media-libs/sdl-net
+                       media-libs/sdl-image
+                       media-libs/libsdl2
+                       media-libs/sdl2-net
+                       media-libs/sdl2-image
+                       media-libs/sdl2-mixer
+
+               )"
+
+check_php_config()
+{
+       local slot
+       for slot in $(eselect --brief php list cli); do
+               local php_dir="/etc/php/cli-${slot}"
+
+               if [[ -f "${EROOT%/}${php_dir}/php.ini" ]]; then
+                       dodir "${php_dir}"
+                       cp -f "${EROOT%/}${php_dir}/php.ini" 
"${ED%/}${php_dir}/php.ini" \
+                                       || die "cp failed: copy php.ini file"
+                       sed -i -e 's|^allow_url_fopen .*|allow_url_fopen = 
On|g' "${ED%/}${php_dir}/php.ini" \
+                                       || die "sed failed: modify php.ini file"
+               elif [[ "$(eselect php show cli)" == "${slot}" ]]; then
+                       ewarn "${slot} does not have a php.ini file."
+                       ewarn "${PN} needs the 'allow_url_fopen' option set to 
\"On\""
+                       ewarn "for downloading to work properly."
+                       ewarn
+               else
+                       elog "${slot} does not have a php.ini file."
+                       elog "${PN} may need the 'allow_url_fopen' option set 
to \"On\""
+                       elog "for downloading to work properly if you switch to 
${slot}"
+                       elog
+               fi
+       done
+}
+
+get_optional_dependencies()
+{
+       (($# == 1)) || die "${FUNCNAME[0]}(): invalid number of arguments: ${#} 
(1)"
+
+       local -a array_package_names
+       local field_value ifield package_generic_name optional_packages_xmlline 
package_names installable_packages=""
+       local package_close_regexp="</Package>" \
+                 
package_generic_name_regexp="^.*<GenericName>|</GenericName>.*$" \
+                 package_names_regexp="^.*<PackageName>|</PackageName>.*$"
+
+       line=0
+       while IFS=$'\n' read -r optional_packages_xmlline; do
+               if [[ "${optional_packages_xmlline}" =~ 
${package_generic_name_regexp} ]]; then
+                       package_generic_name="$(echo 
"${optional_packages_xmlline}" | sed -r "s@${package_generic_name_regexp}@@g")"
+               elif [[ "${optional_packages_xmlline}" =~ 
${package_names_regexp} ]]; then
+                       package_names="$(echo "${optional_packages_xmlline}" | 
sed -r -e "s@${package_names_regexp}@@g" -e 
's@(^[[:blank:]]+|[[:blank:]]+$)$@@g' )"
+                       ifield=0
+                       # shellcheck disable=SC2206
+                       array_package_names=( ${package_names} )
+                       for (( ifield=0 ; ifield < ${#array_package_names[@]} ; 
++ifield )); do
+                               field_value="${array_package_names[ifield]}"
+                               [[ ${field_value} =~ ^.+/.+$ ]] || continue     
# skip invalid package atoms
+
+                               if ! has_version "${field_value}"; then
+                                       
installable_packages="${installable_packages}${installable_packages:+ 
}${field_value}"
+                               fi
+                       done
+               elif [[ "${optional_packages_xmlline}" =~ 
${package_close_regexp} && ! -z "${installable_packages}" ]]; then
+                       ewarn "  ${package_generic_name}: 
${installable_packages}"
+                       installable_packages=""
+               fi
+       done <<< "${1}"
+}
+
+src_prepare() {
+       # BASH completion helper function "have" test is depreciated
+       sed -i -e '/^have phoronix-test-suite &&$/d' 
"${S}/pts-core/static/bash_completion" \
+                       || die "sed failed: remove PTS bash completion have 
test"
+       # Remove all dependency resolving shell scripts - security vulnerability
+       rm -rf "${S}/pts-core/external-test-dependencies/scripts"
+       eapply_user
+}
+
+src_install() {
+       # Store the contents of this file - since it will be installed / 
deleted before we need it.
+       GENTOO_OPTIONAL_PKGS_XML="$(cat 
"${S}/pts-core/external-test-dependencies/xml/gentoo-packages.xml")"
+       newbashcomp pts-core/static/bash_completion "${PN}"
+       DESTDIR="${D}" "${S}/install-sh" "${EPREFIX%/}/usr"
+
+       # Fix the cli-php config for downloading to work.
+       check_php_config
+}
+
+pkg_postinst() {
+       xdg_icon_cache_update
+       xdg_mimeinfo_database_update
+
+       ewarn "${PN} has the following optional package dependencies:"
+       get_optional_dependencies "${GENTOO_OPTIONAL_PKGS_XML}"
+       unset -v GENTOO_OPTIONAL_PKGS_XML
+}

diff --git 
a/app-benchmarks/phoronix-test-suite/phoronix-test-suite-9.0.1.ebuild 
b/app-benchmarks/phoronix-test-suite/phoronix-test-suite-9.0.1.ebuild
new file mode 100644
index 0000000..ccd32a4
--- /dev/null
+++ b/app-benchmarks/phoronix-test-suite/phoronix-test-suite-9.0.1.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# shellcheck disable=SC2034
+
+EAPI=7
+
+inherit bash-completion-r1 xdg-utils-r1
+
+DESCRIPTION="Phoronix's comprehensive, cross-platform testing and benchmark 
suite"
+HOMEPAGE="http://www.phoronix-test-suite.com";
+
+LICENSE="GPL-3"
+SLOT="0"
+
+if [[ ${PV} == "9999" ]] ; then
+       EGIT_REPO_URI="https://github.com/${PN}/${PN}.git";
+       EGIT3_STORE_DIR="${T}"
+       inherit git-r3
+       SRC_URI=""
+       KEYWORDS=""
+else
+       major_version="$(ver_cut 1-3)"
+       minor_version="$(ver_cut 4-5)"
+       MY_PV="${major_version}"
+       MY_P="${PN}-${MY_PV}"
+       KEYWORDS="~amd64 ~x86"
+       if [ ! -z "${minor_version}" ]; then
+               MY_PV="${MY_PV}${minor_version/pre/m}"
+               MY_P="${MY_P}${minor_version/pre/m}"
+       fi
+       
SRC_URI="https://github.com/phoronix-test-suite/${PN}/archive/v${MY_PV}.tar.gz 
-> ${MY_P}.tar.gz"
+       S="${WORKDIR}/${MY_P}"
+       unset -v minor_version major_version
+fi
+
+IUSE="sdl"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+               app-arch/p7zip
+               media-libs/libpng
+               
>=dev-lang/php-5.3:=[cli,curl,gd,json,posix,pcntl,sockets,ssl,truetype,xml,zip,zlib]
+               dev-php/fpdf
+               www-servers/apache
+               x11-base/xorg-server
+               sdl? (
+                       media-libs/libsdl
+                       media-libs/sdl-net
+                       media-libs/sdl-image
+                       media-libs/libsdl2
+                       media-libs/sdl2-net
+                       media-libs/sdl2-image
+                       media-libs/sdl2-mixer
+
+               )"
+
+check_php_config()
+{
+       local slot
+       for slot in $(eselect --brief php list cli); do
+               local php_dir="/etc/php/cli-${slot}"
+
+               if [[ -f "${EROOT%/}${php_dir}/php.ini" ]]; then
+                       dodir "${php_dir}"
+                       cp -f "${EROOT%/}${php_dir}/php.ini" 
"${ED%/}${php_dir}/php.ini" \
+                                       || die "cp failed: copy php.ini file"
+                       sed -i -e 's|^allow_url_fopen .*|allow_url_fopen = 
On|g' "${ED%/}${php_dir}/php.ini" \
+                                       || die "sed failed: modify php.ini file"
+               elif [[ "$(eselect php show cli)" == "${slot}" ]]; then
+                       ewarn "${slot} does not have a php.ini file."
+                       ewarn "${PN} needs the 'allow_url_fopen' option set to 
\"On\""
+                       ewarn "for downloading to work properly."
+                       ewarn
+               else
+                       elog "${slot} does not have a php.ini file."
+                       elog "${PN} may need the 'allow_url_fopen' option set 
to \"On\""
+                       elog "for downloading to work properly if you switch to 
${slot}"
+                       elog
+               fi
+       done
+}
+
+get_optional_dependencies()
+{
+       (($# == 1)) || die "${FUNCNAME[0]}(): invalid number of arguments: ${#} 
(1)"
+
+       local -a array_package_names
+       local field_value ifield package_generic_name optional_packages_xmlline 
package_names installable_packages=""
+       local package_close_regexp="</Package>" \
+                 
package_generic_name_regexp="^.*<GenericName>|</GenericName>.*$" \
+                 package_names_regexp="^.*<PackageName>|</PackageName>.*$"
+
+       line=0
+       while IFS=$'\n' read -r optional_packages_xmlline; do
+               if [[ "${optional_packages_xmlline}" =~ 
${package_generic_name_regexp} ]]; then
+                       package_generic_name="$(echo 
"${optional_packages_xmlline}" | sed -r "s@${package_generic_name_regexp}@@g")"
+               elif [[ "${optional_packages_xmlline}" =~ 
${package_names_regexp} ]]; then
+                       package_names="$(echo "${optional_packages_xmlline}" | 
sed -r -e "s@${package_names_regexp}@@g" -e 
's@(^[[:blank:]]+|[[:blank:]]+$)$@@g' )"
+                       ifield=0
+                       # shellcheck disable=SC2206
+                       array_package_names=( ${package_names} )
+                       for (( ifield=0 ; ifield < ${#array_package_names[@]} ; 
++ifield )); do
+                               field_value="${array_package_names[ifield]}"
+                               [[ ${field_value} =~ ^.+/.+$ ]] || continue     
# skip invalid package atoms
+
+                               if ! has_version "${field_value}"; then
+                                       
installable_packages="${installable_packages}${installable_packages:+ 
}${field_value}"
+                               fi
+                       done
+               elif [[ "${optional_packages_xmlline}" =~ 
${package_close_regexp} && ! -z "${installable_packages}" ]]; then
+                       ewarn "  ${package_generic_name}: 
${installable_packages}"
+                       installable_packages=""
+               fi
+       done <<< "${1}"
+}
+
+src_prepare() {
+       # BASH completion helper function "have" test is depreciated
+       sed -i -e '/^have phoronix-test-suite &&$/d' 
"${S}/pts-core/static/bash_completion" \
+                       || die "sed failed: remove PTS bash completion have 
test"
+       # Remove all dependency resolving shell scripts - security vulnerability
+       rm -rf "${S}/pts-core/external-test-dependencies/scripts"
+       eapply_user
+}
+
+src_install() {
+       # Store the contents of this file - since it will be installed / 
deleted before we need it.
+       GENTOO_OPTIONAL_PKGS_XML="$(cat 
"${S}/pts-core/external-test-dependencies/xml/gentoo-packages.xml")"
+       newbashcomp pts-core/static/bash_completion "${PN}"
+       DESTDIR="${D}" "${S}/install-sh" "${EPREFIX%/}/usr"
+
+       # Fix the cli-php config for downloading to work.
+       check_php_config
+}
+
+pkg_postinst() {
+       xdg_icon_cache_update
+       xdg_mimeinfo_database_update
+
+       ewarn "${PN} has the following optional package dependencies:"
+       get_optional_dependencies "${GENTOO_OPTIONAL_PKGS_XML}"
+       unset -v GENTOO_OPTIONAL_PKGS_XML
+}

diff --git a/app-benchmarks/phoronix-test-suite/phoronix-test-suite-9999.ebuild 
b/app-benchmarks/phoronix-test-suite/phoronix-test-suite-9999.ebuild
new file mode 100644
index 0000000..ccd32a4
--- /dev/null
+++ b/app-benchmarks/phoronix-test-suite/phoronix-test-suite-9999.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# shellcheck disable=SC2034
+
+EAPI=7
+
+inherit bash-completion-r1 xdg-utils-r1
+
+DESCRIPTION="Phoronix's comprehensive, cross-platform testing and benchmark 
suite"
+HOMEPAGE="http://www.phoronix-test-suite.com";
+
+LICENSE="GPL-3"
+SLOT="0"
+
+if [[ ${PV} == "9999" ]] ; then
+       EGIT_REPO_URI="https://github.com/${PN}/${PN}.git";
+       EGIT3_STORE_DIR="${T}"
+       inherit git-r3
+       SRC_URI=""
+       KEYWORDS=""
+else
+       major_version="$(ver_cut 1-3)"
+       minor_version="$(ver_cut 4-5)"
+       MY_PV="${major_version}"
+       MY_P="${PN}-${MY_PV}"
+       KEYWORDS="~amd64 ~x86"
+       if [ ! -z "${minor_version}" ]; then
+               MY_PV="${MY_PV}${minor_version/pre/m}"
+               MY_P="${MY_P}${minor_version/pre/m}"
+       fi
+       
SRC_URI="https://github.com/phoronix-test-suite/${PN}/archive/v${MY_PV}.tar.gz 
-> ${MY_P}.tar.gz"
+       S="${WORKDIR}/${MY_P}"
+       unset -v minor_version major_version
+fi
+
+IUSE="sdl"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+               app-arch/p7zip
+               media-libs/libpng
+               
>=dev-lang/php-5.3:=[cli,curl,gd,json,posix,pcntl,sockets,ssl,truetype,xml,zip,zlib]
+               dev-php/fpdf
+               www-servers/apache
+               x11-base/xorg-server
+               sdl? (
+                       media-libs/libsdl
+                       media-libs/sdl-net
+                       media-libs/sdl-image
+                       media-libs/libsdl2
+                       media-libs/sdl2-net
+                       media-libs/sdl2-image
+                       media-libs/sdl2-mixer
+
+               )"
+
+check_php_config()
+{
+       local slot
+       for slot in $(eselect --brief php list cli); do
+               local php_dir="/etc/php/cli-${slot}"
+
+               if [[ -f "${EROOT%/}${php_dir}/php.ini" ]]; then
+                       dodir "${php_dir}"
+                       cp -f "${EROOT%/}${php_dir}/php.ini" 
"${ED%/}${php_dir}/php.ini" \
+                                       || die "cp failed: copy php.ini file"
+                       sed -i -e 's|^allow_url_fopen .*|allow_url_fopen = 
On|g' "${ED%/}${php_dir}/php.ini" \
+                                       || die "sed failed: modify php.ini file"
+               elif [[ "$(eselect php show cli)" == "${slot}" ]]; then
+                       ewarn "${slot} does not have a php.ini file."
+                       ewarn "${PN} needs the 'allow_url_fopen' option set to 
\"On\""
+                       ewarn "for downloading to work properly."
+                       ewarn
+               else
+                       elog "${slot} does not have a php.ini file."
+                       elog "${PN} may need the 'allow_url_fopen' option set 
to \"On\""
+                       elog "for downloading to work properly if you switch to 
${slot}"
+                       elog
+               fi
+       done
+}
+
+get_optional_dependencies()
+{
+       (($# == 1)) || die "${FUNCNAME[0]}(): invalid number of arguments: ${#} 
(1)"
+
+       local -a array_package_names
+       local field_value ifield package_generic_name optional_packages_xmlline 
package_names installable_packages=""
+       local package_close_regexp="</Package>" \
+                 
package_generic_name_regexp="^.*<GenericName>|</GenericName>.*$" \
+                 package_names_regexp="^.*<PackageName>|</PackageName>.*$"
+
+       line=0
+       while IFS=$'\n' read -r optional_packages_xmlline; do
+               if [[ "${optional_packages_xmlline}" =~ 
${package_generic_name_regexp} ]]; then
+                       package_generic_name="$(echo 
"${optional_packages_xmlline}" | sed -r "s@${package_generic_name_regexp}@@g")"
+               elif [[ "${optional_packages_xmlline}" =~ 
${package_names_regexp} ]]; then
+                       package_names="$(echo "${optional_packages_xmlline}" | 
sed -r -e "s@${package_names_regexp}@@g" -e 
's@(^[[:blank:]]+|[[:blank:]]+$)$@@g' )"
+                       ifield=0
+                       # shellcheck disable=SC2206
+                       array_package_names=( ${package_names} )
+                       for (( ifield=0 ; ifield < ${#array_package_names[@]} ; 
++ifield )); do
+                               field_value="${array_package_names[ifield]}"
+                               [[ ${field_value} =~ ^.+/.+$ ]] || continue     
# skip invalid package atoms
+
+                               if ! has_version "${field_value}"; then
+                                       
installable_packages="${installable_packages}${installable_packages:+ 
}${field_value}"
+                               fi
+                       done
+               elif [[ "${optional_packages_xmlline}" =~ 
${package_close_regexp} && ! -z "${installable_packages}" ]]; then
+                       ewarn "  ${package_generic_name}: 
${installable_packages}"
+                       installable_packages=""
+               fi
+       done <<< "${1}"
+}
+
+src_prepare() {
+       # BASH completion helper function "have" test is depreciated
+       sed -i -e '/^have phoronix-test-suite &&$/d' 
"${S}/pts-core/static/bash_completion" \
+                       || die "sed failed: remove PTS bash completion have 
test"
+       # Remove all dependency resolving shell scripts - security vulnerability
+       rm -rf "${S}/pts-core/external-test-dependencies/scripts"
+       eapply_user
+}
+
+src_install() {
+       # Store the contents of this file - since it will be installed / 
deleted before we need it.
+       GENTOO_OPTIONAL_PKGS_XML="$(cat 
"${S}/pts-core/external-test-dependencies/xml/gentoo-packages.xml")"
+       newbashcomp pts-core/static/bash_completion "${PN}"
+       DESTDIR="${D}" "${S}/install-sh" "${EPREFIX%/}/usr"
+
+       # Fix the cli-php config for downloading to work.
+       check_php_config
+}
+
+pkg_postinst() {
+       xdg_icon_cache_update
+       xdg_mimeinfo_database_update
+
+       ewarn "${PN} has the following optional package dependencies:"
+       get_optional_dependencies "${GENTOO_OPTIONAL_PKGS_XML}"
+       unset -v GENTOO_OPTIONAL_PKGS_XML
+}

diff --git a/dev-php/fpdf/Manifest b/dev-php/fpdf/Manifest
new file mode 100644
index 0000000..e68ceef
--- /dev/null
+++ b/dev-php/fpdf/Manifest
@@ -0,0 +1,3 @@
+DIST fpdf181.tgz 127608 BLAKE2B 
e1632e03c8c041f89e8f5572987f38b22fd693f8926c4144fe677ae6267ede2c33cf9df697489459f41bd5e6905eaae0e64fdc40c6b4172220a686e8cda95f48
 SHA512 
cf025691f1ad6f124b98baef87b64da79b3a866660db31d9a6de094f54504874f4cdd9c1b976cb802d38d3b760f1126bf98634e0b37ed299c21c05035ea676c9
+EBUILD fpdf-1.81.ebuild 705 BLAKE2B 
06d98ca4b8444c92adecbe88aa40b23b83015946c1f178fd46c602eb3e6026ad968de5cf1c817e80e8f6ddc0e3494d44923023b9c5b4943632c8046bbe8ffac5
 SHA512 
005ff3152ae7a7e91781e4bc569e990858276cd8deb4180d830e97698443f709b75812444858149e54f25a6ab1433d2ceac73f1268a8fec4ce12e4a3b4bae156
+MISC metadata.xml 885 BLAKE2B 
259f25c3d3b366631a76c2d126cff6f2c3ab248b54018ae366ad4bb9027fecf0e96736f668f0894b678e1da2942d5f902794c0f7e9e18ecaff88c0c8dfcca261
 SHA512 
62c0ed5a47d02ab53a724ffa5f13da6cfc7b183ed1216d739b41d5f61b5274a2010ee54c58497919f99848a65ea7fde7f8672ad9e933cc018926dc78722818a0

diff --git a/dev-php/fpdf/fpdf-1.81.ebuild b/dev-php/fpdf/fpdf-1.81.ebuild
new file mode 100644
index 0000000..f5c73d5
--- /dev/null
+++ b/dev-php/fpdf/fpdf-1.81.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# shellcheck disable=SC2034
+
+EAPI=7
+
+MY_PV="$(ver_rs 1 '')"
+MY_P="${PN}${MY_PV}"
+
+DESCRIPTION="FPDF is a PHP class which allows to generate PDF files with pure 
PHP"
+HOMEPAGE="http://www.fpdf.org/";
+SRC_URI="http://www.fpdf.org/en/dl.php?v=${MY_PV}&f=tgz -> ${MY_P}.tgz"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc"
+
+RDEPEND="dev-lang/php:*[gd,zlib]"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS=( install.txt )
+
+src_install() {
+               insinto "/usr/share/php/${PN}"
+               doins -r ./*.php font/ makefont/
+
+               if use doc; then
+                       docinto html
+                       dodoc -r changelog.htm fpdf.css FAQ.htm html/ tutorial/
+               fi
+}

diff --git a/dev-php/fpdf/metadata.xml b/dev-php/fpdf/metadata.xml
new file mode 100644
index 0000000..663eef0
--- /dev/null
+++ b/dev-php/fpdf/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <longdescription>
+FPDF is a PHP class which allows to generate PDF files with pure PHP, that is 
to say without using the PDFlib library. F from FPDF stands for Free: you may 
use it for any kind of usage and modify it to suit your needs.
+
+FPDF has other advantages: high level functions. Here is a list of its main 
features:
+
+* Choice of measure unit, page format and margins
+* Page header and footer management
+* Automatic page break
+* Automatic line break and text justification
+* Image support (JPEG, PNG and GIF)
+* Colors
+* Links
+* TrueType, Type1 and encoding support
+* Page compression
+
+FPDF requires no extension (except Zlib to enable compression and GD for GIF 
support). The latest version requires at least PHP 5.1.
+       </longdescription>
+</pkgmetadata>

diff --git a/eclass/xdg-utils-r1.eclass b/eclass/xdg-utils-r1.eclass
new file mode 100644
index 0000000..5f90437
--- /dev/null
+++ b/eclass/xdg-utils-r1.eclass
@@ -0,0 +1,186 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: xdg-utils.eclass
+# @MAINTAINER:
+# [email protected]
+# @AUTHOR:
+# Original author: Gilles Dartiguelongue <[email protected]>
+# @BLURB: Auxiliary functions commonly used by XDG compliant packages.
+# @DESCRIPTION:
+# This eclass provides a set of auxiliary functions needed by most XDG
+# compliant packages.
+# It provides XDG stack related functions such as:
+#  * XDG .desktop files cache management
+#  * XDG mime information database management
+
+case "${EAPI:-0}" in
+       0|1|2|3|4|5|6|7) ;;
+       *) die "EAPI=${EAPI} is not supported" ;;
+esac
+
+# @ECLASS-VARIABLE: DESKTOP_DATABASE_UPDATE_BIN
+# @INTERNAL
+# @DESCRIPTION:
+# Path to update-desktop-database
+: "${DESKTOP_DATABASE_UPDATE_BIN:="/usr/bin/update-desktop-database"}"
+
+# @ECLASS-VARIABLE: DESKTOP_DATABASE_DIR
+# @INTERNAL
+# @DESCRIPTION:
+# Directory where .desktop files database is stored
+: "${DESKTOP_DATABASE_DIR="/usr/share/applications"}"
+
+# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
+# @INTERNAL
+# @DESCRIPTION:
+# Path to gtk-update-icon-cache
+: "${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}"
+
+# @ECLASS-VARIABLE: MIMEINFO_DATABASE_UPDATE_BIN
+# @INTERNAL
+# @DESCRIPTION:
+# Path to update-mime-database
+: "${MIMEINFO_DATABASE_UPDATE_BIN:="/usr/bin/update-mime-database"}"
+
+# @ECLASS-VARIABLE: MIMEINFO_DATABASE_DIR
+# @INTERNAL
+# @DESCRIPTION:
+# Directory where .desktop files database is stored
+: "${MIMEINFO_DATABASE_DIR:="/usr/share/mime"}"
+
+# @ECLASS-VARIABLE: XDG_ECLASS_ICONS
+# @INTERNAL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# List of icons provided by the package
+
+# @FUNCTION: xdg_environment_reset
+# @DESCRIPTION:
+# Clean up environment for clean builds.
+xdg_environment_reset() {
+       # Prepare XDG base directories
+       export XDG_DATA_HOME="${HOME}/.local/share"
+       export XDG_CONFIG_HOME="${HOME}/.config"
+       export XDG_CACHE_HOME="${HOME}/.cache"
+       export XDG_RUNTIME_DIR="${T}/run"
+       mkdir -p "${XDG_DATA_HOME}" "${XDG_CONFIG_HOME}" "${XDG_CACHE_HOME}" \
+               "${XDG_RUNTIME_DIR}" || die
+       # This directory needs to be owned by the user, and chmod 0700
+       # 
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+       chmod 0700 "${XDG_RUNTIME_DIR}" || die
+
+       unset DBUS_SESSION_BUS_ADDRESS
+}
+
+# @FUNCTION: xdg_desktop_database_update
+# @DESCRIPTION:
+# Updates the .desktop files database.
+# Generates a list of mimetypes linked to applications that can handle them
+xdg_desktop_database_update() {
+               has ${EAPI:-0} 7 || BROOT="${EROOT}"
+        local updater="${BROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
+
+        if [[ ${EBUILD_PHASE} != post* ]] ; then
+                die "xdg_desktop_database_update must be used in pkg_post* 
phases."
+        fi
+
+        if [[ ! -x "${updater}" ]] ; then
+                debug-print "${updater} is not executable"
+                return
+        fi
+
+        ebegin "Updating .desktop files database"
+        "${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
+        eend $?
+}
+
+# @FUNCTION: xdg_icon_savelist
+# @DESCRIPTION:
+# Find the icons that are about to be installed and save their location
+# in the XDG_ECLASS_ICONS environment variable. This is only
+# necessary for eclass implementations that call
+# xdg_icon_cache_update conditionally.
+# This function should be called from pkg_preinst.
+xdg_icon_savelist() {
+       XDG_ECLASS_ICONS=()
+       while IFS= read -r -d '' f; do
+               XDG_ECLASS_ICONS+=( "${f}" )
+       done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 
2>/dev/null)
+
+       export XDG_ECLASS_ICONS
+}
+
+# @FUNCTION: xdg_icon_cache_update
+# @DESCRIPTION:
+# Updates Gtk+ icon cache files under /usr/share/icons.
+# This function should be called from pkg_postinst and pkg_postrm.
+xdg_icon_cache_update() {
+       has ${EAPI:-0} 7 || BROOT="${EROOT}"
+       local updater="${BROOT%/}${GTK_UPDATE_ICON_CACHE}"
+
+       if [[ ! -x "${updater}" ]] ; then
+               debug-print "${updater} is not executable"
+               return
+       fi
+
+       ebegin "Updating icons cache"
+
+       local retval=0
+       local fails=( )
+
+       for dir in "${EROOT%/}"/usr/share/icons/*
+       do
+               if [[ -f "${dir}/index.theme" ]] ; then
+                       local rv=0
+
+                       "${updater}" -qf "${dir}"
+                       rv=$?
+
+                       if [[ ! $rv -eq 0 ]] ; then
+                                       debug-print "Updating cache failed on 
${dir}"
+
+                                       # Add to the list of failures
+                                       fails+=( "${dir}" )
+
+                                       retval=2
+                       fi
+               elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
+                       # Clear stale cache files after theme uninstallation
+                       rm "${dir}/icon-theme.cache"
+               fi
+
+               if [[ -z $(ls "${dir}") ]]; then
+                       # Clear empty theme directories after theme 
uninstallation
+                       rmdir "${dir}"
+               fi
+       done
+
+       eend ${retval}
+
+       for f in "${fails[@]}" ; do
+               eerror "Failed to update cache with icon $f"
+       done
+}
+
+# @FUNCTION: xdg_mimeinfo_database_update
+# @DESCRIPTION:
+# Update the mime database.
+# Creates a general list of mime types from several sources
+xdg_mimeinfo_database_update() {
+       has ${EAPI:-0} 7 || BROOT="${EROOT}"
+       local updater="${BROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
+
+       if [[ ${EBUILD_PHASE} != post* ]] ; then
+               die "xdg_mimeinfo_database_update must be used in pkg_post* 
phases."
+       fi
+
+       if [[ ! -x "${updater}" ]] ; then
+               debug-print "${updater} is not executable"
+               return
+       fi
+
+       ebegin "Updating shared mime info database"
+       "${updater}" "${BROOT%/}${MIMEINFO_DATABASE_DIR}"
+       eend $?
+}

Reply via email to