Bug 1809931

Summary: %mvn_install does not honour %_prefix
Product: [Fedora] Fedora Reporter: Stephan Bergmann <sbergman>
Component: flatpak-rpm-macrosAssignee: Stephan Bergmann <sbergman>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: amigadave, ascheel, java-sig-commits, klember, mat.booth, mizdebsk, msrb, otaylor, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-20 00:16:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Stephan Bergmann 2020-03-04 08:49:41 UTC
Description of problem:

I discovered this when trying to do a flatpak build of LibreOffice following the instructions at <https://docs.fedoraproject.org/en-US/flatpak/>.  One component that needs to be rebuilt with %_prefix set to /app (instead of the usual /usr) is bsh, which uses %mvn_install (see <https://src.fedoraproject.org/rpms/bsh/blob/f31/f/bsh.spec>).

However, the spec file line

  %mvn_install -J javadoc

there apparently creates %{buildroot}/usr/share/java/bsh.jar (and records that in .mfiles) rather than %{buildroot}/app/share/java/bsh.jar, even if %_prefix is /app.


Version-Release number of selected component (if applicable):

$ rpm -qf /usr/lib/rpm/macros.d/macros.fjava
javapackages-local-5.3.0-6.fc31.noarch

Comment 1 Mikolaj Izdebski 2020-03-04 09:22:09 UTC
Value of _prefix macro is expanded during build of javapackages-tools and stored in configuration files (incl. /usr/share/xmvn/configuration.xml). Then these configuration files affect runtime of javapackages-tools and XMvn.
The recommended way to work with different prefix is to build javapackages-tools with desired prefix macro.
Another way is to provide custom configuration files for XMvn: https://fedora-java.github.io/xmvn/configuration.html

Comment 2 Stephan Bergmann 2020-03-18 09:03:59 UTC
(In reply to Mikolaj Izdebski from comment #1)
> Another way is to provide custom configuration files for XMvn:
> https://fedora-java.github.io/xmvn/configuration.html

See <https://src.fedoraproject.org/rpms/flatpak-rpm-macros/pull-request/3> "Resolves: rhbz#1809931 Let %xmvn_install store artifacts under /app".

Comment 3 Fedora Update System 2020-03-18 20:39:07 UTC
FEDORA-FLATPAK-2020-bbf5eaefb5 has been submitted as an update to Fedora 31 Flatpaks. https://bodhi.fedoraproject.org/updates/FEDORA-FLATPAK-2020-bbf5eaefb5

Comment 4 Fedora Update System 2020-03-19 02:28:50 UTC
flatpak-runtime-f31-3120200318190325.1, flatpak-sdk-f31-3120200318190325.1 has been pushed to the Fedora 31 Flatpaks testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-FLATPAK-2020-bbf5eaefb5

Comment 5 Fedora Update System 2020-03-20 00:16:31 UTC
flatpak-runtime-f31-3120200318190325.1, flatpak-sdk-f31-3120200318190325.1 has been pushed to the Fedora 31 Flatpaks stable repository. If problems still persist, please make note of it in this bug report.