Skip to content

Commit

Permalink
Liberica pre automation script and v21
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshastri committed Dec 30, 2023
1 parent bcb8c87 commit 5214ddc
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 47 deletions.
20 changes: 20 additions & 0 deletions liberica-21-jdk/liberica21jdk.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>liberica21jdk</id>
<version>21.0.1</version>
<packageSourceUrl>https://github.com/johanjanssen/ChocolateyPackages/tree/master/LibericaJDK</packageSourceUrl>
<title>Liberica JDK</title>
<authors>BellSoft</authors>
<owners>JohanJanssen</owners>
<licenseUrl>https://github.com/bell-sw/Liberica/blob/master/LICENSE</licenseUrl>
<projectUrl>https://bell-sw.com/</projectUrl>
<docsUrl>https://bell-sw.com/</docsUrl>
<mailingListUrl>https://bell-sw.com/</mailingListUrl>
<bugTrackerUrl>https://github.com/bell-sw/Liberica/issues</bugTrackerUrl>
<projectSourceUrl>https://github.com/bell-sw/Liberica</projectSourceUrl>
<tags>liberica java jvm</tags>
<summary>Liberica is an open source Java Development Kit provided by BellSoft</summary>
<description>Liberica is an open source Java Development Kit provided by BellSoft</description>
</metadata>
</package>
10 changes: 10 additions & 0 deletions liberica-21-jdk/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$packageArgs = @{
PackageName = $env:ChocolateyPackageName
Url64bit = 'https://github.com/bell-sw/Liberica/releases/download/21.0.1%2B12/bellsoft-jdk21.0.1%2B12-windows-amd64.msi'
Checksum64 = '9aaacba8fa2abb0e0d01b9c743cc9e2076141513'
ChecksumType64 = 'sha1'
fileType = 'msi'
silentArgs = "INSTALLLEVEL=3 /quiet"
}

Install-ChocolateyPackage @packageArgs
20 changes: 20 additions & 0 deletions liberica-21-jdkfull/liberica21jdkfull.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>liberica21jdkfull</id>
<version>21.0.1</version>
<packageSourceUrl>https://github.com/johanjanssen/ChocolateyPackages/tree/master/LibericaJDKFull</packageSourceUrl>
<title>Liberica JDK full includes LibericaFX and Minimal VM</title>
<authors>BellSoft</authors>
<owners>JohanJanssen</owners>
<licenseUrl>https://github.com/bell-sw/Liberica/blob/master/LICENSE</licenseUrl>
<projectUrl>https://bell-sw.com/</projectUrl>
<docsUrl>https://bell-sw.com/</docsUrl>
<mailingListUrl>https://bell-sw.com/</mailingListUrl>
<bugTrackerUrl>https://github.com/bell-sw/Liberica/issues</bugTrackerUrl>
<projectSourceUrl>https://github.com/bell-sw/Liberica</projectSourceUrl>
<tags>liberica java jvm</tags>
<summary>Liberica is an open source Java Development Kit provided by BellSoft</summary>
<description>Liberica is an open source Java Development Kit provided by BellSoft</description>
</metadata>
</package>
10 changes: 10 additions & 0 deletions liberica-21-jdkfull/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$packageArgs = @{
PackageName = $env:ChocolateyPackageName
Url64bit = 'https://github.com/bell-sw/Liberica/releases/download/21.0.1%2B12/bellsoft-jdk21.0.1%2B12-windows-amd64-full.msi'
Checksum64 = '67f8fd9254c8d2b2ed811c285b21fba183e1a7c5'
ChecksumType64 = 'sha1'
fileType = 'msi'
silentArgs = "INSTALLLEVEL=3 /quiet"
}

Install-ChocolateyPackage @packageArgs
20 changes: 20 additions & 0 deletions liberica-21-jdklite/liberica21jdklite.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>liberica21jdklite</id>
<version>21.0.1</version>
<packageSourceUrl>https://github.com/johanjanssen/ChocolateyPackages/tree/master/LibericaJDKLite</packageSourceUrl>
<title>Liberica JDK lite modules are compressed without the javafx modules </title>
<authors>BellSoft</authors>
<owners>JohanJanssen</owners>
<licenseUrl>https://github.com/bell-sw/Liberica/blob/master/LICENSE</licenseUrl>
<projectUrl>https://bell-sw.com/</projectUrl>
<docsUrl>https://bell-sw.com/</docsUrl>
<mailingListUrl>https://bell-sw.com/</mailingListUrl>
<bugTrackerUrl>https://github.com/bell-sw/Liberica/issues</bugTrackerUrl>
<projectSourceUrl>https://github.com/bell-sw/Liberica</projectSourceUrl>
<tags>liberica java jvm</tags>
<summary>Liberica is an open source Java Development Kit provided by BellSoft</summary>
<description>Liberica is an open source Java Development Kit provided by BellSoft</description>
</metadata>
</package>
10 changes: 10 additions & 0 deletions liberica-21-jdklite/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$packageArgs = @{
PackageName = $env:ChocolateyPackageName
Url64bit = 'https://github.com/bell-sw/Liberica/releases/download/21.0.1%2B12/bellsoft-jdk21.0.1%2B12-windows-amd64-lite.msi'
Checksum64 = '79e3176819f3f51dd1f175583f294e3637b8521e'
ChecksumType64 = 'sha1'
fileType = 'msi'
silentArgs = "INSTALLLEVEL=3 /quiet"
}

Install-ChocolateyPackage @packageArgs
20 changes: 20 additions & 0 deletions liberica-21-jre/liberica21jre.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>liberica21jre</id>
<version>21.0.1</version>
<packageSourceUrl>https://github.com/johanjanssen/ChocolateyPackages/tree/master/LibericaJRE</packageSourceUrl>
<title>Liberica JRE</title>
<authors>BellSoft</authors>
<owners>JohanJanssen</owners>
<licenseUrl>https://github.com/bell-sw/Liberica/blob/master/LICENSE</licenseUrl>
<projectUrl>https://bell-sw.com/</projectUrl>
<docsUrl>https://bell-sw.com/</docsUrl>
<mailingListUrl>https://bell-sw.com/</mailingListUrl>
<bugTrackerUrl>https://github.com/bell-sw/Liberica/issues</bugTrackerUrl>
<projectSourceUrl>https://github.com/bell-sw/Liberica</projectSourceUrl>
<tags>liberica java jvm</tags>
<summary>Liberica is an open source Java Development Kit provided by BellSoft</summary>
<description>Liberica is an open source Java Development Kit provided by BellSoft</description>
</metadata>
</package>
10 changes: 10 additions & 0 deletions liberica-21-jre/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$packageArgs = @{
PackageName = $env:ChocolateyPackageName
Url64bit = 'https://github.com/bell-sw/Liberica/releases/download/21.0.1%2B12/bellsoft-jre21.0.1%2B12-windows-amd64.msi'
Checksum64 = '21baff2f27429143773a973b3ecabb3c79cb5add'
ChecksumType64 = 'sha1'
fileType = 'msi'
silentArgs = "INSTALLLEVEL=3 /quiet"
}

Install-ChocolateyPackage @packageArgs
20 changes: 20 additions & 0 deletions liberica-21-jrefull/liberica21jrefull.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>liberica21jrefull</id>
<version>21.0.1</version>
<packageSourceUrl>https://github.com/johanjanssen/ChocolateyPackages/tree/master/LibericaJREFull</packageSourceUrl>
<title>Liberica JRE full includes LibericaFX and Minimal VM</title>
<authors>BellSoft</authors>
<owners>JohanJanssen</owners>
<licenseUrl>https://github.com/bell-sw/Liberica/blob/master/LICENSE</licenseUrl>
<projectUrl>https://bell-sw.com/</projectUrl>
<docsUrl>https://bell-sw.com/</docsUrl>
<mailingListUrl>https://bell-sw.com/</mailingListUrl>
<bugTrackerUrl>https://github.com/bell-sw/Liberica/issues</bugTrackerUrl>
<projectSourceUrl>https://github.com/bell-sw/Liberica</projectSourceUrl>
<tags>liberica java jvm</tags>
<summary>Liberica is an open source Java Development Kit provided by BellSoft</summary>
<description>Liberica is an open source Java Development Kit provided by BellSoft</description>
</metadata>
</package>
10 changes: 10 additions & 0 deletions liberica-21-jrefull/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$packageArgs = @{
PackageName = $env:ChocolateyPackageName
Url64bit = 'https://github.com/bell-sw/Liberica/releases/download/21.0.1%2B12/bellsoft-jre21.0.1%2B12-windows-amd64-full.msi'
Checksum64 = 'd08dadbf22ceffb6f1dee37a2e6d3cff15fa0e08'
ChecksumType64 = 'sha1'
fileType = 'msi'
silentArgs = "INSTALLLEVEL=3 /quiet"
}

Install-ChocolateyPackage @packageArgs
83 changes: 36 additions & 47 deletions scripts/liberica-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,54 @@ function dljdkfileinfofull() {
curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jdks?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[] | select(.filename | contains ("full"))';
}

function dljdkfileinfofull() {
URL=$(curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jdks?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[] | select(.filename | contains ("full")) | .links.pkg_info_uri');
curl -s -L -X 'GET' $URL;
}

function dljdkfileinfolite() {
URL=$(curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jdks?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[] | select(.filename | contains ("lite")) | .links.pkg_info_uri');
curl -s -L -X 'GET' $URL;
curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jdks?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[] | select(.filename | contains ("lite"))';
}

function dljdkfileinforeg() {
URL=$(curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jdks?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[] | select(.filename | contains ("full") | not) | select(.filename | contains ("lite") | not) | .links.pkg_info_uri')
curl -s -L -X 'GET' $URL;
curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jdks?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[] | select(.filename | contains ("full") | not) | select(.filename | contains ("lite") | not)';
}

function dljrefileinfo() {
URL=$(curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jres?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[].links.pkg_info_uri')
curl -s -L -X 'GET' $URL ;
curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jres?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[] | select(.filename | contains ("full") | not) | select(.filename | contains ("lite") | not)';
}

function dljrefileinfofull() {
curl -s -L -X 'GET' "https://api.foojay.io/disco/v3.0/packages/jres?version=${1}&distribution=${2}&architecture=amd64&archive_type=msi&operating_system=windows&latest=available" -H 'accept: application/json' | jq -r '.result[] | select(.filename | contains ("full"))';
}


JVERSION=11
JAVATYPE=jdkfull
# Liberica regular
DLDEETS=$(dljdkfileinfofull 11 liberica)
VERSIONNEW=$(echo $DLDEETS | jq -r '.java_version' | tr '+' '.')
JAVADEETS=$(curl -s -L -X 'GET' $(echo $DLDEETS | jq -r '.links.pkg_info_uri'))
JAVAFILE=$(echo $JAVADEETS | jq -r .result[].filename)
CHECKSUMTYPE=$(echo $JAVADEETS | jq -r .result[].checksum_type)
DLURL=$(echo $JAVADEETS | jq -r ".result[].direct_download_uri")
LIBERFOLDNAME=liberica-${JAVATYPE}-${JVERSION}
if [[ "$CHECKSUMTYPE" != "sha256" ]]
then
curl -L -o ${JAVAFILE} $(echo $JAVADEETS | jq -r .result[].direct_download_uri)
SHA256NEW=$(sha256sum ${JAVAFILE} | awk '{print $1}')
rm -f ${JAVAFILE}
else
SHA256FILEURL=$(echo $JAVADEETS | jq -r .result[].checksum_uri)
SHA256NEW=$(curl -s -L $SHA256FILEURL | awk '{print $1}')
fi

SHA256ORIG=$(grep -i checksum64 ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1 | awk -F\' '{print $2}')
VERSIONORIG=$(grep -i -o -P '(?<=<version>).*(?=</version>)' ${LIBERFOLDNAME}/liberica${JVERSION}${JAVATYPE}.nuspec)
URLORIG=$(grep -i "\$url64" ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1 | head -1 | awk -F\' '{print $2}')

if [[ "$SHA256NEW" != "$SHA256ORIG" ]]
then
# COMMITYES=TRUE
echo "$SHA256NEW is not the same as $SHA256ORIG for $VERSIONNEW"
sed -i "s@$SHA256ORIG@$SHA256NEW@g" ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1
sed -i "s@$VERSIONORIG@$VERSIONNEW@g" ${LIBERFOLDNAME}/liberica${JVERSION}${JAVATYPE}.nuspec
sed -i "s@$URLORIG@$DLURL@g" ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1
if [[ "$ZBAREVERSION" == "17" ]]
# Liberica regular full
DLDEETS=$(dljdkfileinfofull $JVERSION liberica)
VERSIONNEW=$(echo $DLDEETS | jq -r '.java_version' | tr '+' '.')
JAVADEETS=$(curl -s -L -X 'GET' $(echo $DLDEETS | jq -r '.links.pkg_info_uri'))
JAVAFILE=$(echo $JAVADEETS | jq -r .result[].filename)
CHECKSUMTYPE=$(echo $JAVADEETS | jq -r .result[].checksum_type)
DLURL=$(echo $JAVADEETS | jq -r ".result[].direct_download_uri")
LIBERFOLDNAME=liberica-${JVERSION}-${JAVATYPE}

SHA1NEW=$(echo $JAVADEETS | jq -r .result[].checksum)

SHA1ORIG=$(grep -i checksum64 ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1 | awk -F\' '{print $2}')
VERSIONORIG=$(grep -i -o -P '(?<=<version>).*(?=</version>)' ${LIBERFOLDNAME}/liberica${JVERSION}${JAVATYPE}.nuspec)
URLORIG=$(grep -i "url64" ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1 | head -1 | awk -F\' '{print $2}')

if [[ "$SHA1NEW" != "$SHA1ORIG" ]]
then
sed -i "s@$SHA256ORIG@$SHA256NEW@g" ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1
sed -i "s@$VERSIONORIG@$VERSIONNEW@g" ${LIBERFOLDNAME}/liberica.nuspec
# COMMITYES=TRUE
echo "$SHA1NEW is not the same as $SHA1ORIG for $VERSIONNEW"
sed -i "s@$SHA1ORIG@$SHA1NEW@g" ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1
sed -i "s@$VERSIONORIG@$VERSIONNEW@g" ${LIBERFOLDNAME}/liberica${JVERSION}${JAVATYPE}.nuspec
sed -i "s@$URLORIG@$DLURL@g" ${LIBERFOLDNAME}/tools/chocolateyinstall.ps1
if [[ "$JVERSION" == "21" ]]
then
sed -i "s@$SHA1ORIG@$SHA1NEW@g" liberica-${JAVATYPE}/tools/chocolateyinstall.ps1
sed -i "s@$VERSIONORIG@$VERSIONNEW@g" liberica-${JAVATYPE}/liberica.nuspec
sed -i "s@$URLORIG@$DLURL@g" liberica-${JAVATYPE}/tools/chocolateyinstall.ps1
fi
echo "Latest file of ${JVERSION} is ${JAVAFILE} with SHA1NEW $SHA1NEW for $VERSIONNEW"
MAILVAL=true
fi
echo "Latest file of ${JVERSION} is ${JAVAFILE} with SHA256NEW $SHA256NEW for $VERSIONNEW"
MAILVAL=true
fi
done

0 comments on commit 5214ddc

Please sign in to comment.