I'm semi unix knowledgeable and I want to be able to call down an rpm from my server, run it with something like rpm -i , and have access to the script anywhere.

The script is a combination awk and php that does some processing. It doesn't require any special version of either or any special libraries. I think the php could even use 4. Awk is old as time. The order and usage statement is stored in a wrapping .sh .

How do i 1. turn it into an rpm that 2. puts it in /usr/bin (or a runnable folder) though i would prefer it's own subfolder since it's two files.

I will be mostly targetting centos but perhaps other shells. I don't think it matters.


Starting from the bottom:

I don't think it matters.

Well, it matters a little bit. CentOS uses RPM, but many other distributions don't. How you package things really depends on where you expect to install them.

How do I turn it into an rpm?

You need to create an RPM SPEC file, which is a collection of metadata about your package and the rules necessary to put it together. The Fedora project has a guide called How to create an RPM package that should get you started.

As a package creator you get to decide where files are installed. A good idea is to put your .sh wrapper in /usr/bin -- or some other directory that will be in you $PATH -- and then put other support files into something like /usr/lib/<yourappname>.


FPM can make multiple types of packages with ease. It's geared towards quick creation of packages, but is still tunable. It can make RPMs, DEBs, Solaris SVR4 packages, and even just simple tarballs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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