I have been given a Bunch of Files to install on our Linux systems by
a vendor who would rather gnaw off his own fingers than part with the
source code. I have a tar file, and I have been assured the files are
good, and even if they aren't, that's someone else's problem.
Actually, I have been given *two* bunches of files. One for use on 32-
bits systems, and one for use on 64-bit systems. We wish to install
these files, as-is, in a subdirectory of /opt, from an RPM package. So
go go rpmbuild. This is the spec file we use:
---8<---cut-here----------------------
#-------------------------------------------------------------------------
#
#
# UNIX AUTOMATION RPMBUILD SPEC FILE
#
# - To build: rpmbuild -bb <filename>
#
#-------------------------------------------------------------------------
#
%define _topdir /export/build/v3/%{name}/%{version}
Name : MYpackage
Version : 1.0.3.0
Release : 0
License : The strictest of licenses
Group : A fine group of people
Summary : The Package That Does Nothing
Packager : Menno (Flexor) Willemse <fle...@wanadoo.nl>
Autoreqprov : no
Buildroot : /export/build/v3/%{name}/%{version}/root
Buildarch : i386
Requires : bash
%description
This is an example package to test.
%changelog
%post
service package start
chkconfig package on
%preun
service package stop
chkconfig package off
#-------------------------------------------------------------------------
#
%files
/usr/share/doc/MYpackage-1.0.3.0/README
---8<---cut-here----------------------
Obviously, I'd add more files to the %files section. Now for building
packages, we have a nice shiny 64-bit virtual machine (Architecture is
x86_64). So if I do the build there with buildarch set to i386, as
shown above, I get the following message:
error: No compatible architectures found for build
I have tried many things to get rid of that message, including
actually setting the architecture of the machine to i386, but nothing
so far has helped. I'm about to give up and stick the number of bits
in the version number, which is hideous and perverse, but will bloody
well work. Is there any other way I can assure rpmbuild that the
architecture *is* compatible don't worry?
Thanks in advance,
Menno Willemse
> Buildroot : /export/build/v3/%{name}/%{version}/root
> Buildarch : i386
> Requires : bash
> Obviously, I'd add more files to the %files section. Now for building
> packages, we have a nice shiny 64-bit virtual machine (Architecture is
> x86_64). So if I do the build there with buildarch set to i386, as
> shown above, I get the following message:
>
> error: No compatible architectures found for build
>
> I have tried many things to get rid of that message, including
> actually setting the architecture of the machine to i386, but nothing
> so far has helped. I'm about to give up and stick the number of bits
> in the version number, which is hideous and perverse, but will bloody
> well work. Is there any other way I can assure rpmbuild that the
> architecture *is* compatible don't worry?
If you want it to install on multiple architectures, just get rid of
the "Buildarch" line. You don't *have* to have it. Use a script in the
install part to determine the architecture, then install the 64- or 32-
bit executables.
Hmm. That's a good idea, actually. Package both versions in one
package. The only reason I want the buildarch parameter is so I can
tell the versions apart from the filename, and so that RPM can throw a
proper strop if I install it on the wrong platform. But this works as
well. Thanks for the idea.
rpmbuild --target i686 -bb Package.spec
If the Buildarch line *is* present in the spec file, it will still
fail. I tried being cute by using a shell selector to add the
parameter, so you could execute the spec file as a program, but that
didn't work:
#!/usr/bin/rpmbuild --target i686 -bb
...rest of the file.
Cannot be arsed to find out what's wrong. It works now.
Thanks all,
Menno Willemse