“- on <arch>” for dump plugin organize

I have a multi-arch snapcraft file with a part that uses the dump plugin. I would need a different organise keyword value depending on the architecture.

This is the relevant section:

plugin: dump
- on armhf: ./ext-lib/rasp-pi
- on amd64: ./ext-lib/amd64
RXTXcomm.jar: ext-lib/RXTXcomm.jar
librxtxSerial.so: usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/librxtxSerial.so

For my armhf architecture the last line should be:

librxtxSerial.so: usr/lib/jvm/java-8-openjdk-armhf/jre/lib/arm/librxtxSerial.so

But I am having trouble finding the correct syntax to do that.
Is it yet supported or any suggestions?

There’s (at least) two ways you could achieve this:

  1. You could organise your ext-lib/* directories with the required target layout - so librxtxSerial.so would be stored in a deep hierarchy mimicing the usr/lib/java-8-openjdk-*/jre/lib/*/ structure
  2. You could write an override-build script to move the file to the required place programmatically