To create an RPM package you need to have the rpmbuild utility installed.

    Create a tar.gz file of the distribution that you want to rpmify.  Fortunately
    most distributions are in this form.


     example file:     indent.2.2.6.tar.gz
     file location:    /usr/src/redhat/SOURCES


    The next step is create a indent-1.spec file, place it in your current directory or
    specify the path in the build step.

    
      Summary: GNU indent
      Name: indent
      Version: 2.2.6
      Release: 1
      Source0: %{name}-%{version}.tar.gz
      License: GPL
      Group: Development/Tools
      %description
      The GNU indent program reformats C code to any of a variety of
      formatting standards, or you can define your own.
      %prep
      %setup -q
      %build
      ./configure
      make
      %install
      make install
      %files
      %defattr(-,root,root)
      /usr/local/bin/indent
      %doc /usr/local/info/indent.info
      %doc %attr(0444,root,root) /usr/local/man/man1/indent.1
      %doc COPYING AUTHORS README NEWS
 
   The command to build the package is:

      rpmbuild -ba indent-1.spec


   It may be necessary to change or eliminate some of the lines in the .spec file to get the
   package to compile.