From: "Jia, Fang" <fang.jia@windriver.com>
To: <git@andred.net>, <openembedded-devel@lists.openembedded.org>,
Richard Leitner <richard.leitner@skidata.com>
Subject: Re: [PATCH 2/2] openjdk: add openjdk-config
Date: Mon, 22 Jul 2019 10:53:07 +0800 [thread overview]
Message-ID: <787bb142-49fb-9108-3307-af1741c48dcf@windriver.com> (raw)
In-Reply-To: <1550719388-9980-2-git-send-email-fang.jia@windriver.com>
Hi, Richard Leitner
How about this patch ? Could you help to give some suggestions ?
Thanks,
Fang
On 21/02/2019 11:23, Fang Jia wrote:
> * Create a new package openjdk-config which used to set variable value
> for openjdk.
> * The LICENSE file of openjdk-config is COPYING.MIT.
> * Allow JAVA_HOME to be configured via a variable of the same name.
> * Define JAVA_HOME by default in openjdk-config.sh file.
>
> Signed-off-by: Fang Jia <fang.jia@windriver.com>
> ---
> recipes-core/openjdk/openjdk-config.bb | 24 ++++++++++++++++++++++
> recipes-core/openjdk/openjdk-config/COPYING.MIT | 17 +++++++++++++++
> .../openjdk/openjdk-config/openjdk-config.sh | 11 ++++++++++
> 3 files changed, 52 insertions(+)
> create mode 100644 recipes-core/openjdk/openjdk-config.bb
> create mode 100644 recipes-core/openjdk/openjdk-config/COPYING.MIT
> create mode 100644 recipes-core/openjdk/openjdk-config/openjdk-config.sh
>
> diff --git a/recipes-core/openjdk/openjdk-config.bb b/recipes-core/openjdk/openjdk-config.bb
> new file mode 100644
> index 0000000..34f9356
> --- /dev/null
> +++ b/recipes-core/openjdk/openjdk-config.bb
> @@ -0,0 +1,24 @@
> +SUMMARY = "Configuration script to set variables"
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> +
> +PR = "r1"
> +
> +SRC_URI = "file://COPYING.MIT \
> + file://openjdk-config.sh \
> +"
> +
> +S = "${WORKDIR}"
> +
> +# Set the default value
> +JAVA_HOME ?= ""
> +
> +do_configure() {
> + sed -i "s%@JAVA_HOME@%${JAVA_HOME}%" openjdk-config.sh
> + sed -i "s%@libdir@%${libdir}%" openjdk-config.sh
> +}
> +
> +do_install() {
> + install -d ${D}${sysconfdir}/profile.d
> + install -m 0755 openjdk-config.sh ${D}${sysconfdir}/profile.d/
> +}
> diff --git a/recipes-core/openjdk/openjdk-config/COPYING.MIT b/recipes-core/openjdk/openjdk-config/COPYING.MIT
> new file mode 100644
> index 0000000..fb950dc
> --- /dev/null
> +++ b/recipes-core/openjdk/openjdk-config/COPYING.MIT
> @@ -0,0 +1,17 @@
> +Permission is hereby granted, free of charge, to any person obtaining a copy
> +of this software and associated documentation files (the "Software"), to deal
> +in the Software without restriction, including without limitation the rights
> +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> +copies of the Software, and to permit persons to whom the Software is
> +furnished to do so, subject to the following conditions:
> +
> +The above copyright notice and this permission notice shall be included in
> +all copies or substantial portions of the Software.
> +
> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> +THE SOFTWARE.
> diff --git a/recipes-core/openjdk/openjdk-config/openjdk-config.sh b/recipes-core/openjdk/openjdk-config/openjdk-config.sh
> new file mode 100644
> index 0000000..34b49d6
> --- /dev/null
> +++ b/recipes-core/openjdk/openjdk-config/openjdk-config.sh
> @@ -0,0 +1,11 @@
> +JAVA_HOME="@JAVA_HOME@"
> +libdir="@libdir@"
> +
> +for dir in ${libdir}/jvm/*; do
> + if [ -x "${dir}/bin/java" ]; then
> + [ -z "${JAVA_HOME}" ] && JAVA_HOME="${dir}"
> + fi
> +done
> +if [ -n "${JAVA_HOME}" ]; then
> + export JAVA_HOME=${JAVA_HOME}
> +fi
>
next prev parent reply other threads:[~2019-07-22 2:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-21 3:23 [PATCH 1/2] Revert "base-files: Define JAVA_HOME by default" Fang Jia
2019-02-21 3:23 ` [PATCH 2/2] openjdk: add openjdk-config Fang Jia
2019-07-22 2:53 ` Jia, Fang [this message]
2019-02-22 8:52 ` [PATCH 1/2] Revert "base-files: Define JAVA_HOME by default" Richard Leitner
2019-02-25 2:05 ` Jia, Fang
2019-05-30 8:33 ` Jia, Fang
2019-07-19 8:04 ` Richard Leitner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=787bb142-49fb-9108-3307-af1741c48dcf@windriver.com \
--to=fang.jia@windriver.com \
--cc=git@andred.net \
--cc=openembedded-devel@lists.openembedded.org \
--cc=richard.leitner@skidata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox