Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacOsX rpmbuild --target noarch doesn't work

Tags:

java

rpmbuild

I have java project with building rpm by maven. Required create noarch packets, but i see concrete arch. I install rpm(4.4.9 or 5.2.0) via macports at MacOsX, and run command from maven rpm plugin:

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

Maven plugin use option "--target noarch", but rpmbuild fully ignore it's. Expected noarch.rpm file, why rpmbuild create i386 at 4.4.9 version and x86?

Update

I found one working variant of call rpmbuilder, builds *.noarch.rpm file:

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

Another variants, 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't understand. Any ideas?

P.S. Sorry for my english, it's difficult language for me.

like image 712
mitallast Avatar asked Nov 08 '11 14:11

mitallast


2 Answers

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, all looks well:

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

... and the result installs happily on Linux.

like image 173
PaoloC Avatar answered Sep 28 '22 08:09

PaoloC


I found the mistake!

The maven-rpm-plugin tool sucks. This package contains class RPMHelper, and uses bash command builder. The rpmbuild tool requires strong param ordering, and this class ignore all rules. I changed param ordering, and now I have correctly builded rpm packet. From what I see, codehaus command is no longer support. I think that need we need a fork on github.

like image 32
mitallast Avatar answered Sep 28 '22 06:09

mitallast