Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 285303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:32:03+00:00 2026-05-12T05:32:03+00:00

I just want to create an RPM file to distribute my Linux binary foobar,

  • 0

I just want to create an RPM file to distribute my Linux binary “foobar”, with only a couple of dependencies. It has a config file, /etc/foobar.conf and should be installed in /usr/bin/foobar.

Unfortunately the documentation for RPM is 27 chapters long and I really don’t have a day to sit down and read this, because I am also busy making .deb and EXE installers for other platforms.

What is the absolute minimum I have to do to create an RPM? Assume the foobar binary and foobar.conf are in the current working directory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:32:03+00:00Added an answer on May 12, 2026 at 5:32 am

    I often do binary rpm per packaging proprietary apps – also moster as websphere – on linux.
    So my experience could be useful also a you, besides that it would better to do a TRUE RPM if you can. But i digress.

    So the a basic step for packaging your (binary) program is as follow – in which i suppose the
    program is toybinprog with version 1.0, have a conf to be installed in /etc/toybinprog/toybinprog.conf and have a bin to be installed in /usr/bin called tobinprog :

    1. create your rpm build env for RPM < 4.6,4.7

    mkdir -p ~/rpmbuild/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp}
    
    cat <<EOF >~/.rpmmacros
    %_topdir   %(echo $HOME)/rpmbuild
    %_tmppath  %{_topdir}/tmp
    EOF
    
    cd ~/rpmbuild
    

    2. create the tarball of your project

    mkdir toybinprog-1.0
    mkdir -p toybinprog-1.0/usr/bin
    mkdir -p toybinprog-1.0/etc/toybinprog
    install -m 755 toybinprog toybinprog-1.0/usr/bin
    install -m 644 toybinprog.conf toybinprog-1.0/etc/toybinprog/
    
    tar -zcvf toybinprog-1.0.tar.gz toybinprog-1.0/
    

    3. Copy to the sources dir

    cp toybinprog-1.0.tar.gz SOURCES/
    
    cat <<EOF > SPECS/toybinprog.spec
    # Don't try fancy stuff like debuginfo, which is useless on binary-only
    # packages. Don't strip binary too
    # Be sure buildpolicy set to do nothing
    %define        __spec_install_post %{nil}
    %define          debug_package %{nil}
    %define        __os_install_post %{_dbpath}/brp-compress
    
    Summary: A very simple toy bin rpm package
    Name: toybinprog
    Version: 1.0
    Release: 1
    License: GPL+
    Group: Development/Tools
    SOURCE0 : %{name}-%{version}.tar.gz
    URL: http://toybinprog.company.com/
    
    BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
    
    %description
    %{summary}
    
    %prep
    %setup -q
    
    %build
    # Empty section.
    
    %install
    rm -rf %{buildroot}
    mkdir -p  %{buildroot}
    
    # in builddir
    cp -a * %{buildroot}
    
    
    %clean
    rm -rf %{buildroot}
    
    
    %files
    %defattr(-,root,root,-)
    %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
    %{_bindir}/*
    
    %changelog
    * Thu Apr 24 2009  Elia Pinto <devzero2000@rpm5.org> 1.0-1
    - First Build
    
    EOF
    

    4. build the source and the binary rpm

    rpmbuild -ba SPECS/toybinprog.spec
    

    And that’s all.

    Hope this help

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to create a File object like this File myImageFile = new
I want to create a batch file which only continues if MASTERRESET.DLL consists of
I just want to understand why I cannot create a protected enum on C#?
How can I create my own login form on frontend? I don’t just want
For our deployments, I just want to drop the existing stored proc, then re-create
Originally, I just want to verify that session_start locks on session. So, I create
I'm looking for as simple way to create an identity set. I just want
I want to create a button in c# with no content but just a
I've just got my Flash Builder 4 and now I want to create a
I've just created anew schema & want to create a new table. When ever

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.