LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > Linux - Certification
User Name
Password
Linux - Certification This forum is for the discussion of all topics relating to Linux certification.

Notices


Reply
  Search this Thread
Old 07-11-2011, 01:11 PM   #1
mike_rhce
Member
 
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
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
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
mike_rhce
Member
 
Registered: Jun 2011
Posts: 164

Original Poster
Rep: Reputation: Disabled
Quote:
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General > Linux - Certification

All times are GMT -5. The time now is 03:43 PM.

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