GithubHelp home page GithubHelp logo

mojohaus / rpm-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW
56.0 21.0 47.0 3.08 MB

Home Page: http://www.mojohaus.org/rpm-maven-plugin/

License: Other

Shell 1.51% Groovy 7.10% Java 91.39%
maven-plugin mojohaus java maven

rpm-maven-plugin's Introduction

MojoHaus RPM Maven Plugin

This is the rpm-maven-plugin.

GitHub CI Maven Central

Releasing

  • Make sure gpg-agent is running.
  • Execute mvn -B release:prepare release:perform

For publishing the site do the following:

cd target/checkout
mvn verify site site:stage scm-publish:publish-scm

rpm-maven-plugin's People

Contributors

adnklauser avatar andham avatar batmat avatar bentmann avatar bokken avatar brianf avatar bsvingen avatar chiknrice avatar dantran avatar dependabot[bot] avatar eagleerwin avatar hboutemy avatar jakub-bochenski avatar jej2003 avatar joschi avatar khmarbaise avatar krosenvold avatar leif81 avatar lpenet avatar mgumbley-resilient avatar minfrin avatar oven avatar rfscholte avatar rickard-von-essen avatar rombert avatar slachiewicz avatar tmz-gaggle avatar trygvis avatar turmio avatar wdpypere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpm-maven-plugin's Issues

MRPM-168 changes default file permissions inside the RPM package

In the default case MRPM-168 will change file permissions and add +w.

When using defaultFilemode or filemode, this behavior is hidden, due to that the file permissions are picked up from the spec file rather than the filesystem.

File permissions should not change from what they get during build without explicitly specifying so.

This is the changeset adding this behavior:
MRPM-168

Does not handle RPM compatible versions with build number

Given a POM version number of 1.0.0-1, I would expect the RPM plugin to produce an RPM with version 1.0.0 and release 1. This is numbering that is perfectly valid both for Maven and RPM.

Instead, it produces an RPM with version 1.0.0 and release 1_1.

Configure parameters for `rpmbuild`

Hello and thanks for your plugin. It has helped me a lot in the last months.

I have a minor problem though: Building larger RPMs take pretty long and I noticed that Checking for unpackaged files is responsible for that. I would like to try to disable this part by adding the nocheck argument to the rpmbuild-call, but there is no way to configure additional parameters in the POM.
I have already added the configuration

<defineStatements>
   <defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
</defineStatements>

but this does not prevent `check-files' from being called.

Could you add an configuration option for CLI arguments that are appended to the rpmbuild-commandline?

RPM Maven Plugin fails when building RPM as primary artifact under Maven 3.3.x

I'm not sure if this is a "bug" or me doing-it-wrong or something else, so apologies in advance if this a waste of folks' time.

We have been using Maven 3.0.5 and rpm-maven-plugin 2.1.5 for several months to successfully create RPM packages. I decided to test using the latest version of Maven (3.3.9 as of this writing) and was surprised to find it fail with the error:

Execution default-version of goal org.codehaus.mojo:rpm-maven-plugin:2.1.5:version failed: Unable to load the mojo 'version' (or one of its required components) from the plugin 'org.codehaus.mojo:rpm-maven-plugin:2.1.5': java.util.NoSuchElementException

After some experimentation and research, I found that this failure happens in any 3.3.x version of Maven, but works for every released version from 3.2.5 on down. It seems that the problem is tied to the fact that we were inheriting from a parent that had both an <extensions>true</extensions> statement in the build and an extensions block defined. With only one or the other present in the effective pom, the build works just fine.

The documentation here implies that just using <extensions>true</extensions> is the correct utilization. So we've modified our setup in kind. However, other examples of usage on non-canonical sites seems to indicate that the extensions block is desirable. And, indeed, a pom with RPM on demand works with both under Maven 3.3x.

If the problem is having both defined, it seems that it might be desirable to have the documentation be more definitive in only using <extensions>true</extensions>. And, if nothing else, I think it would be nice to have a better error if the pom does have both.

How to generate the right filename in .m2?

Here is the issue I have:

<groupId>org.codehaus.mojo.rpm.its</groupId>
<artifactId>MRPM-XXX</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>rpm</packaging>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>rpm-maven-plugin</artifactId>
            <version>2.1.3</version>
            <extensions>true</extensions>
            <configuration>
                <group>Application/Internet</group>
            </configuration>
        </plugin>
    </plugins>
</build>

Running mvn install gives:

[INFO] --- rpm-maven-plugin:2.1.4-SNAPSHOT:rpm (default-rpm) @ MRPM-XXX ---
... Skipping logs
[INFO] Building target platforms: noarch-apple-mac os x
[INFO] Processing files: MRPM-XXX-2.0.0-SNAPSHOT20150908184159.noarch
[INFO] Wrote: /Users/dpilato/Documents/Elasticsearch/dev/3rdparty/rpm-maven-plugin/src/it/MRPM-XXX/target/rpm/MRPM-XXX/RPMS/noarch/MRPM-XXX-2.0.0-SNAPSHOT20150908184159.noarch.rpm
[INFO] 

Perfect. We generated an artifact named: MRPM-XXX-2.0.0-SNAPSHOT20150908184159.noarch.rpm which respects rpm naming convention.

But then the install part:

[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ MRPM-XXX ---
[INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/3rdparty/rpm-maven-plugin/src/it/MRPM-XXX/target/rpm/MRPM-XXX/RPMS/noarch/MRPM-XXX-2.0.0-SNAPSHOT20150908184159.noarch.rpm to /Users/dpilato/.m2/repository/org/codehaus/mojo/rpm/its/MRPM-XXX/2.0.0-SNAPSHOT/MRPM-XXX-2.0.0-SNAPSHOT.rpm
[INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/3rdparty/rpm-maven-plugin/src/it/MRPM-XXX/pom.xml to /Users/dpilato/.m2/repository/org/codehaus/mojo/rpm/its/MRPM-XXX/2.0.0-SNAPSHOT/MRPM-XXX-2.0.0-SNAPSHOT.pom

We can see that the RPM is now installed in .m2 as MRPM-XXX-2.0.0-SNAPSHOT.rpm which does not contain anymore the arch part.

This is caused by the fact that install plugin is relying on artifact coordinates which are:

<artifactId>MRPM-XXX</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>rpm</packaging>

So the finalName seems to be generated as basically ${project.artifactId}-${project.version}.${project.packaging}.

Could it be possible to fix that?

The only workaround I found for now is by hacking the version to be 1.0.0-SNAPSHOT.noarch but I don't think it's the best workaround! :)

Thoughts?

rpm signing broken on osx

The rest of the rpm build process works very well on osx with rpm installed using homebrew but the signing process is broken because expect is different. Compare:

centos-7:~$ echo puts "foo" | expect -c 'sleep 1' -
foo
centos-7:~$
osx:~$ echo puts "foo" | expect -c 'sleep 1' -
osx:~$ 

The issue here is that - doesn't seem to have its traditional "read the from stdin" meaning on OSX when used here. I don't have any clue why. What about moving that sleep into the script itself?

I also noticed while debugging this that the way that some errors weren't being propagated through expect because, I have no idea. Maybe its OSX again. I can't tell. Anyway, all the error handling out with

expect default {"
  lassign [wait] pid spawnid spawnCode value
  if {$spawnCode==0} {exit $value} else {exit -$value}
}

So far as I can tell expect default causes expect to wait for rpm to respond after the last message and then lassign [wait] waits for rpm to finish and sets a bunch of variables. the if bit exits expect with the same return code the rpm used or some negative return code if something went more horribly wrong.

rpm for parameter preremoveScriptlet

Hi,

i am getting an exception:

[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.4:rpm (generate-rpm) on project tifserver: Unable to parse configuration of mojo org.codehaus.mojo:rpm-maven-plugin:2.1.4:rpm for parameter preremoveScriptlet: Cannot find default setter in class org.codehaus.mojo.rpm.Scriptlet -> [Help 1]

I tried to use "" but its not working with version 2.1.3 / 2.1.4 & 2.1.5.
Pls advise what to do or if this is a known error...

Best regards

Marcel

Move mojo parent to github

running mvn site gives:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.4:site (default-cli) on project rpm-maven-plugin: Execution default-cli of goal org.apache.maven.plugins:maven-site-plugin:3.4:site failed: org.apache.maven.reporting.MavenReportException: Could not find resource 'http://svn.codehaus.org/mojo/tags/mojo-parent-34/src/main/config/pmd/mojo_rules.xml'. -> [Help 1]

So I guess you need to update mojo-parent to a more recent version which set mojo_rules.xml to its new URL?

workarea parameter not as documented

According to http://www.mojohaus.org/rpm-maven-plugin/op-params.html#workarea

Beginning with release 2.0-beta-3, sub-directories will be created within the workarea for each execution of the plugin within a life cycle.

I'm using 2.1.4. That is exactly what I'm doing, but the plugin does not behave that way. At least not for the attached-rpm goal.

I have this setup:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>rpm-maven-plugin</artifactId>
    <version>2.1.4</version>
    <executions>
        <execution>
            <id>attach-is-rpm</id>
            <goals>
                <goal>attached-rpm</goal>
            </goals>
            <configuration>
                ... (execution specific configs)
            </configuration>

        </execution>
        <execution>
            <id>attach-rs-rpm</id>
            <goals>
                <goal>attached-rpm</goal>
            </goals>
            <configuration>
                ... (execution specific configs)
            </configuration>
        </execution>

    </executions>
    <configuration>
        ... (common configs)
    </configuration>
</plugin>

Instead, I get this:

[INFO] --- rpm-maven-plugin:2.1.4:attached-rpm (attach-is-rpm) @ MyProj ---
[INFO] Creating directory /myproj/target/checkout/target/rpm/gensms
[INFO] Creating directory /myproj/target/checkout/target/rpm/gensms/BUILD
[INFO] Creating directory /myproj/target/checkout/target/rpm/gensms/RPMS
[INFO] Creating directory /myproj/target/checkout/target/rpm/gensms/SOURCES
[INFO] Creating directory /myproj/target/checkout/target/rpm/gensms/SPECS
[INFO] Creating directory /myproj/target/checkout/target/rpm/gensms/SRPMS
[INFO] Creating directory /myproj/target/checkout/target/rpm/gensms/tmp-buildroot
[INFO] Creating directory /myproj/target/checkout/target/rpm/gensms/buildroot
...
[INFO] --- rpm-maven-plugin:2.1.4:attached-rpm (attach-rs-rpm) @ MyProj ---
[INFO] Directory /myproj/target/checkout/target/rpm/gensms/BUILD already exists. Deleting all contents.
[INFO] Directory /myproj/target/checkout/target/rpm/gensms/RPMS already exists. Deleting all contents.
[INFO] Directory /myproj/target/checkout/target/rpm/gensms/SOURCES already exists. Deleting all contents.
[INFO] Directory /myproj/target/checkout/target/rpm/gensms/SPECS already exists. Deleting all contents.
[INFO] Directory /myproj/target/checkout/target/rpm/gensms/SRPMS already exists. Deleting all contents.
[INFO] Directory /myproj/target/checkout/target/rpm/gensms/tmp-buildroot already exists. Deleting all contents.

Therefore the is-rpm is deleted before anything can be done with it. Instead of using a subdirectory of the workarea for each execution, it's just using the workarea for both executions.

Artifact Question

My Maven projects all include configuration to produce a DEB and an RPM (rpm-maven-plugin, of course). I'm not terribly excited about pouring over the maven docs in as much detail as required to answer this myself, but is there anything special about how the jdeb plugin identifies it's .deb artifact to the maven project? I ask because jdeb associates the package it creates as a formal build artifact. My Jenkins server provides direct link to it alongside the JAR. Is there any configuration that I can include to have this plugin do the same?

Automatic requires

Hi,

It's possible to disable the requires added automatically into the spec file ?
In my directory, I have some batch files (.bash, .csh, .ksh, etc ...).
I specify nothing in my pom.xml and after the rpm creation, the rpm has some requires:

rpm -qpR target/rpm/test/RPMS/x86_64/test.x86_64.rpm
/bin/bash
/bin/bsh
/bin/csh
/bin/ksh
/bin/sh
/bin/sh
/bin/tcsh
...

It's possible to specify all the requires manually ?

Regards,
chocard

Lack of directory quoting

We have the unfortunate scenario where we need to use the Jenkins matrix builder along with some label expressions. Long story short, we end up with workspace directory names that have && in them ๐Ÿ˜ญ.

Most of our plugins can fortunately deal with this, but there is some code that rpm-maven-plugin generates which doesn't properly quote its source:

%install

if [ -d $RPM_BUILD_ROOT ];
then
  mv /home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/tmp-buildroot/* $RPM_BUILD_ROOT
else
  mv /home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/tmp-buildroot $RPM_BUILD_ROOT
fi
chmod -R +w $RPM_BUILD_ROOT

And so we end up with:

[INFO] Building target platforms: noarch-pc-linux
[INFO] Building for target noarch-pc-linux
[INFO] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.jhACBe
[INFO] + umask 022
[INFO] + cd /d/home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/BUILD
[INFO] + [ -d /d/home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/buildroot ]
[INFO] + mv /d/home/tmp/elasticsearch-bad
[INFO] mv: missing destination file operand after '/d/home/tmp/elasticsearch-bad'
[INFO] Try 'mv --help' for more information.
[INFO] + chmod -R +w /d/home/tmp/elasticsearch-bad&&dir/distribution/rpm/target/rpm/elasticsearch/buildroot

And maven-powered branches across the Elasticsearch build farm die.

Attach spec file to project for installation

Hello,

we are using this plugin at Cubic for TNSW Opal project.

It would be really useful to attach the spec file for deployment to the repo classifier -rpm-spec or something like that?

You thoughts?

With keyname set, execution of rpmbuild fails

With keyname set RPMHelper.java will call rpmbuild with some extra arguments for _gpg_name and optionally _gpg_path. However the argument passing seems wrong, causing rpmbuild to complain with:

...
[INFO] error: Macro % has illegal name (%define)
[INFO] error: Macro % has illegal name (%define)
[INFO] error: Macro % has illegal name (%define)
[INFO] error: Macro % has illegal name (%define)
...

This cured my issue:

index fb3bdf5..4f1992e 100644
--- a/src/main/java/org/codehaus/mojo/rpm/RPMHelper.java
+++ b/src/main/java/org/codehaus/mojo/rpm/RPMHelper.java
@@ -127,11 +127,11 @@ final class RPMHelper
         if ( keyname != null && keyPassphrase == null )
         {
             cl.createArg().setValue( "--define" );
-            cl.createArg().setValue( "\"_gpg_name " + keyname + "\"" );
+            cl.createArg().setValue( "_gpg_name " + keyname );
             if ( keypath != null )
             {
                 cl.createArg().setValue( "--define" );
-                cl.createArg().setValue( "\"_gpg_path " + keypath + "\"" );
+                cl.createArg().setValue( "_gpg_path " + keypath );
             }
             cl.createArg().setValue( "--sign" );
         }

(Which is also consistent with the handling of "--define _topdir ..")

Wrong rpmbuild command

Trying to use this plugin, I'm getting a very cryptic build error from rpmbuild which I have no idea how to start to debug:

[INFO] --- rpm-maven-plugin:2.1.5:rpm (build-rpm) @ dist ---
[WARNING] rpm version string truncated to 0.2.2
[INFO] Creating directory /home/wikier/projects/foo/dist/target/rpm/foo
[INFO] Creating directory /home/wikier/projects/foo/dist/target/rpm/foo/BUILD
[INFO] Creating directory /home/wikier/projects/foo/dist/target/rpm/foo/RPMS
[INFO] Creating directory /home/wikier/projects/foo/dist/target/rpm/foo/SOURCES
[INFO] Creating directory /home/wikier/projects/foo/dist/target/rpm/foo/SPECS
[INFO] Creating directory /home/wikier/projects/foo/dist/target/rpm/foo/SRPMS
[INFO] Creating directory /home/wikier/projects/foo/dist/target/rpm/foo/tmp-buildroot
[INFO] Creating directory /home/wikier/projects/foo/dist/target/rpm/foo/buildroot
[INFO] Copying files to /home/wikier/projects/foo/dist/target/rpm/foo/SOURCES
[INFO] Copying files to /home/wikier/projects/foo/dist/target/rpm/foo/tmp-buildroot/usr/share/foo-magic-api
[INFO] Creating spec file /home/wikier/projects/foo/dist/target/rpm/foo/SPECS/foo.spec
[INFO] Building target platforms: noarch-pc-linux
[INFO] Building for target noarch-pc-linux
[INFO] error: Unknown icon type: Icon_foo.png
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.910 s
[INFO] Finished at: 2016-07-06T09:36:45+02:00
[INFO] Final Memory: 41M/1237M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm (build-rpm) on project dist: RPM build execution returned: '1' executing '/bin/sh -c cd '/home/wikier/projects/foo/dist/target/rpm/foo/SPECS' && 'rpmbuild' '-bb' '--target' 'noarch-pc-linux' '--buildroot' '/home/wikier/projects/foo/dist/target/rpm/foo/buildroot' '--define' '_topdir /home/wikier/projects/foo/dist/target/rpm/foo' '--define' '_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' '--define' '_builddir %{_topdir}/BUILD' '--define' '_rpmdir %{_topdir}/RPMS' '--define' '_sourcedir %{_topdir}/SOURCES' '--define' '_specdir %{_topdir}/SPECS' '--define' '_srcrpmdir %{_topdir}/SRPMS' 'foo.spec'' -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

exclude failing with multi mapping

Hi,

I'm Using plugin 2.1.4. (also try other versions)
I found that plugin it's failing to exclude files if I set up 3 different''s mappings.
It always skip exclude form second mapping entry in configuration. I've change order of few times to be sure that's not case with wrong config. Always it's including all jar files into RPM.
exclude */.jar is skipped for directory /${rpm-root}/${comp-name}/${install-path}/etc and included in rpm.

    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>rpm-maven-plugin</artifactId>
                    <version>2.1.1</version>
            <configuration>
                <mappings>
                    <mapping>
                        <directory>/${rpm-root}/${comp-name}/${install-path}/lib</directory>
                        <filemode>775</filemode>
                        <username>root</username>
                        <groupname>root</groupname>
                        <directoryIncluded>false</directoryIncluded> 
                        <sources>
                            <source>
                                <location>src/main/scripts/lib/</location>
                                 <excludes>
                                    <exclude>**/*.jar</exclude>
                                </excludes>
                                <includes>
                                    <include>common.lib</include>
                                    <include>config.lib</include>
                                </includes>
                            </source>
                        </sources>
                    </mapping>
                    <mapping>
                        <directory>/${rpm-root}/${comp-name}/${install-path}/etc</directory>
                        <filemode>775</filemode>
                        <username>root</username>
                        <groupname>root</groupname>
                        <directoryIncluded>false</directoryIncluded> 
                        <sources>
                            <source>
                                <location>src/main/scripts/etc/</location>
                                <excludes>
                          <exclude>**/*.jar</exclude>
                                </excludes>
                                <includes>
                                    <include>config_values</include>
                                    <include>version_info</include>
                                </includes>

                            </source>
                        </sources>
                    </mapping>
                    <mapping>
                        <directory>/${rpm-root}/${comp-name}/${install-path}/bin</directory>
                        <filemode>775</filemode>
                        <username>root</username>
                        <groupname>root</groupname>
                        <directoryIncluded>false</directoryIncluded> 
                        <sources>
                            <source>
                                <location>src/main/scripts/</location>
                                <includes>
                                    <include>config.bsh</include>

                                </includes>
                                <excludes>
                                    <exclude>**/*.jar</exclude>
                                </excludes>
                            </source>
                            <source>
                                <location>src/main/python/</location>
                                <includes>
                                    <include>Audit.py</include>
                                    <include>Utils.py</include>
                                </includes>
                                <excludes>
                                    <exclude>**/*.pyc</exclude>
                                    <exclude>README.txt</exclude>
                                </excludes>
                            </source>
                        </sources>
                    </mapping>
                 </mappings>
                </configuration>

Does someone got similar issue with multi mapping?

rpm signing is broken with gpg-agent 2.1

Problem Description

We have spotted Jenkins build failures when signing RPM packages on systems with gpg-agent 2.1+ (i.e. Fedora 22 and Fedora 23). Here is the relevant part of the build output:

[INFO] spawn rpm --define _gpg_name 16E55242 --define _gpg_path /tmp/shortGpg --addsign elasticsearch-2.3.0-SNAPSHOT20160314103051.noarch.rpm
[INFO] elasticsearch-2.3.0-SNAPSHOT20160314103051.noarch.rpm:
[INFO] gpg: WARNING: unsafe permissions on homedir '/tmp/shortGpg'
[INFO] gpg: starting migration from earlier GnuPG versions
[INFO] gpg: porting secret keys from '/tmp/shortGpg/secring.gpg' to gpg-agent
[INFO] gpg: key 16E55242: secret key imported
[INFO] gpg: migration succeeded
[INFO] gpg: signing failed: Line passed to IPC too long
[INFO] gpg: signing failed: Line passed to IPC too long
[INFO] error: gpg exec failed (2)
[WARNING] send: spawn id exp5 not open
[WARNING]     while executing
[WARNING] "send -- "dummy
[WARNING] ""

(for all details, please see the build logs).

If I run this command manually on Fedora 22:

rpm --define "_gpg_name 16E55242" --define "_gpg_path /tmp/shortGpg" --addsign elasticsearch-2.3.0-SNAPSHOT20160314103051.noarch.rpm

I can see an ncurses-based password prompt. gpg provides a helper program called pinentry to change the appearance of the password prompt but only ncurses, QT and GTK are supported. So with pinentry it is not possible to get the old password prompt.

However, we can add two config options:

gpg-agent.conf:

allow-loopback-pinentry

gpg.conf:

pinentry-mode loopback

Now we're at least able to get the password prompt again. However, RPMSigner expects the output "Pass phrase is good." which is not shown anymore in newer gpg-agent versions (in gpg-agent version 2.1+, the invoking rpm command exits either with exit code 0 on success or a non-zero exit code if the password was incorrect).

Environment information

# Fedora 21 (working):
[vagrant@localhost]$ gpg-agent --version
gpg-agent (GnuPG) 2.0.29
libgcrypt 1.6.3

# Fedora 22 (broken):
[vagrant@localhost ~]$ gpg-agent --version
gpg-agent (GnuPG) 2.1.9
libgcrypt 1.6.3

Tested with rpm-maven-plugin version 2.1.3 and 2.1.5.

I think it boils down to modifying the expect script in RPMSigner but I don't see an easy option to support multiple versions of gpg. Another option seems to be to use gpg-preset-passphrase to set the passphrase in gpg-agent before it is used.

System or user modifications to rpm path macros break the plugin

If a /etc/rpm/macros or ~/.rpmmacros adjust path macros like _builddir, _rpmdir, _sourcedir, _specdir, _srcrpmdir, or _build_name_fmt, the plugin fails as it expects the generated packages to be in the default locations.

The plugin sets _topdir. It should similarly set the other path macros so that it can be sure where the packages will be created. (Alternately, rpm --eval could be used to check the paths, but that's a much bigger change with dubious benefits.)

I've created a patch to set the necessary --define options. I'm not familiar with the testing methods here, so if anyone could lend a hand on what I may need to do in that regard, I would appreciate it.

2.1.4 -> 2.1.5 changes spec file from a included directory to list of files.

When updating from 2.1.4 to 2.1.5 the generated spec file becomes different for one of my projects.

Instead of including the source directory (as in 2.1.4), it creates a list of the files inside the directory.
This causes issues, since that means that the RPM no longer owns the root directory, only the files inside.

I have tried to create a simple test case for reproducing this, but strangely my minimal pom is working fine.

For my broken project, I managed to get the directory included again by enabling:
<recurseDirectories>true</recurseDirectories>
But if I do that, I get both the directory and a list of all files in my spec file.
The build log will also complain about warning: File listed twice

I see that some code regarding creation of spec files has been changed in 2.1.5 but I can't figure out what is happening in my case.

Checking for unpackaged file(s) takes too long

With version 2.1.5 of the plugin I'm packaging an RPM file which (for now) contains just a large jar file - 81 MB.

With this configuration the 'checking for unpackaged file(s)' step takes around 30 seconds, which is way too much IMO since the build root only contains that file.

<filemode> affects directories

<mapping>
    <directory>/etc/init.d</directory>
    <username>root</username>
    <groupname>root</groupname>
    <filemode>700</filemode>
    <sources>
        <source>
            <location>${project.basedir}/src/rpm/data/etc/init.d</location>
        </source>
    </sources>
</mapping>

2.1-alpha-2 behaviour: /etc/init.d/myservice has 700 permissions, /etc/init.d has 700 permissions
Expected behaviour: /etc/init.d/myservice has 700 permissions, /etc/init.d has default permissions (<defaultDirmode>)

Rationale: <defaultFilemode> affects only files, not directories, so <filemode> should affect only files, not directories.

Improve spec creation time for large RPM with lots of files

I am using rpm-m-p to package a large nodejs/UI with lots of files. To keep things simple, A single staging directory is created and passed to rpm-m-p as a single map. However, the spec writer takes a long time scanning for large number of files which is not necessary. At my build, it may be 10+ minutes.

Unable to use macros in mapping/directory

Hi,

If I define my rpm like this :

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.1.5</version>
        <configuration>
          <defineStatements>
            <defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
            <defineStatement>myappsysconf %_sysconfdir/my-app</defineStatement>
          </defineStatements>
          <mappings>
            <mapping>
              <configuration>noreplace</configuration>
              <directory>%{myappsysconf}/conf.d/</directory>
              <filemode>440</filemode>
              <sources>
                <source>
                  <location>src/main/resources/test.conf</location>
                </source>
              </sources>
            </mapping>
          </mappings>
        </configuration>
      </plugin>

And I have this error :

[INFO] --- rpm-maven-plugin:2.1.5:attached-rpm (attach-rpm) @ my-app ---
[WARNING] rpm version string truncated to 1.0.0
[INFO] Creating directory <...>/target/rpm/my-app
[INFO] Creating directory <...>/target/rpm/my-app/BUILD
[INFO] Creating directory <...>/target/rpm/my-app/RPMS
[INFO] Creating directory <...>/target/rpm/my-app/SOURCES
[INFO] Creating directory <...>/target/rpm/my-app/SPECS
[INFO] Creating directory <...>/target/rpm/my-app/SRPMS
[INFO] Creating directory <...>/target/rpm/my-app/tmp-buildroot
[INFO] Creating directory <...>/target/rpm/my-app/buildroot
[INFO] Copying files to <...>/target/rpm/my-app/tmp-buildroot/%_sysconfdir/my-app/conf.d
[INFO] Creating spec file <...>/target/rpm/my-app/SPECS/my-app.spec
[INFO] Construction pour plate-formes cibles: noarch-redhat-linux
[INFO] Construction pour cible noarch-redhat-linux
[INFO] Exรฉcution_de(%install)ย : /bin/sh -e /var/tmp/rpm-tmp.4YrAHs
[INFO] + umask 022
[INFO] + cd <...>/target/rpm/my-app/BUILD
[INFO] + '[' <...>/target/rpm/my-app/buildroot '!=' / ']'
[INFO] + rm -rf <...>/target/rpm/my-app/buildroot
[INFO] ++ dirname <...>/target/rpm/my-app/buildroot
[INFO] + mkdir -p <...>/target/rpm/my-app
[INFO] + mkdir <...>/target/rpm/my-app/buildroot
[INFO] + '[' -d <...>/target/rpm/my-app/buildroot ']'
[INFO] + mv <...>/target/rpm/my-app/tmp-buildroot/%_sysconfdir <...>/target/rpm/my-app/buildroot
[INFO] + /usr/lib/rpm/check-buildroot
[INFO] + /usr/lib/rpm/redhat/brp-compress
[INFO] + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
[INFO] + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
[INFO] + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
[INFO] + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
[INFO] + /usr/lib/rpm/redhat/brp-python-hardlink
[INFO] Traitement des fichiersย : my-app-1.0.0-SNAPSHOT20160803141244.noarch
[INFO] 
[INFO] 
[INFO] Erreur de construction de RPMย :
[INFO] erreurย : Rรฉpertoire introuvableย : <...>/target/rpm/my-app/buildroot/etc/my-app/conf.d
[INFO]     Rรฉpertoire introuvableย : <...>/target/rpm/my-app/buildroot/etc/my-app/conf.d

Is there a way to handle this configuration ?

mapping properties have inconsistent behavior

Original Ticket: #8

Currently there are 4 default parameters:
defaultFilemode, defaultDirmode, defaultUsername, defaultGroupname

However there are 3 overrideable parameters:
filemode, username, groupname

The use of filemode is inconsistent and prone to causing issues.

Example:

When I am building an rpm for an application I am setting most files as 444 permissions and the directory as 555. However if I override this with filemode then this will also alter the directory permission to become that as well which is an undesirable behavior. filemode should not override defaultDirmode. This should be overridden by 'dirmode' property on a per mapping basis.

including dependency includes from jitpack are not working

Description

Hi,

in a rpm project (https://github.com/adriens/schemacrawler-rpm) i need to include a jar that comes from jitpack (as it has no been release on maven central).
I can do this with jdeb (for the debian package with jdeb), unfortunately i cannot manage to do the same with rpm-maven-plugin.

For now, i get the following stack while trying to build the rpm :

[INFO] 
[INFO] --- rpm-maven-plugin:2.1.5:rpm (generate-rpm) @ schemacrawler-rpm ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.504 s
[INFO] Finished at: 2016-04-14T09:50:30+11:00
[INFO] Final Memory: 18M/326M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm (generate-rpm) on project schemacrawler-rpm: A type incompatibility occured while executing org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm: org.codehaus.mojo.rpm.Dependency cannot be cast to org.codehaus.mojo.rpm.Source
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.mojo:rpm-maven-plugin:2.1.5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/salad74/.m2/repository/org/codehaus/mojo/rpm-maven-plugin/2.1.5/rpm-maven-plugin-2.1.5.jar
[ERROR] urls[1] = file:/home/salad74/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
[ERROR] urls[2] = file:/home/salad74/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
[ERROR] urls[3] = file:/home/salad74/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
[ERROR] urls[4] = file:/home/salad74/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
[ERROR] urls[5] = file:/home/salad74/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[ERROR] urls[6] = file:/home/salad74/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
[ERROR] urls[7] = file:/home/salad74/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[8] = file:/home/salad74/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[9] = file:/home/salad74/.m2/repository/org/apache/maven/shared/maven-filtering/1.3/maven-filtering-1.3.jar
[ERROR] urls[10] = file:/home/salad74/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.6/maven-shared-utils-0.6.jar
[ERROR] urls[11] = file:/home/salad74/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[12] = file:/home/salad74/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[13] = file:/home/salad74/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.jar
[ERROR] urls[14] = file:/home/salad74/.m2/repository/org/codehaus/plexus/plexus-archiver/3.0.3/plexus-archiver-3.0.3.jar
[ERROR] urls[15] = file:/home/salad74/.m2/repository/org/codehaus/plexus/plexus-io/2.7/plexus-io-2.7.jar
[ERROR] urls[16] = file:/home/salad74/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar
[ERROR] urls[17] = file:/home/salad74/.m2/repository/org/apache/commons/commons-compress/1.10/commons-compress-1.10.jar
[ERROR] urls[18] = file:/home/salad74/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[19] = file:/home/salad74/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[20] = file:/home/salad74/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[21] = file:/home/salad74/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Steps to reproduce

Add the jitpack repo :

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

Add the dependency, in my case :

        <!-- Additional lints dependency -->
        <dependency>
        <groupId>com.github.mbarre</groupId>
        <artifactId>schemacrawler-additionnallints</artifactId>
        <version>${schemacrawler-additionnallints.version}</version>
    </dependency>

At this stage, the build is working fine... then comes the interesting part, the mapping section :

<mapping>
                            <directory>/opt/schemacrawler-${project.version}/additional-lints</directory>
                            <sources>
                                <source>
                                    <location>src/main/resources/ADDITIONAL-LINTS.HOWTO.txt</location>
                                </source>
                                <source>
                                    <location>src/main/resources/ADDITIONAL-LINTS.LICENSE.txt</location>
                                </source>
                                <source>
                                    <location>src/main/resources/ADDITIONAL-LINTS.README.md</location>
                                </source>
                                <!-- This jitpack dependency causes the build to fail -->
                                <dependency>
                                    <includes>
                                        <include>com.github.mbarre:schemacrawler-additionnallints</include>
                                    </includes>
                                </dependency>
                            </sources>
                        </mapping>

... then the build fails :

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.358 s
[INFO] Finished at: 2016-04-14T09:51:49+11:00
[INFO] Final Memory: 18M/323M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm (generate-rpm) on project schemacrawler-rpm: A type incompatibility occured while executing org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm: org.codehaus.mojo.rpm.Dependency cannot be cast to org.codehaus.mojo.rpm.Source

mappings not additive bewteen execution based config and plugin based config

Mavin plugin configurations can be defined at both the execution and plugin level. These are supposed to be and usually are additive between configurations defined in an execution and configurations defined in a plugin. That is the configuration of a plugin as it executes an execution is to add the configuration defined in the execution to that defined in the plugin. I believe that an execution-defined configuration would overwrite a plugin-defined configuration of the same name.

This presents a problem with mappings elements. The rpm-maven-plugin's mapping configurations follow this rule exactly, with unfortunate consequences. Suppose you want to run two executions of the plugin, each producing different rpms. Further suppose that some of the files are common between the two executions and others are not. You might want to define some mappings in the plugin configuration (the common files) and others in the execution configurations (the execution-specific mappings). This doesn't work. Instead the execution-specific mappings override the plugin-specified mappings which are simply not included in the rpm. Thus, in such a pom, the common mappings must be redundantly repeated in each execution.

It would be nicer if there was a mechanism whereby the two levels of mappings could be combined.

Jenkins can't execute RPM goals

Hello,

I am trying to execute your plugin in my Jenkins server. There is a option where I can set goals up and I have written the next command line in my Jenkins configuration [Build -> Goals and options]:

rpm:rpm -group "Development/Tools" -name "example" -projversion "1" -releaseProperty "1" -versionProperty "1"

The error I am getting back is:

Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.4:rpm (default-cli) on project myProject: The parameters 'group' for goal org.codehaus.mojo:rpm-maven-plugin:2.1.4:rpm are missing or invalid ->

image

Could You help me? I am not sure if those parameters (group, name, projversion...) should be written in that textbox or in my pom.xml.

Thank you

Cannot override directory file mode when they are set with defaultDirmode

If I provide a defaultDirmode then I cannot override the directory file mode in a mapping (i.e. it always gets the defaultDirmode). Overriding the defaultUsername and defaultGroupname work for a directory, but even if the mapping is for the directory only, the installed directory gets the defaultDirmode and not what I set as filemode in the mapping. I ran into this issue in the last week using the latest rpm plugin. I think that it's a plugin issue and not an RPM issue, but I'm not sure.

This issue combined with #33 and the fact that I have a lot of directories that I'm installing is a big pain and makes using the plugin very clunky. I had to choose between having all directories with the same permission or specify a mapping for each directory, which is a rather silly choice to have to make. I ended up needing to chmod some directories in my postinstall to get the permissions that I wanted, which is an anti-pattern.

Making a change so that I can override defaultDirmode or providing a dirmode option on mappings as discussed in #33 (better yet both!) would make life a lot easier.

Regression in 2.1.x: Bad exit status from /tmp/rpm-tmp.* (%install)

Hi,

when updating this example to use the rpm-maven-plugin version 2.1.5 (besides changing the version from 2.0.1 to 2.1.5 this only requires setting <sourceEncoding>UTF-8</sourceEncoding>) I encounter the following error (under OS X):

[INFO] --- rpm-maven-plugin:2.1.5:rpm (default) @ rpm-package ---
[WARNING] rpm version string truncated to 0.0.1
[INFO] Creating directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package
[INFO] Creating directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/BUILD
[INFO] Creating directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/RPMS
[INFO] Creating directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/SOURCES
[INFO] Creating directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package    /SPECS
[INFO] Creating directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/SRPMS
[INFO] Creating directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot
[INFO] Creating directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/buildroot
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/lib
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/lib
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/lib
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/lib
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/lib
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/lib
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/lib
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/lib
[INFO] Copying files to /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/conf
[INFO] Creating empty directory /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/opt/app/logs
[INFO] Creating spec file /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/SPECS/rpm-package.spec
[INFO] Building target platforms: noarch-apple-mac os x
[INFO] Executing(%install): %{__spec_install_cmd} /tmp/rpm-tmp.95530
[INFO] error: Bad exit status from /tmp/rpm-tmp.95530 (%install)
[INFO] 
[INFO] 
[INFO]     Bad exit status from /tmp/rpm-tmp.95530 (%install)
[INFO] RPM build errors:

The rpm-tmp.95530 mentioned in the error message looks like this:

%{__spec_install_template}/bin/rm -rf '/private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/buildroot'
/bin/mkdir -p '/private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/buildroot'


if [ -d $RPM_BUILD_ROOT ];
then
  mv /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot/* $RPM_BUILD_ROOT
else
  mv /private/tmp/Maven-Recipe--RPM-Package/target/rpm/rpm-package/tmp-buildroot $RPM_BUILD_ROOT
fi

%{__spec_install_post}

FYI, I tested all versions since 2.1.x; they all exhibit this issue.

Hope this helps in narrowing down the problem.

2.1.4: mapping configuration=true broken

It seems that in the last version of the plugin (2.1-alpha1) configuration=true for mapping definition is not properly handled anymore. In the past, it was setting the noreplace flag for the file in the RPM but this is no longer the case. As a result, a RPM generated with this version of the plugin is overwriting local modifications with the vanilla file provided by the RPM.

Parameter obsoletes implies provides

When adding the obsoletes parameter an equal provides parameter will be added.

This makes it impossible to create a package like this:
provides myCurrentPackage ${version}
provides myObsoletedPackage ${version}
obsoletes myObsoletedPacakage < x.y.z

Because the result will be:
provides myCurrentPackage ${version}
provides myObsoletedPackage ${version}
provides myObsoletedPacakage < x.y.z
obsoletes myObsoletedPacakage < x.y.z

In other words, my package will now provide the same thing that it is obsoleting, making it impossible to use the older versions of myObsoletedPackage.

The code for this can be found in AbstractRPMMojo.java

// if this package obsoletes any packages, make sure those packages are added to the provides list
        if ( obsoletes != null )
        {
            if ( provides == null )
            {
                provides = obsoletes;
            }
            else
            {
                provides.addAll( obsoletes );
            }
        }

My guess is that the code above should be removed and that 'provides' should be added manually.

Here is a minimal pom to reproduce the issue:

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>collection.trash</groupId>
  <artifactId>landfill</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.1.4</version>
        <executions>
          <execution>
            <id>generate-rpm</id>
            <goals>
              <goal>rpm</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <group>Application/Collectors</group>
          <obsoletes>
            <obsolete>test &lt; 3.2.1 </obsolete>
          </obsoletes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Segfault error

I started receiving a segfault error after upgrading my xcode from 6.3.1 to 6.4. Is this a known issue?

I am installing RPM via brew and here are my configs:

./configure --prefix=/usr/local/Cellar/rpm/5.4.14 --localstatedir=/usr/local/var --with-path-cfg=/usr/local/etc/rpm --with-path-magic=/usr/local/share/misc/magic --with-extra-path-macros=/usr/local/Cellar/rpm/5.4.14/lib/rpm/macros.* --with-libiconv-prefix=/usr --disable-openmp --disabl

My GCC version is at .53:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.4.0
Thread model: posix

This is working for all of my coworkers whom are on xcode 6.3.1, and when I upgraded to xcode 6.4, this issue started occuring:

[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.2:rpm (default) on project domains-rg-listeners-core: RPM build execution returned: '139' executing '/bin/sh -c cd '/Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/SPECS' && 'rpmbuild' '-bb' '--target' 'noarch-apple-linux' '--buildroot' '/Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/buildroot' '--define' '_topdir /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1' 'domains-rg-listeners-core-7b2e1.spec'' -> [Help 1]
[WARNING] + umask 022
[WARNING] + cd /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/BUILD
[WARNING] + /bin/rm -rf /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/buildroot
[WARNING] + /bin/mkdir -p /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/buildroot
[WARNING] + '[' -d /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/buildroot ']'
[WARNING] + mv /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/tmp-buildroot/data /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/tmp-buildroot/var /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/buildroot
[WARNING] + chmod -R +w /Users/bcampbell/Documents/domains-rg-api/listeners/core/target/rpm/domains-rg-listeners-core-7b2e1/buildroot
[WARNING] + exit 0

build fails when passphrase tag is present but parameter is not provided

OS: Ubuntu 14.04.3
plugin version: 2.1.5

Description:
The plugin is written and sign tags are added. If we try to run plugin without keyname, keyfile but with passphrase it succeeds. And if we try to run the plugin without passphrase parameter it fails with following exception:

[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.5:attached-rpm (generate-rpm) on project datatorrent-rts: Unable to parse configuration of mojo org.codehaus.mojo:rpm-maven-plugin:2.1.5:attached-rpm for parameter passphrase: Cannot set 'passphrase' in class org.codehaus.mojo.rpm.Passphrase: [C cannot be cast to [Ljava.lang.Object; -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.5:attached-rpm (generate-rpm) on project datatorrent-rts: Unable to parse configuration of mojo org.codehaus.mojo:rpm-maven-plugin:2.1.5:attached-rpm for parameter passphrase: Cannot set 'passphrase' in class org.codehaus.mojo.rpm.Passphrase
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:220)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginConfigurationException: Unable to parse configuration of mojo org.codehaus.mojo:rpm-maven-plugin:2.1.5:attached-rpm for parameter passphrase: Cannot set 'passphrase' in class org.codehaus.mojo.rpm.Passphrase
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:605)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:537)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:119)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot set 'passphrase' in class org.codehaus.mojo.rpm.Passphrase
    at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.java:247)
    at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:101)
    at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:57)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty(CompositeBeanHelper.java:273)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.java:210)
    at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:101)
    at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:32)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:575)
    ... 22 more
Caused by: java.lang.ClassCastException: [C cannot be cast to [Ljava.lang.Object;
    at org.codehaus.plexus.component.configurator.converters.composite.ArrayConverter.fromConfiguration(ArrayConverter.java:68)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty(CompositeBeanHelper.java:273)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.java:210)
    ... 29 more

Why is it not possible to set dirmode on individual mappings?

(moved from original misposting on mojohaus parent).

I would like to build an rpm where one directory has a different dirmode than the default. This option is not available, whereas , , and are available on the mapping level.
Why the difference?

By the way, this issue has been floating around since 2010:

http://mojo.10943.n7.nabble.com/rpm-maven-plugin-is-there-any-way-to-specify-the-dirmode-other-than-the-defaultDirmode-attribute-td37839.html

Cannot exclude a certain directory entries.

I want to exclude specific directories from being included to rpm like /usr/sbin, /usr/lib, /etc/init.d, /var/lib, /var/log, /var (not it's contents though) this is critical since centos7 won't let you install rpm without doing that. Also I don't want to exclude other directories which are specific to my project (critical for empty dirs).
So directoryIncluded=false works bad for me.

Excluding directories with seems not working. Once I add something to exclude it just stops listing directories at all

Here is my definition:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.1.5</version>
        <executions>
          <execution>
            <!-- unbinds rpm creation from maven lifecycle -->
            <phase>none</phase>
            <goals>
              <goal>rpm</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <copyright>2012, Apache Software Foundation</copyright>
          <group>Development</group>
          <description>Maven Recipe: RPM Package.</description>
          <requires>
            <require>${rpm.dependency.list}</require>
          </requires>
          <postinstallScriptlet>
            <scriptFile>src/main/package/rpm/postinstall.sh</scriptFile>
            <fileEncoding>utf-8</fileEncoding>
          </postinstallScriptlet>
          <preinstallScriptlet>
            <scriptFile>src/main/package/rpm/preinstall.sh</scriptFile>
            <fileEncoding>utf-8</fileEncoding>
          </preinstallScriptlet>
          <preremoveScriptlet>
            <scriptFile>src/main/package/rpm/preremove.sh</scriptFile>
            <fileEncoding>utf-8</fileEncoding>
          </preremoveScriptlet>
          <posttransScriptlet>
            <scriptFile>src/main/package/rpm/posttrans_agent.sh</scriptFile>
            <fileEncoding>utf-8</fileEncoding>
          </posttransScriptlet>

          <needarch>x86_64</needarch>
          <autoRequires>false</autoRequires>
          <mappings>
            <mapping>
              <directory>/</directory>
              <sources>
                <source>
                  <location>${project.build.directory}${dirsep}${project.artifactId}-${project.version}</location>
                </source>
              </sources>
            </mapping>
          </mappings>
        </configuration>
      </plugin>

Here is the rpm files list I get:

/etc
/etc/ambari-agent
/etc/ambari-agent/conf
/etc/ambari-agent/conf/ambari-agent.ini
/etc/ambari-agent/conf/logging.conf.sample
/etc/init
/etc/init.d
/etc/init.d/ambari-agent
/etc/init/ambari-agent.conf
/usr
/usr/lib
/usr/lib/ambari-agent
/usr/lib/ambari-agent/lib
/usr/lib/ambari-agent/lib/ambari_commons
/usr/lib/ambari-agent/lib/ambari_commons/__init__.py

This results in problems while installing the package on centos7:

Transaction check error:
  file /usr/lib from install of ambari-server-2.4.0.0-141.x86_64 conflicts with file from package filesystem-3.2-18.el7.x86_64
  file /usr/sbin from install of ambari-server-2.4.0.0-141.x86_64 conflicts with file from package filesystem-3.2-18.el7.x86_64

Files copied to buildroot do not preserve symlinks

We have a number of files checked into an SVN repository that contain symbolic links to x86_64 binaries. We are trying to package up these symbolic links as part of the package but the symbolic links are replaced with the actual contents of the files with the name of the symbolic link.

The CI biuld is done through Jenkins and I've confirmed the files are checked out of SVN as symbolic links, however, during the copy to tmp-buildroot, it appears the symbolic links are lost in this process.

[INFO] Copying files to /home/jenkins/jenkins/workspace/test/target/rpm/test/tmp-buildroot/opt/test

I can't find any information on this topic and whether or not there is an option to preserve symbolic links except for the parameter, but I don't want to recreate the symbolic links through configuration, I would like to package them as-is.

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.1.4</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>attach-rpm</id>
            <goals>
              <goal>attached-rpm</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <group>Applications/Engineering</group>
          <needarch>x86_64</needarch>
          <targeOS>Linux</targeOS>

          <defineStatements>
            <defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
          </defineStatements>

          <mappings>
            <mapping>
              <directory>/opt/test/</directory>
              <configuration>false</configuration>
              <username>user</username>
              <groupname>user</groupname>

              <sources>
                <source>
                  <location>test/</location>
                  <noDefaultExcludes>true</noDefaultExcludes>
                  <targetArchitecture>x86_64</targetArchitecture>
                  <targetOSName>linux</targetOSName>
                </source>
              </sources>

            </mapping>
          </mappings>
        </configuration>
      </plugin>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.