Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

when I perfrom rpm -ba /usr/src/redhat/SPECS/my_spec.spec

as described here the output not include the Wrote: /root/rpmbuild/SRPMS/test.sh-6.2-2.rpm please advice why?

remark under /usr/src/redhat/RPMS I not see the test.sh-6.2-2.rpm

 [root@linux /usr/src/redhat/SOURCES]#  rpm -ba   /usr/src/redhat/SPECS/my_spec.spec
 Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/test.sh
 Wrote: /root/rpmbuild/SRPMS/test.sh-6.2-2.src.rpm

my spec file

Summary: An example tool. To show a simple rpm build of the tool.
Name: test.sh
Version: 6.2
Release: 2
Source:/root/test.sh
Group: Development/Debuggers
BuildRoot:/var/tmp/test.sh
License: OtherLicense
%description
share|improve this question

3 Answers 3

Try with rpmbuild command. I dont think rpm has an "-ba" option.

share|improve this answer

You did not specify the version of RedHat or CentOS linux that you're using. rpm -ba option was removed from rpm many years ago. So, presuming you're using RHEL 5.x or CentOS 5.x or later, you need to use rpmbuild command to build your RPMs

However: It appears you're following some kind of a book or manual in your rpm study. This source of information is very outdated if it suggests using rpm -ba to build RPMs. I think you'd better find a more recent book or manual, since RPM has evolved considerably in the recent years. You can start with rpmbuild man page or see the list of available documentation on RPM web site.

share|improve this answer

The spec file seems broken, the build_root should be a directory. The source is a bare file name, not a full path. And so on.

Install rpm-build, that package provides a lot of infrastructure for creating RPMs. If you open xyz.spec in {x,}emacs, it opens a template (dunno for vim or such). The Fedora RM guide is mandatory reading. It helps to get a source package (select something simple, stand-aloneish like bison or even git; hopefully something you already know how to build) and dissect its source RPM.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.