Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't pass in --buildarch #5

Open
kennzors opened this issue Mar 21, 2016 · 1 comment
Open

Can't pass in --buildarch #5

kennzors opened this issue Mar 21, 2016 · 1 comment

Comments

@kennzors
Copy link

Example cpan2rpm:

cpan2rpm --no-sign --no-depchk --buildarch=x86_64 Nginx::HTTP

from the output:

RPM: /root/rpmbuild/RPMS/noarch/perl-Nginx-HTTP-0.03-1.noarch.rpm
SRPM: /root/rpmbuild/SRPMS/perl-Nginx-HTTP-0.03-1.src.rpm

It appears that cpan2rpm disregards the buildarch argument.
I was able to make a quick fix by omitting the code where it checks to see if the eval directory has any .xs or .c files. $info->{'buildarch'} already has "noarch" if the tarball doesn't contain any .xs or .c files, or if no argument is specified in buildarch:

 429     # kennzors: buildarch is already set to noarch or specified by --buildarch
 430     #else {
 431     #    my $xs = 0;
 432     #    find(sub { $xs = 1 if /\.(xs|c)$/i }, $info->{evaldir});
 433     #    $info->{buildarch} = "noarch" if $xs == 0;
 434     #    }
@ekkis
Copy link
Owner

ekkis commented Apr 13, 2016

if the package has no .xs or .c files then it should be "noarch", except if explicitly given an architecture, so I'm reluctant to just comment out the above code but perhaps else if (!$info->{buildarch}) { would be the ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants