Bob Sacamano
Bob Sacamano

Reputation: 439

CentOS7: rpmbuild - Unable to recognise the format of the input file

I'm trying to build an extremely simple rpm over centos7. I just copy some pre-compiled executables from the tar.gz to /usr/bin/my_rpms/rpm1. Here is my install section:

%install
mkdir -p %{buildroot}/usr/bin/my_rpms/rpm1/
install -D prog prog.o -t %{buildroot}/usr/bin/my_rpms/rpm1/

it used to work find for the most part. but today when after i made some changes to the prog and re-compiled it keeps gettings these errors:

+ mkdir -p /root/rpmbuild/BUILDROOT/rpm1.x86_64/usr/bin/my_rpms/rpm1/
+ install -D prog prog.o -t /root/rpmbuild/BUILDROOT/rpm1.x86_64/usr/bin/my_rpms/rpm1/
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
/usr/bin/strip: Unable to recognise the format of the input file `/root/rpmbuild/BUILDROOT/rpm1.x86_64/usr/bin/drivertest_rpms/rpm1/prog.o'

Upvotes: 2

Views: 2928

Answers (1)

Nasir Iqbal
Nasir Iqbal

Reputation: 872

As you can see in error log, problem is with binary file striping which is default behavior of install command. I think your build environment is maybe different then rpm environment. cross-compiling? as suggested by @aaron-d-marasco

So I recommend to build rpm from project source. i.e move your build commands into %build section of .spec file.

Or strip your files in the same place where you have build them, and then in rpm use cp command in %install section instead of install command to move your files to target directory.

Upvotes: 1

Related Questions