Easy way to build rpm package from binary (these steps were tested with Fedora 18):
1) First you have to install rpmdevtools, so run these commands (attention: run as normal user)
$ sudo yum install rpmdevtools rpmlint
$ rpmdev-setuptree
2) In the ~/rpmbuild/SPECS folder create new file: package_name.spec
3) Open it with an editor (like gedit) and write this:
Name: package_name
Version: 1.0
Release: 1
Summary: Short description (first char has to be uppercase)
License: GPL
URL: www. your_website/
BuildRequires: package_required >= (or ==, or <=) 1.0.3 (for example)
%description
Description with almost 79 characters (first char has to be uppercase)
#This is a comment (just as example)
%files
/usr/bin/binary_file.bin
/usr/share/applications/package_name.desktop
/usr/share/pixmaps/package_name.png
%changelog
* date Packager's Name <packager's_email> version-revision
- Summary of changes
#For more details see: docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/Packagers_Guide/sect-Packagers_Guide-Creating_a_Basic_Spec_File.html
4) Make ~/rpmbuild/BUILDROOT/package_name-version-release.i386 and reproduce the paths where the files will be placed
So in this case for example create:
- ~/rpmbuild/BUILDROOT/package_name-version-release.i386/usr/bin/
- ~/rpmbuild/BUILDROOT/package_name-version-release.i386/usr/share/applications/
- ~/rpmbuild/BUILDROOT/package_name-version-release.i386/usr/share/pixmaps/
5) Put in these folders the files that you want insert in the package:
- ~/rpmbuild/BUILDROOT/package_name-version-release.i386/usr/bin/binary_file.bin
- ~/rpmbuild/BUILDROOT/package_name-version-release.i386/usr/share/applications/package_name.desktop
- ~/rpmbuild/BUILDROOT/package_name-version-release.i386/usr/share/pixmaps/package_name.png
usr/share/pixmaps/package_name.png is the icon of binary
usr/share/applications/package_name.desktop are the rules to insert the program in the menu entries
6) package_name.desktop must be like this:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=example
GenericName=Short description
Comment=Comment of the application
Exec=package_name
Icon=package_name
Terminal=false
Categories=System;
Categories are these: standards.freedesktop.org/menu-spec/latest/apa.html
7) Run $ rpmbuild -bb ~/rpmbuild/SPECS/package_name.spec
8) Your package was built into ~/rpmbuild/RPMS folder
if you install this package it's install:
- /usr/bin/binary_file.bin
- /usr/share/applications/package_name.desktop
- /usr/share/pixmaps/package_name.png
Thanks to: losurs.org/docs/tips/redhat/binary-rpms
For more details to build rpm take a look at this link.
GUI java software to build rpm: https://sourceforge.net/projects/javarpmbuilder/