Reputation: 215
I have to install the binary file using rpm package. I have created the below spec file to install my binary files using a RPM package.
-bash-4.1# cat nxtqos.spec
Summary: test Management Utility
Name: test
License: GPL
Vendor: test Limited
Version: 212.0.1.0
Release: 1
%description
%install
cp -rf /home/ahmed/nxtqos/nxtqos /usr/local/bin
%files
nxtqos
-bash-4.1#
I am getting below error prompt when I try to create the RPM package with below command.
-bash-4.1# rpmbuild --buildroot bnxtqos-tmp/ -bi bnxtqos.spec
error: failed to stat /home/ahmed/nxtqos/bnxtqos.spec: No such file or directory
-bash-4.1# rpmbuild --buildroot bnxtqos-tmp/ -bi nxtqos.spec
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.iuhGJm
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /bnxtqos-tmp '!=' / ']'
+ rm -rf /bnxtqos-tmp
++ dirname /bnxtqos-tmp
+ mkdir -p /
+ mkdir /bnxtqos-tmp
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cp -rf /home/ahmed/nxtqos/nxtqos /usr/local/bin
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: test-212.0.1.0-1.x86_64
error: File must begin with "/": nxtqos
RPM build errors:
File must begin with "/": nxtqos
-bash-4.1#
Can anybody please let me know if I am missing something in the spec file?
Upvotes: 1
Views: 3166
Reputation: 6222
I faced a similar issue, but in my case, there was a space in the file name before the file name, which was causing the problem while building the RPM, so make sure in any of your commits that there is any file with an illegal file name. the culprit file path was something like this.
"my/file/path/ message_en_properties"
so I removed the space from the file name, and it worked.
Upvotes: 0
Reputation: 37712
in the %files
section you should provide the complete path to your files where they are to be found when installed:
%files
/usr/local/bin/nxtqos
Upvotes: 2