RedHat version in rpm spec files


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat RedHat version in rpm spec files
# 1  
Old 09-28-2012
RedHat version in rpm spec files

Hi

In opensuse we have this nice version control variable I use much when designing rpm spec files:


Code:
rpm --showrc | grep suse_version
%if 0%{?suse_version} > 0 && 0%{?suse_version} < 1700 
-14: suse_version       1140

But I do not find anything close to this in rhel/centos
The only way I've found is to sed /etc/redhat-release

Like this:

Code:
cat /etc/redhat-release | sed 's/[^0-9]//g'
63

But I do not know if this holds for all releases.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Cybersecurity

Rpm for BIND 9 version 9.9.7-P2 (fix CVE-2015-5477) rhel

Hello, I have a RedHat machine (version 5.11) and i need to install BIND version version 9.9.7-P2 in order to fix a known BIND vulnerability CVE-2015-5477. I downloaded the tar file from isc website but i am having trouble to install the file. Does anybody knows a link for the rpm package of... (0 Replies)
Discussion started by: omonoiatis9
0 Replies

2. Ubuntu

Install and configure ntp rpm on Ubuntu 13.10 version

Hello, I am new to ubuntu Server OS and so trying to setup and ntp service on couple of servers. I see ntp rpm is not installed. # dpkg --get-selections | grep -v deinstall | grep ntp ntpdate install # so I tried to installed ntp rpm using... (5 Replies)
Discussion started by: bobby320
5 Replies

3. Red Hat

Installing PHP tools using RPM in Redhat Linux

Hi there, I am trying to install few PHP tools in my Linux server by creating RPMs from source ( tar.gz) files. The issue here is that the tar.gz files does not have a configure file and so I am not able to do ./configure make install opertations. I tried downloading src.rpms of these tools,... (0 Replies)
Discussion started by: Vicky81
0 Replies

4. Shell Programming and Scripting

build rpm with SPEC file for packaging .jar and some .sh files..

Good day people, Hereby wish to have your advise for below: I have some .jar files, some script files (install.sh, action.sh) , and a libaes.so file. Basically, the .jar files compute the operation of my system and define the working directory for my system. My current scenario: i trigger... (1 Reply)
Discussion started by: cielle
1 Replies

5. Shell Programming and Scripting

Calling script from a RPM spec file

Hi, I want to execute a script "myscript.sh" in the %post part of a rpm spec file. Suppose the script is placed in /opt/path. Then simply calling like sh /opt/path/myscript.sh from %post part (of that spec file) will suffice? Or there is any other way? (0 Replies)
Discussion started by: saurabhkoar
0 Replies

6. UNIX for Dummies Questions & Answers

Question on Redhat ver.6 RPM's

Hi, Using Redhat version 6.0, I need nmap so I have downloaded. But it requires many other dependencies, when I try to install it. See below err.msg. Is there any other way to get this installed, or I need to download each of the dependencies. rpm -Uhv nmap-5.51-2-mdv2011.0.x86_64.rpm... (3 Replies)
Discussion started by: samnyc
3 Replies

7. Shell Programming and Scripting

How to make RPM not write to RPM database if RPM fails to deploy?

How to make RPM not write to RPM database if RPM fails to deploy? IE I create an rpm spec file that contains the following if then exit 1 fi My rpm will fail at deployment, but if I do rpm -qa , I can see the rpm in the rpm db (3 Replies)
Discussion started by: 3junior
3 Replies

8. Shell Programming and Scripting

Need help writing RPM .spec file

I'm new to this. This installer just installs PHP code so NOTHING needs to be built (do I still need to use the build and buildroot directories?). I would just like to create an installer (spec) that: 1) unpacks a tarball 2) moves the unpacked files to the installation target 3) runs a script... (2 Replies)
Discussion started by: stevenswj
2 Replies

9. UNIX for Advanced & Expert Users

Find RedHat version.

How can I find out with a C program, on which RedHat version the program is being ran ? I do know through compilation variables that I'm on RedHat but so far cannot find out which one. Currently the closest I got was to invoke an ls or cat through syscall for the release or motd files. ... (5 Replies)
Discussion started by: amirvosko
5 Replies

10. UNIX for Dummies Questions & Answers

Redhat linux version

Guys How do i know the version of linux (Redhat) on one of our systems..Thanks in advance..The uname -r gives 2.4.18-0.13..Is it the kernel version (3 Replies)
Discussion started by: sssow
3 Replies
Login or Register to Ask a Question
RPMSPEC(8)						      System Manager's Manual							RPMSPEC(8)

NAME
rpmspec - RPM Spec Tool SYNOPSIS
QUERYING SPEC FILES: rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ... select-options [--rpms] [--srpms] query-options [--qf,--queryformat QUERYFMT] [--target TARGET_PLATFORM] QUERY OPTIONS The general form of an rpm spec query command is rpm {-q|--query} [select-options] [query-options] You may specify the format that the information should be printed in. To do this, you use the --qf|--queryformat QUERYFMT option, followed by the QUERYFMT format string. See rpm(8) for details. SELECT OPTIONS --rpms Operate on the binary package header(s). --srpm Operate on the source package header(s). SEE ALSO
popt(3), rpm(8), rpmdb(8), rpmkeys(8), rpmsign(8), rpm2cpio(8), rpmbuild(8), rpmspec --help - as rpm supports customizing the options via popt aliases it's impossible to guarantee that what's described in the manual matches what's available. http://www.rpm.org/ <URL:http://www.rpm.org/> AUTHORS
Marc Ewing <marc@redhat.com> Jeff Johnson <jbj@redhat.com> Erik Troan <ewt@redhat.com> Panu Matilainen <pmatilai@redhat.com> Red Hat, Inc 29 October 2010 RPMSPEC(8)