You are not logged in.
Pages: 1
I want to create a new package and upload it to AUR.
Here's PKGBUILD
pkgname=cloud-explorer
pkgver=1
pkgrel=1
pkgdesc="S3 cloudExplorer"
arch=('any')
url='https://github.com/rusher81572/cloudExplorer'
depends=('java-environment')
source=('https://cloudexplorer.s3.amazonaws.com/11/cloudExplorer-11.zip')
md5sums=(SKIP)
package() {
cd $srcdir
mkdir -p $pkgdir/opt/cloud-explorer
cp -r lib $pkgdir/opt/cloud-explorer
cp -r CloudExplorer.jar $pkgdir/opt/cloud-explorer
}
I have 2 issues:
- The package requires java at least version 10. How to I specify those
- I want to create /usr/bin/cloud-explorer bin file with content :
/usr/lib/jvm/java-11-openjdk/bin/java -jar /opt/cloud-explorer/CloudExplorer.jar
How do I get rid of hardcoded path to java? User can use different java version, and java 11 couldn't be installed, but java 10 could be. If I just specify `java -jar ...` it would fail if first java in PATH in versioned below 10.
Last edited by deathangle908 (2019-02-12 15:12:05)
Offline
You can depend on 'java-environment>=10' to guarantee that at least one version of java that is new enough is installed. You can also add to your wrapper script, a check for "archlinux-java get" and provide an appropriate error message if the result does not match e.g. java-11-openjdk. I'm not sure what the convention for oracle java is, but the official repos only have java-10-openjdk and java-11-openjdk that match your requirement, so you could match on:
case $(archlinux-java get) in
java-1*-openjdk) ;;
*) echo "please set the default java to at least java 10"; exit 1;;
esac
Last edited by eschwartz (2019-02-12 19:12:39)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
You can depend on 'java-environment>=10' to guarantee that at least one version of java that is new enough is installed. You can also add to your wrapper script, a check for "archlinux-java get" and provide an appropriate error message if the result does not match e.g. java-11-openjdk. I'm not sure what the convention for oracle java is, but the official repos only have java-10-openjdk and java-11-openjdk that match your requirement, so you could match on:
case $(archlinux-java get) in java-1*-openjdk) ;; *) echo "please set the default java to at least java 10"; exit 1;; esac
Is it possible to get path of java bin of specific version without forsing user to set it as default.
: archlinux-java --help
archlinux-java <COMMAND>
COMMAND:
status List installed Java environments and enabled one
get Return the short name of the Java environment set as default
set <JAVA_ENV> Force <JAVA_ENV> as default
unset Unset current default Java environment
fix Fix an invalid/broken default Java environment configuration
I would want something like:
javaExecutable=$($(pacman -Ql $((archlinux-java status |grep java-1) |awk 'NR==1 {print; exit}')) |grep java$)
But unfortunately I don't know how to get java executable from archlinux-java, or at least package name.
Last edited by deathangle908 (2019-02-14 09:22:44)
Offline
Pages: 1