LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-13-2014, 03:41 AM   #1
r0tty
Member
 
Registered: May 2011
Posts: 33

Rep: Reputation: 1
OS version specific RPM packages


Hi,

This is a very general question about best practices for creating RPMs for RHEL5 or RHEL6 and how to control which are installed where. Here's the detail:

I had an RPM for installing some software on RHEL5 and that worked fine. To get it working properly on RHEL6 I had to recompile it, which also worked fine. However, I now have two versions of the RPM, one that only works on RHEL5 and one that only works on RHEL6. My questions are:

1. How do I control where these packages can be installed?
2. What's the best naming convention for the packages to make it obvious which version is installed?
3. What's the best approach to the version/release issues?

Some of my thoughts on those questions are:

1. I can't use dependencies as I don't want to trigger an OS upgrade. I could put something in the pre-exec script, but that's a little bit hidden and maybe there is a more visible way that uses integral RPM features?
2. I could incorporate el6 in package name or release, but I'm not sure which is best.
3. I could put el6 in the release name, but then if the two packages have the same name it will cause me problems deploying them.

Incidentally I am keen not to bring anything unneeded with me from RHEL5 to RHEL6, which is why I haven't included any details on how to get the RHEL5 package working on RHEL6 (I know how to do it, but don't want to). I suppose I could get the RHEL6 package working on the RHEL5 servers and thereby have just one package, but that's a lot of work for no real gain, so I'm not keen on that approach either.

Apologies for how general this question is, but thanks in advance for any assistance.

Rotty
 
Old 05-13-2014, 07:54 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Many packages simply have "el5" or "el6" in the name to distinguish them.

If you look at a site that offers builds for multiple versions you might get ideas.

For example Dag Wieers' site and this specific link:
http://pkgs.repoforge.org/perl-Apache-Htpasswd/

You might want to at least setup a dependency on redhat-release* package as that will let it know if it is being installed on RHEL5 or RHEL6 server. Dependencies don't trigger updates from RHEL5 to RHEL6 so far as I know.
 
2 members found this post helpful.
Old 05-13-2014, 12:45 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
There is a wealth of documentation at rpm.org relating to the creation and management of rpm packages.

Look here.
 
2 members found this post helpful.
Old 05-21-2014, 02:26 AM   #4
r0tty
Member
 
Registered: May 2011
Posts: 33

Original Poster
Rep: Reputation: 1
Hi,

Thanks for the replies.

@MensaWater - I couldn't see how those packages worked, so I just tried installing the el5 version on an el6 server and it installed. So, I take the point of el6 being in the release name is useful, but there is no mechanism there to prevent installation.

@bigrigdriver - that's a really useful doc thanks. I went through it all, but didn't see any answers about what I was looking for. However, that was still very useful and I now conclude that there is no elegant solution to this that I have been missing.

So, I guess the answer to my original question is this:
First decide if this is one RPM or two - if it's one the RPM name will be the same and the release will differ (contain el5 or el6), but if it is two the RPM name can contain -el5 or -el6. Then through pre-exec scripts implement action based on the content of redhat-release that prevents installation on the wrong version.
Rotty
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
configure path for dependent rpm packages for building source rpm package embeddedlinuxforall Linux - Newbie 1 03-01-2013 11:39 AM
installed rpm packages database: explicit and dependency packages leniviy Linux - Newbie 4 09-07-2012 03:31 AM
how to install rpm packages of the same version in multiple locations bvpurandare Linux - General 2 03-18-2009 04:14 PM
rpm path confusion - distro specific rpm? gandalf2041 Linux - Software 2 04-08-2004 02:19 PM
creating packages (.tgz/.deb/.rpm) How from the source packages? l_9_l Linux - General 1 03-06-2002 06:03 PM

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

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