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 via email to