How to build a simplest RPM ?

redstar01 used Ask the Experts™
I have some binary file, for example : mypro1, mypro2
I want to build a rpm to install to /bin/myprog1 , /sbin/myprog1
and run  myprog1 after install complete

What about simplest rpm to do this?
I already document but it seem complex and almost build rpm with SourceCode

Thank you!
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Please answer the following questions.

So, are you running Red Hat?

Do you have source code from where you could recompile?

Did you make a spec file yet?


Yes, I'm using Centos (RedHat)
I have not spec file and have only 2 binary file, have Not source code!
Ok.  I have done so many RPMS, never once without the source code but we can certainly try it.  It is a little long process.

First you need to create a spec file.  Generally, I work on a machine with a full install--as many packages as possible and make a special unprivileged user to create RPMS.

In addition you have to make your directory structure, directory where you will have your source code -- not in your case, directory where you will have your spec file and directories where the process will produce RPMS.

In addition you have to set certain macros to set paths, etc.
Kerem ERSOYPresident
I'd responded the other copy of the question. But it seems that you're only checking here. So I'm transferring my answer here.

In fact it is not that hard. First of all make sure that you have the rpm-build package installed. Then you 'll need to create the environment. Then prepare the programs and spec file and then actually produce the RPM. But unfortunately it is not easy to tell it step by step here. So I'm afraid I have to redirect you to some simple tutorials.

Here are some short tutorials:

You can  omit the signing of the RPMS.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial