diff --git a/dev-nodejs/configurable-http-proxy/Manifest b/dev-nodejs/configurable-http-proxy/Manifest new file mode 100644 index 00000000..9115bf5c --- /dev/null +++ b/dev-nodejs/configurable-http-proxy/Manifest @@ -0,0 +1 @@ +DIST configurable-http-proxy-4.5.0.tgz 25227 BLAKE2B b5a373a886949196b8968c49bea93e509379ac89ab814d66a50d19b9acac4f10771d691d834d6134f0f3bd4dde1ffe6873ef3629742de7ab6f85268128ff4f52 SHA512 8ae686f39103588a74d839b52d9b22eef444e021f9711c28dbe19a104022e9f817ddd44ba6dfe385073bca5c1789b8b89148ccbe957fc5b3308d146619c83835 diff --git a/dev-nodejs/configurable-http-proxy/configurable-http-proxy-4.5.0.ebuild b/dev-nodejs/configurable-http-proxy/configurable-http-proxy-4.5.0.ebuild new file mode 100644 index 00000000..68636b60 --- /dev/null +++ b/dev-nodejs/configurable-http-proxy/configurable-http-proxy-4.5.0.ebuild @@ -0,0 +1,17 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +NODEJS_MIN_VERSION="10" +NODE_MODULE_DEPEND="" +NODE_MODULE_EXTRA_FILES="" + +inherit nodejs + +DESCRIPTION="A simple wrapper around node-http-proxy" + +LICENSE="BSD-3" +KEYWORDS="~amd64" + +SLOT="0" diff --git a/dev-nodejs/configurable-http-proxy/metadata.xml b/dev-nodejs/configurable-http-proxy/metadata.xml new file mode 100644 index 00000000..18c10b9d --- /dev/null +++ b/dev-nodejs/configurable-http-proxy/metadata.xml @@ -0,0 +1,11 @@ + + + + + ops@adjust.com + Adjust Ops Team + + + foo + + diff --git a/eclass/nodejs.eclass b/eclass/nodejs.eclass new file mode 100644 index 00000000..97f4dad9 --- /dev/null +++ b/eclass/nodejs.eclass @@ -0,0 +1,82 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: nodejs.eclass +# @MAINTAINER: +# Jannis Mast +# @SUPPORTED_EAPIS: 7 +# @BLURB: eclass for node.js packages +# @DESCRIPTION: +# This eclass takes care of installing node.js packages and their dependencies + +case ${EAPI:-0} in + 0|1|2|3|4|5|6) + die "EAPI=${EAPI} is not supported by nodejs.eclass (too old)" + ;; + 7|8) + ;; + *) + die "EAPI=${EAPI} is not supported by nodejs.eclass" + ;; +esac + +EXPORT_FUNCTIONS src_unpack src_install + +# @ECLASS-VARIABLE: NODE_MODULE_NAME +# @DESCRIPTION: +# The name of the node module that belongs to the package. +# Defaults to ${PN} if not set +if [ -z ${NODE_MODULE_NAME} ]; then + NODE_MODULE_NAME="${PN}" +fi +# @ECLASS_VARIABLE: NODE_DEPEND +# @DESCRIPTION: +# A list of all node.js modules that this package depends on +# Entries should have the format "name:version" +# @ECLASS_VERIABLE: NODE_BIN +# @DESCRIPTION: +# List of scripts that should be linked into /usr/bin +# Entries should have the format "name:path" +# where "name" is the destination filename in /usr/bin +# and "path" is the relative path of the script in the module's directory +# @ECLASS_VARIABLE: NODEJS_MIN_VERSION +# @DESCRIPTION: +# Minimum version of net-libs/noejs for this package (optional) + +SRC_URI="http://registry.npmjs.org/${NODE_MODULE_NAME}/-/${NODE_MODULE_NAME}-${PV}.tgz" +for pkg in ${NODE_DEPEND}; do + pkg_name="${pkg%:*}" + pkg_version="${pkg#*:}" + SRC_URI="${SRC_URI} http://registry.npmjs.org/${pkg_name}/-/${pkg_name}-${pkg_version}.tgz" +done +S="${WORKDIR}/${NODE_MODULE_NAME}" + +DEPEND="" +if [ -z ${NODEJS_MIN_VERSION} ]; then + RDEPEND="net-libs/nodejs" +else + RDEPEND=">=net-libs/nodejs-${NODEJS_MIN_VERSION}" +fi + +nodejs_src_unpack() { + unpack "${NODE_MODULE_NAME}-${PV}.tgz" + mv "package" "${NODE_MODULE_NAME}" || die + mkdir "${NODE_MODULE_NAME}/node_modules" || die + for pkg in ${NODE_DEPEND}; do + pkg_name="${pkg%:*}" + pkg_version="${pkg#*:}" + unpack "${pkg_name}-${pkg_version}.tgz" + mv "package" "${NODE_MODULE_NAME}/node_modules/${pkg_name}" || die + done +} + +nodejs_src_install() { + insinto "/usr/$(get_libdir)/node_modules/${NODE_MODULE_NAME}" + doins -r . + for i in ${NODE_BIN}; do + src="${i#*:}" + dest="${i%:*}" + dosym "${EROOT}/usr/$(get_libdir)/node_modules/${NODE_MODULE_NAME}/${src}" "/usr/bin/${dest}" + fperms +x "/usr/$(get_libdir)/node_modules/${NODE_MODULE_NAME}/${src}" + done +} diff --git a/profiles/categories b/profiles/categories new file mode 100644 index 00000000..beb0be6d --- /dev/null +++ b/profiles/categories @@ -0,0 +1 @@ +dev-nodejs