RPM Maven Plugin not using defined prefix

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RPM Maven Plugin not using defined prefix

DJViking
Using the RPM Maven plugin I have found which I'm not sure is, bugs, missing features or wrong configuration.

Setting prefix is useless. I cannot use the defined RPM macros in mapping locations.
%_prefix /usr
%_exec_prefix %{_prefix}
%_bindir %{_exec_prefix}/bin

If I use the RPM macro %{_bindir} the plugin will use /usr as prefix, regardless of what I have defined as prefix.
I have even tried adding a defined statement setting the value of _prefix. As you can see from the maven output it creates the tmp-buildroot under /usr and not /opt/company and thus fails because it cannot find anything under /buildroot/opt/company.

My configuration
<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.1-alpha-2</version>
        <configuration>
               
                <defineStatements>
                        <defineStatement>_apacheconf %{_sysconfdir}/apache2/conf.d</defineStatement>
                        <defineStatement>_prefix /opt/company</defineStatement>
                </defineStatements>

                <summary>My App Summary</summary>
                <version>${project.version}</version>
                <vendor>Company AS</vendor>
                <group>Productivity/Scientific/Astronomy</group>
                <url>http://www.company.com/</url>
                <packager>${user.name}</packager>
                <prefix>/opt/company</prefix>
                <needarch>noarch</needarch>
                <changelogFile>ChangeLog</changelogFile>

                <requires>
                        <require>jdk</require>
                </requires>
        </configuration>
        <executions>
                <execution>
                        <id>gui</id>
                        <goals>
                                <goal>attached-rpm</goal>
                        </goals>
                        <configuration>
                                <name>${project.artifactId}</name>

                                <mappings>
                                        <mapping>
                                                <directory>%{_bindir}</directory>
                                                <filemode>-</filemode>
                                                <username>root</username>
                                                <groupname>root</groupname>
                                                <sources>
                                                        <source>
                                                                <location>src/main/scripts/MyApp.sh</location>
                                                        </source>
                                                </sources>
                                        </mapping>
                                </mappings>
                        </configuration>
                </execution>
        </executions>
</plugin>

Maven output
[INFO] --- rpm-maven-plugin:2.1-alpha-2:attached-rpm (gui) @ myApp ---
[WARNING] rpm version string truncated to 2.4.0
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/BUILD
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/RPMS
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/SOURCES
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/SPECS
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/SRPMS
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/tmp-buildroot
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/buildroot
[INFO] Copying files to /home/user/workspace/myApp/target/rpm/myApp/tmp-buildroot/usr/bin
[INFO] Creating spec file /home/user/workspace/myApp/target/rpm/myApp/SPECS/myApp.spec
[INFO] Building target platforms: noarch-suse-linux
[INFO] Building target noarch-suse-linux
[INFO] Running(%install): /bin/sh -e /var/tmp/rpm-tmp.oIwFvD
[WARNING] + umask 022
[WARNING] + cd /home/user/workspace/myApp/target/rpm/myApp/BUILD
[WARNING] + '[' -e /home/user/workspace/myApp/target/rpm/myApp/buildroot ']'
[WARNING] + mv /home/user/workspace/myApp/target/rpm/myApp/tmp-buildroot/opt /home/user/workspace/myApp/target/rpm/myApp/tmp-buildroot/usr /home/user/workspace/myApp/target/rpm/myApp/buildroot
[WARNING] + /usr/lib/rpm/brp-compress
[WARNING] + /usr/lib/rpm/brp-suse
[INFO] Processing files: myApp-2.4.0-SNAPSHOT20130314121500.noarch
[WARNING] error: File not found: /home/user/workspace/myApp/target/rpm/myApp/buildroot/opt/company/bin
[INFO] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/user/workspace/myApp/target/rpm/myApp/buildroot
[WARNING] error: Installed (but unpackaged) file(s) found:
[INFO]
[WARNING]    /usr/bin/MyApp.sh
[INFO]
[WARNING]     File not found: /home/user/workspace/myApp/target/rpm/myApp/buildroot/opt/company/bin
Reply | Threaded
Open this post in threaded view
|

Re: RPM Maven Plugin not using defined prefix

Anders Hammar
I can't help much, but just want to let you know that the development effort on this plugin is currently very low. I did the last release but I'm far from an RPM expert and have just stepped in to do the release, not much further development. So if you have any problems, please file tickets. But don't expect much to happen unless you provide work on your end (i.e. patches and performing tests).

/Anders


On Thu, Mar 14, 2013 at 1:23 PM, DJViking <[hidden email]> wrote:
Using the RPM Maven plugin I have found which I'm not sure is, bugs, missing
features or wrong configuration.

Setting prefix is useless. I cannot use the defined RPM macros in mapping
locations.
%_prefix                /usr
%_exec_prefix   %{_prefix}
%_bindir                %{_exec_prefix}/bin

If I use the RPM macro %{_bindir} the plugin will use /usr as prefix,
regardless of what I have defined as prefix.
I have even tried adding a defined statement setting the value of _prefix.
As you can see from the maven output it creates the tmp-buildroot under /usr
and not /opt/company and thus fails because it cannot find anything under
/buildroot/opt/company.

*My configuration*
<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.1-alpha-2</version>
        <configuration>

                <defineStatements>
                        <defineStatement>_apacheconf
%{_sysconfdir}/apache2/conf.d</defineStatement>
                        <defineStatement>_prefix /opt/company</defineStatement>
                </defineStatements>

                <summary>My App Summary</summary>
                <version>${project.version}</version>
                <vendor>Company AS</vendor>
                <group>Productivity/Scientific/Astronomy</group>
                <url>http://www.company.com/</url>
                <packager>${user.name}</packager>
                <prefix>/opt/company</prefix>
                <needarch>noarch</needarch>
                <changelogFile>ChangeLog</changelogFile>

                <requires>
                        <require>jdk</require>
                </requires>
        </configuration>
        <executions>
                <execution>
                        <id>gui</id>
                        <goals>
                                <goal>attached-rpm</goal>
                        </goals>
                        <configuration>
                                <name>${project.artifactId}</name>

                                <mappings>
                                        <mapping>
                                                <directory>%{_bindir}</directory>
                                                <filemode>-</filemode>
                                                <username>root</username>
                                                <groupname>root</groupname>
                                                <sources>
                                                        <source>
                                                                <location>src/main/scripts/MyApp.sh</location>
                                                        </source>
                                                </sources>
                                        </mapping>
                                </mappings>
                        </configuration>
                </execution>
        </executions>
</plugin>

*Maven output*
[INFO] --- rpm-maven-plugin:2.1-alpha-2:attached-rpm (gui) @ myApp ---
[WARNING] rpm version string truncated to 2.4.0
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/BUILD
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/RPMS
[INFO] Creating directory
/home/user/workspace/myApp/target/rpm/myApp/SOURCES
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/SPECS
[INFO] Creating directory /home/user/workspace/myApp/target/rpm/myApp/SRPMS
[INFO] Creating directory
/home/user/workspace/myApp/target/rpm/myApp/tmp-buildroot
[INFO] Creating directory
/home/user/workspace/myApp/target/rpm/myApp/buildroot
[INFO] Copying files to
/home/user/workspace/myApp/target/rpm/myApp/tmp-buildroot/usr/bin
[INFO] Creating spec file
/home/user/workspace/myApp/target/rpm/myApp/SPECS/myApp.spec
[INFO] Building target platforms: noarch-suse-linux
[INFO] Building target noarch-suse-linux
[INFO] Running(%install): /bin/sh -e /var/tmp/rpm-tmp.oIwFvD
[WARNING] + umask 022
[WARNING] + cd /home/user/workspace/myApp/target/rpm/myApp/BUILD
[WARNING] + '[' -e /home/user/workspace/myApp/target/rpm/myApp/buildroot ']'
[WARNING] + mv /home/user/workspace/myApp/target/rpm/myApp/tmp-buildroot/opt
/home/user/workspace/myApp/target/rpm/myApp/tmp-buildroot/usr
/home/user/workspace/myApp/target/rpm/myApp/buildroot
[WARNING] + /usr/lib/rpm/brp-compress
[WARNING] + /usr/lib/rpm/brp-suse
[INFO] Processing files: myApp-2.4.0-SNAPSHOT20130314121500.noarch
[WARNING] error: File not found:
/home/user/workspace/myApp/target/rpm/myApp/buildroot/opt/company/bin
[INFO] Checking for unpackaged file(s): /usr/lib/rpm/check-files
/home/user/workspace/myApp/target/rpm/myApp/buildroot
[WARNING] error: Installed (but unpackaged) file(s) found:
[INFO]
[WARNING]    /usr/bin/MyApp.sh
[INFO]
[WARNING]     File not found:
/home/user/workspace/myApp/target/rpm/myApp/buildroot/opt/company/bin



--
View this message in context: http://mojo.10943.n7.nabble.com/RPM-Maven-Plugin-not-using-defined-prefix-tp39187.html
Sent from the User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: RPM Maven Plugin not using defined prefix

DJViking
This post was updated on .
That is a pity. While RPM is perhaps not the primary installation package for Java applications this plugin should not be put to pasture. Is it just that no one wants to maintain this plugin, or it is just that too few are using it?

From the plugin web page there are only 2 members and 1 contributor.
Members, Bob Allison (creator), Brett Okken
Contributor Kaare Nilsen.

I have never worked on plugin development. Perhaps I will check it out on a later time.
Reply | Threaded
Open this post in threaded view
|

Re: RPM Maven Plugin not using defined prefix

Wayne Fay
> Is it just that no one wants to maintain this plugin, or it is just
> that too few are using it?

Probably a little of both. If you are inspired to help (simply being a
user of the plugin and wanting to see some things improved may be
sufficient inspiration), please consider this an invitation to do so!

Wayne

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email