LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-23-2011, 05:43 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
How to create rpm from tar.gz


I m planning to use puppet to implement organizational linux hardening policies across the linux servers.

To begin with i have downloaded.
puppet-2.7.1.tar.gz and tried some basic configuration to get start with puppet.
Now i want to roll out the puppet but before that i would like to make puppet rpm to suit my environment(as no service is created for puppet/Uninstall process is not known).

How would i accomplish the same?

My distribution are.
Distribution 1: Stripped down version of Oracle Enterprise linux optimized for running ORACLE Virtual Server(OVS)

Code:
# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: OracleVMserver
Description:    Oracle VM server release 2.2.0
Release:        2.2.0
Codename:       n/a
Distribution 2:

Oracle Enterprise linux 5.2
# lsb_release -a
Code:
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)
Release:        5.2
Codename:       Carthage
 
Old 08-23-2011, 06:47 AM   #2
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174
Blog Entries: 5

Rep: Reputation: 18
Well since I don't know Oracle Enterprise Linux, but know a bit about building RPMs, I can describe the way I did it.

Sure you might need to first read RPM building HOWTO at fedoraproject.org if you haven't done so already.

The next step you download some SRPM from your target Linux distribution (the one for which you're building RPM) and extract a SPEC file, which you can then use as a basis for your future custom RPM's SPEC. If you're installing a prog that requires creating system users, for example, then download a SRPM for some package that does the same and follow the way it does it.

Then you edit in the SPEC such fields as the package name, the source file name, etc., and especially the parts where it lists files it will install. The list of the files you get from your testing compile and install into some custom root.

Then you do `rpmbuild [options] yourpackage.spec` and see how it runs, then bring corrections into the SPEC in case of errors. It's actually rather simple straighforward, just first of all make sure your compilation goes fine and the compiled packages install and run fine.

I've successfully followed this pattern building quite a few packages, simple as well as complicated. After all, it is nothing but an automated compilation and install.
 
Old 08-24-2011, 12:06 AM   #3
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
So far i have got this.
Code:
# find /install/ -name "*.spec"
/install/puppet-2.7.1/conf/redhat/puppet.spec
/install/puppet-2.7.1/conf/suse/puppet.spec
What could be next step?
 
Old 08-24-2011, 12:22 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Q: Why do you think you need to create your own .rpm's in order to use puppet?

Q: What exactly are you trying to do with puppet, anyway?

Q: Have you looked at some of the puppet tutorials, or any of the "puppet recipes"?

* http://docs.puppetlabs.com/learning/

* http://bitfieldconsulting.com/puppet-tutorial

* http://www.linuxjournal.com/magazine...n-tasks-puppet

* http://www.linuxuser.co.uk/tutorials...er-management/

... and, perhaps best ...

* http://www.puppetcookbook.com/

'Hope that helps
 
1 members found this post helpful.
Old 08-24-2011, 12:25 AM   #5
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
You can do this with checkinstall. I use it for creating debs (easier to remove my own compiled work that way) but it can also create rpm's. Excellent program.
ciao,
jdk
 
1 members found this post helpful.
Old 08-24-2011, 01:26 AM   #6
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by paulsm4 View Post
Hi -

Q: Why do you think you need to create your own .rpm's in order to use puppet?

Q: What exactly are you trying to do with puppet, anyway?

Q: Have you looked at some of the puppet tutorials, or any of the "puppet recipes"?



'Hope that helps
Thanks for the links
Ans 1) i would like to make a rpm because its easier to manage and uninstall .
Ans 2) Implement Linux hardening policies across the linux distributions.
Ans 3)Seen puppet tutorials anyway some links were new.

Last edited by pinga123; 08-24-2011 at 01:27 AM.
 
Old 08-24-2011, 04:59 AM   #7
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174
Blog Entries: 5

Rep: Reputation: 18
Quote:
Originally Posted by pinga123 View Post
So far i have got this.
Code:
# find /install/ -name "*.spec"
/install/puppet-2.7.1/conf/redhat/puppet.spec
/install/puppet-2.7.1/conf/suse/puppet.spec
What could be next step?
So you even have the specs! Then it must be pretty straightforward. Try
Code:
$man rpmbuild
Now `rpmbuild` is the program that builds RPMS using SPEC files without any further interference on your part. It's part of "rpmdevtools" package in Fedora, don't know how it's called in SuSE.

Did you read the link I provided though? It gives a better description of it. You can omit the long description of the SPEC file itself since your source provides a ready one.
Though if you run into build problems with that one you might need some more info, then there you go.
 
1 members found this post helpful.
  


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 binary RPM from source tar? veeruk101 Linux - Newbie 4 06-08-2011 12:03 AM
create rpm from pre compile tar.gz netguy2000 Linux - General 6 04-25-2011 07:12 AM
How to create an rpm for an ordinary tar.gz file? ginda Red Hat 8 02-24-2010 05:29 AM
how to create rpm from tar.gz gsvsmanyam Linux - Newbie 16 02-19-2010 04:30 AM
create an RPM install file from tar? Siljrath Linux - Newbie 8 01-07-2005 01:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:35 AM.

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