Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-20-2014, 09:53 AM   #1
Registered: Mar 2008
Posts: 108

Rep: Reputation: 16
RPM Spec File questions


I have been following various guides on the internet to see how to build a simple RPM. I think I've got the general idea, but when it comes to editing the spec file they all seem to have a different idea, and some of them goive spec file examples that don't look like the skeleton specfile I have.

I am using rpmdevtools-7.5-2 (x86). My simple demo spec file is below:

Name:           Hello
Version:        1.0
Release:        1%{?dist}
Summary:        A script to shout a brother yo

Group:          Amusements/Games
License:        GPL
Source0:        /home/rpmbuilder/rpmbuild/SOURCES/hello.tar.gz
BuildArch:      noarch
BuildRoot      /tmp


My test rpm thing

%setup -q

#make %{?_smp_mflags}

install -d 0755 $RPM_BUILD_ROOT/usr/bin
install -m 0755 $RPM_BUILD_ROOT/usr/bin


%dir /usr/bin

So what I've done here is-

rpmdev-setuptree to create the build tree (BUILD, SOURCES, SPECS and so on)

Wrote a bash script containing 'echo "Hello World"' and turn it into an executable called

Then I've tar/gzipped that into SOURCES directory
tar -cvzf SOURCES/hello.tar.gz

Then ran rpmdev-newspec and populated it with the basic information in the quote above. I'm not bothered about URL being, and I think (at least rpmbuild hasn't compolained about using path to the SOURCE directory as Source0.

But two problems I see, BuildRoot- as there's no complilation required, can't I just have /tmp for this? Or does it have top be a string of Macros describing a path, and if so- path to where, to the SOURCE directory? The guides I have followed so far don't seem clear on this point at all.

Which means furthe down, where I've put...

install -d 0755 $RPM_BUILD_ROOT/usr/bin
install -m 0755 $RPM_BUILD_ROOT/usr/bin

do those locations look ok (should result in /tmp/usr/bin) given what I've set as my BuildRoot? In some examples BuildRoot was a string of percentage symbols and curly brackets... Any pointers at all would be appreciated.

Last edited by hashbangbinbash; 06-20-2014 at 09:59 AM.
Old 06-20-2014, 10:02 AM   #2
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
As a maintainer of various RPM based software throughout the years, I will say that my favorite piece of software in many years is this:

No hassle RPM/Deb/etc.. making. Hope this changes your life like it did for me.

Last edited by szboardstretcher; 06-20-2014 at 10:03 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS RPM SPEC files: Binutils RPM spec for x86 arch nocountryman Linux From Scratch 2 10-25-2010 10:09 AM
rpm spec file help AutoC Fedora 3 01-30-2008 09:25 AM
rpm spec file alrawab Linux - General 2 03-28-2007 07:39 AM
RPM Spec file adddy Linux - Software 8 11-07-2006 06:02 AM
questions on writing own rpm .spec file adrianmak Linux - Software 0 08-18-2005 07:03 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration