#3 Resolves: rhbz#1809931 Let %xmvn_install store artifacts under /app
Merged 4 years ago by kalev. Opened 4 years ago by sbergmann.
rpms/ sbergmann/flatpak-rpm-macros xmvn  into  master

file modified
+4
@@ -4,6 +4,7 @@ 

  Summary:        Macros for building RPMS for flatpaks

  Source0:        macros.flatpak

  Source1:        distutils.cfg

+ Source2:        flatpak.xml

  License:        MIT

  

  # Buildrequire these to satisfy Pyton byte-compilation hooks
@@ -27,6 +28,8 @@ 

      mkdir -p $RPM_BUILD_ROOT%{_libdir}/python$v/distutils/

      install -t $RPM_BUILD_ROOT%{_libdir}/python$v/distutils/ %{SOURCE1}

  done

+ mkdir -p $RPM_BUILD_ROOT%{_datadir}/xmvn/config.d

+ install -t $RPM_BUILD_ROOT%{_datadir}/xmvn/config.d -m 644 %{SOURCE2}

  

  %files

  # The location in sysconfdir contradicts
@@ -34,6 +37,7 @@ 

  # but I believe is necessary to properly override macros that are otherwise set.

  %{_sysconfdir}/rpm/

  %{_libdir}/python*/distutils/distutils.cfg

+ %{_datadir}/xmvn/config.d/flatpak.xml

  

  %changelog

  * Thu Feb 06 2020 David King <amigadave@amigadave.com> - 29-12

file added
+72
@@ -0,0 +1,72 @@ 

+ <?xml version="1.0" encoding="US-ASCII"?>

+ <configuration xmlns="http://fedorahosted.org/xmvn/CONFIG/2.0.0">

+   <repositories>

+     <!-- Repositories flatpak-jar and flatpak-jni are copies of base-jar and

+          base-jni from /usr/share/xmvn/configuration.xml (javapackages-tools),

+          with "usr" replaced by "app":  -->

+     <repository>

+       <id>flatpak-jar</id>

+       <type>jpp</type>

+       <properties>

+         <root>app/share/java</root>

+       </properties>

+       <filter>

+         <or>

+           <and>

+             <equals>

+               <extension/>

+               <string>jar</string>

+             </equals>

+             <not>

+               <equals>

+                 <property>native</property>

+                 <string>true</string>

+               </equals>

+             </not>

+           </and>

+           <!-- Maybe /app/share/java is not the best place to store

+                ZIP files, but packages are doing so anyways and

+                allowing ZIPs here simplifies packaging.  TODO: find a

+                better location for ZIP files.  -->

+           <equals>

+             <extension/>

+             <string>zip</string>

+           </equals>

+         </or>

+       </filter>

+     </repository>

+     <repository>

+       <id>flatpak-jni</id>

+       <type>jpp</type>

+       <properties>

+         <root>app/lib/java</root>

+       </properties>

+       <filter>

+         <and>

+           <equals>

+             <extension/>

+             <string>jar</string>

+           </equals>

+           <equals>

+             <property>native</property>

+             <string>true</string>

+           </equals>

+         </and>

+       </filter>

+     </repository>

+     <!-- Repository install overrides the repository of the same name from

+          /usr/share/xmvn/configuration.xml (javapackages-tools), prepending the

+          above flatpak-jar and flatpak-jni:  -->

+     <repository>

+       <id>install</id>

+       <type>compound</type>

+       <configuration>

+         <repositories>

+           <repository>flatpak-jar</repository>

+           <repository>flatpak-jni</repository>

+           <repository>base-install</repository>

+         </repositories>

+       </configuration>

+     </repository>

+   </repositories>

+ </configuration>

The included /usr/share/xmvn/config.d/flatpak.xml is an educated guess based on
the documentation at https://fedora-java.github.io/xmvn/configuration.html and
https://fedora-java.github.io/xmvn/config.html. It appears to be enough to
make at least bsh build as part of a flatpak (see
https://bugzilla.redhat.com/show_bug.cgi?id=1809931#c0). Maybe it will turn
out that more base- repositories need to be overridden with flatpak-
repositories, or that there is even a simpler way to tweak the xmvn
configuration.

Nice, thanks for figuring it out!

Can you also add a %changelog entry, please?

Pull-Request has been merged by kalev

4 years ago
Metadata