Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General > Linux - Certification
User Name
Linux - Certification This forum is for the discussion of all topics relating to Linux certification.


  Search this Thread
Old 07-11-2011, 01:11 PM   #1
Registered: Jun 2011
Posts: 164

Rep: Reputation: Disabled
You can create your own RPM package

One more slightly intimidating requirement of the RHCE objectives is to create your own RPM package. The relevant RHCE objective is:

Build a simple RPM that packages a single file

Once the RPM is complete, you should be able to install it on any other RHEL 6 system. Once installed, that single file should appear in the same directory every time. I include an excerpt from Chapter 11 of my book which should give you a bit of insight on the process.


Two commands from the rpmdevtools package are of special
interest. The rpmdev-setuptree command creates the rpmbuild/ subdirectory, with
appropriate subdirectories. The rpmdev-newspec command creates a newpackage.
spec file in the local directory, with a template that can be used to create an RPM.

Thus, to build an RPM, you’d run the
rpmdev-setuptree command to build the directory structure, and then copy the gzip
compressed archive to the rpmbuild/SOURCES subdirectory. Now you can create a
spec file to process that archive.


Once modifications are complete, you can use that newpackage.spec template file, along with the rpmbuild/ subdirectories to help create a RPM package. (Source code files are no longer tied to the /usr/src subdirectories.
Old 07-11-2011, 02:14 PM   #2
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,261

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Sounds like you should write this up more fully as a tutorial. I knew it was possible, but I also knew some guys in mandrake couldn't manage it reliably (10 years back)
1 members found this post helpful.
Old 07-11-2011, 02:35 PM   #3
Registered: Jun 2011
Posts: 164

Original Poster
Rep: Reputation: Disabled
Sounds like you should write this up more fully as a tutorial.
I have. It's in Chapter 11 of my book, described in a different thread linked here. But I think my OP, along with typical .spec files you can find for yourself (along with the rpm and rpmbuild commands), can get you started on learning how to create your own RPM.

Last edited by mike_rhce; 07-12-2011 at 01:11 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
How to create users from a RPM package techie_techie Linux - Software 6 11-12-2011 10:49 AM
Need to create rpm package Mr.J Linux - Desktop 3 08-12-2009 05:30 AM
create RPM-package from installed files ? hungnt Linux - Software 1 07-10-2005 11:17 PM
how to create .rpm package shalin Programming 1 07-13-2004 10:12 AM
how to create RPM Package shalin Programming 0 03-09-2004 11:04 PM > Forums > Linux Forums > Linux - General > Linux - Certification

All times are GMT -5. The time now is 07:54 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