MacOSX rpmbuild --target noarch not working

I have a java project with rpm by maven building. It is required to create noarch packages, but I see a specific arch. I install rpm (4.4.9 or 5.2.0) via macports on MacOsX and run the command from the maven rpm module:

  sudo rpmbuild -bb -v --buildroot / path / to / project / buildroot --target noarch java-search-qt.spec
 Building target platforms: noarch
 Executing (% install): / bin / bash -e /tmp/rpm-tmp.69257
 + umask 022
 + cd / opt / local / src / macports / BUILD
 + / bin / rm -rf / path / to / project / target / rpm / project / buildroot
 + / bin / rm -rf / path / to / project / target / rpm / project / buildroot
 + '[' -e / path / to / project / target / rpm / project / buildroot ']'
 + mv / path / to / project / target / rpm / project / tmp-buildroot / path / to / project / target / rpm / project / buildroot
 + / opt / local / lib / rpm / brp-compress
 + / opt / local / lib / rpm / brp-strip
 + / opt / local / lib / rpm / brp-strip-static-archive
 + / opt / local / lib / rpm / brp-strip-comment-note
 + / opt / local / lib / rpm / brp-nobuildrootpath
 Processing files: java-search-qt-1.0.17-1
 Finding Provides: / opt / local / lib / rpm / find-provides
 Finding Requires: / opt / local / lib / rpm / find-requires
 Requires (interp): / bin / bash / bin / bash / bin / bash / bin / bash
 Requires (verify): / bin / bash
 Requires (pre): / bin / bash
 Requires (post): / bin / bash
 Requires (postun): / bin / bash
 Checking for unpackaged file (s): / opt / local / lib / rpm / check-files / path / to / project / target / rpm / project / buildroot
 Wrote: /opt/local/src/macports/RPMS/i386/project.i386.rpm

The use case for the Maven plugin is "--target noarch", but rpmbuild completely ignores it. Expected file noarch.rpm, why rpmbuild creates i386 in version 4.4.9 and x86?

Update

I found one working version of the rpmbuilder call, building the * .noarch.rpm file:

  rpmbuild -bb --target noarch-linux-pc project.spec 

Other options, build * .i386.rpm file:

  rpmbuild -bb --buildroot / path / to / buildroot --target noarch-linux-pc project.spec
 rpmbuild -bb --define '_topdir / path / to / topdir' --target noarch-linux-pc project.spec

I can not understand. Any ideas?

PS Sorry for my English, it's a difficult language for me.

+6
source share
3 answers

I found a mistake!

The maven-rpm-plugin tool sucks. This package contains the RPMHelper class and uses the bash command constructor. The rpmbuild tool requires strong parameterization, and this class ignores all the rules. I changed the order of the parameters, and now I have built the rpm package correctly. From what I see, the codehaus team no longer supports. I think we need a fork on github.

+5
source

I have different versions of everything, but on OS X, using RPM 5.4.14 and rpm-maven-plugin 2.1-alpha-3, I can create a noarch RPM for Linux by specifying:

<needarch>noarch</needarch> <targetOS>linux</targetOS> 

rpm-maven-plugin says:

 [INFO] Building target platforms: noarch-apple-linux 

From the command line, checking the package, everything looks good:

 rpm -qp --qf 'Arch:%{ARCH} OS:%{OS}\n' my-rpm-0.0.1-1.noarch.rpm Arch:noarch OS:linux 

... and the result succeeds on Linux.

+5
source

I have no experience with MacOSX, but I thought I would put our pom.xml file here as a link:

http://pastebin.com/dHVA4yZ1

The maven command line we use on CentOS Linux:

 mvn clean compile rpm:attached-rpm deploy 

This deploys our RPMs and also creates:

 target/rpm/mprew-behavior/RPMS/noarch/mprew-behavior-2.12.0s-19068.noarch.rpm 

Hope this helps.

+1
source

Source: https://habr.com/ru/post/901026/


All Articles