mojohaus / rpm-maven-plugin

http://www.mojohaus.org/rpm-maven-plugin/
Other
56 stars 48 forks source link

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

Open sewe opened 8 years ago

sewe commented 8 years ago

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.

rickard-von-essen commented 8 years ago

And which version does work?

sewe commented 8 years ago

And which version does work?

Version 2.0.1, the version the example mentioned uses originally, works (after setting %_tmppath in ~/.rpmmacros, which seems to be an unrelated OS-X-specific problem).

dantran commented 8 years ago

just want to confirm %_tmppath must be set under ~/.rpmmaros so that the provided example works with rpm-m-p 2.0.1. However, the does not work with 2.0.1+?

sewe commented 8 years ago

just want to confirm %_tmppath must be set under ~/.rpmmaros so that the provided example works with rpm-m-p 2.0.1. However, the does not work with 2.0.1+?

Yes, under Mac OS X (using the rpm54 port from MacPorts) I have to have this ~/.rpmmacros file:

%_tmppath     /tmp

With this setting, the linked example work using rpm-maven-plugin 2.0.1, but fails with 2.1, 2.1.1, etc. showing the above error message. FYI:

> rpmbuild --version
rpmbuild (RPM) 5.4.15
dantran commented 8 years ago

sounds like RPM version compatibility. Will you be able to reproduce it under Linux?

sewe commented 8 years ago

sounds like RPM version compatibility. Will you be able to reproduce it under Linux?

Just tried it under CentOS 6.7 (my target system) with the bundled rpmbuild:

> rpmbuild --version
rpmbuild (RPM) 4.8.0

That worked fine. Alas, CentOS is only my build target; I need to build the RPM under OS X and Debian Jessie, with the rpmbuild versions available there.

I hence did some further experiments:

Based on this, this may be either an OS X or rpmbuild 5.x incompatibility.

dantran commented 8 years ago

do you install macos rpm with this http://timperrett.com/2014/03/23/enabling-rpmbuild-on-mac-osx/ ?

sewe commented 8 years ago

No, I am using MacPorts rather than Homebrow

sudo port install rpm

and

sudo port install rpm54

See here for the versions of rpm (includes rpmbuild) included in MacPorts.