MacOsX rpmbuild --target noarch doesn't work
Asked Answered
U

3

8

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.

Unguent answered 8/11, 2011 at 14:14 Comment(0)
U
5

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.

Unguent answered 9/11, 2011 at 17:8 Comment(0)
P
6

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.

Phelps answered 8/2, 2014 at 9:59 Comment(0)
U
5

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.

Unguent answered 9/11, 2011 at 17:8 Comment(0)
P
1

I don't have any experience with building on MacOSX but I thought I'd post our pom.xml file here as a reference:

http://pastebin.com/dHVA4yZ1

The maven command line we use under CentOS Linux is:

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 somewhat.

Pawnbroker answered 8/11, 2011 at 14:46 Comment(5)
Thanks, but threre's no problem of plugin - binary tool rpmbuild have strange behavior at '--target' optionUnguent
According to the RPM plugin the default is noarch. What version of rpmbuild are you using? WE're using RPM version 4.4.2. mojo.codehaus.org/rpm-maven-plugin/ident-params.html#needarchPawnbroker
And you are not specifying a source architecture, right? mojo.codehaus.org/rpm-maven-plugin/…Pawnbroker
Current available macport rpm version is 4.4.9, and I use it . As I know, latest version 5.3.x. Yes, I'm not specifying architecture, because I need noarch! At linux works correctly, as result I see *.noarch.rpm file. But only on mac rpmbuild create *.i386.rpm file. I'm try set targetArchitecture as noarch, but it's ignored by builder.Unguent
Sounds like you are doing it all correctly. Sorry to not be of help. This is an interesting thread. They use: `--target 'noarch-apple-mac os x' with * on either side. Good luck. old.nabble.com/…Pawnbroker

© 2022 - 2024 — McMap. All rights reserved.