LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating a custom yum package (https://www.linuxquestions.org/questions/linux-newbie-8/creating-a-custom-yum-package-895710/)

maverick964_uk 08-05-2011 05:27 AM

Creating a custom yum package
 
Hi,

I know unix but mainly HPUX so I'm not up to speed with redhat sys admin.

I'm working with redhat 5.5 and 5.6 for a customer.
Based on some security constraints I want to be able to create an automated install package for some backup agent patches.

I have a satellite server with yum setup.

I want to package up a tar file with a few functions to spray an update to many redhat hosts.

We have a lack of redhat resources here so Im trying to do it myself. Can someone help?

thanks
Mike

kbp 08-05-2011 09:30 AM

Sure ... do you want assistance to learn or just someone to get the job done?

maverick964_uk 08-17-2011 06:26 AM

Hi, thanks for the reply and sorry for the delay. Just returned from vacation.

Anyway, yes help would be good as I do want to learn.

thanks, Mike

kbp 08-17-2011 05:53 PM

Ok ... the first hurdle is this:
Quote:

..create an automated install package for some backup agent patches.
One of the ideas behind RPM is that you don't patch on top, you update the package with the patch and increment the release number. When you need to update a package, you may just be adding a patch - but from the install side it always looks like an update of the application.

example spec file part:
Code:

Source0:    %{name}-%{version}.tar.gz
Patch0:    myapp_fix_1.patch

Example install:
Code:

yum update myapp
So in your case the process might look like:-
- choose a host to build packages on
- configure it for building rpm's
- grab the application source rpm and install it
- edit the spec file to utilise the patch, and increment the release number
- copy the patch to SOURCES
- rebuild the rpm

And a quick guide to setting up an rpm build environment:
- 'yum -y install rpm-build rpmdevtools rpmlint'
- 'rpmdev-setuptree'
- 'cd ~/rpmbuild'

cheers

maverick964_uk 08-26-2011 05:53 AM

Hi,

thanks for the information.

I have a rpm build environment already so I just want to add to it. Its a simple shell script really.
As the build env is in place is there a simple process to add a rpm package in?

Also is it possible to spray this script from the rpm build server to all redhat hosts??

thanks

mikey99 08-26-2011 12:28 PM

Quote:

Originally Posted by maverick964_uk (Post 4434408)
Based on some security constraints I want to be able to create an automated install package for some backup agent patches.

I have a satellite server with yum setup.

I want to package up a tar file with a few functions to spray an update to many redhat hosts.

If you are trying to do this from within Satellite, then you really need to look at the documentation for Satellite and fully understand the process.

If setup correctly (and many aren't) then the correct procedure is to take your newly updated rpm and push it to the correct custom software channel (the one that all your RHEL hosts are subscribed to). Ideally you should even create an errata for it.

However, maybe you are also using cloned channels in a DTAP type setup. In which case you will need to test the new rpm on your dev boxes before promoting the rpm through to the production channel. In which case you will need to clone the erratas as well.

Bottom line is - if you are using satellite, the right procedure is "it depends on your sat setup".

Mike.

kbp 08-26-2011 11:59 PM

Are you wanting to add the script to all the hosts or just execute it on them? ... if the former, it may be easier to use a config channel in Satellite rather than packaging it.

maverick964_uk 08-30-2011 03:08 AM

thanks for the inputs.

At the moment I just want to find the best way to push and execute a script to all redhat hosts.

Whats the best way?

kbp 08-30-2011 06:20 PM

Via Satellite: a config channel for pushing it out then schedule the execution (sorry, don't have a Satellite handy atm so I can't give you the step-by-step)

chrism01 08-30-2011 06:29 PM

I believe you have to pay RH for Satellite; if you want the free version, its called Spacewalk http://spacewalk.redhat.com/ http://wiki.centos.org/HowTos/Packag...ment/Spacewalk

kbp 08-30-2011 07:32 PM

Func is a great product, bit like driving a dune buggy with a Ferrari engine - looks ugly but tons of power :)

maverick964_uk 09-05-2011 05:22 AM

thanks guys for the responses....

I'm actually gonna test qpssh and it seems to work...

example:

# qpssh -v -h /tmp/hostlist -X "-qtt" -l user@domain.org -i "sudo -i '.....commands.....'"


All times are GMT -5. The time now is 09:27 PM.