LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-03-2013, 05:55 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 33
[RPM Script] Problem by section %install


Hi,

We know the RPM script (spec) has normally following sections auch as

%description
...

%pre
...

%install
...

%post
...


etc.

I have a spec file which looks just very simple as follow:
Code:
...
%definition
...

%pre
HOSTNAME=`hostname`
echo "Section %PRE"
...

%install
HOSTNAME=`hostname`
echo "Section %INSTALL"
...

%post
HOSTNAME=`hostname`
echo "Section %POST"
...
But I get after running this script:
Code:
...
HOSTNAME: s003ap19-test.proactiv.de
Section PRE

HOSTNAME: s003ap19-test.proactiv.de
Section: POST
...
One can see the section of %install is not shown here.

What could be the cause?

Last edited by thomas2004ch; 12-03-2013 at 06:14 AM.
 
Old 12-03-2013, 06:55 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,579

Rep: Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342
%install is not executed during install (that is quite misleading), %install is used during the preparation phase, when you want to build the package from sources.
look at this page for example: http://www.rpm.org/max-rpm-snapshot/...b-command.html
or even better here: http://www.rpm.org/max-rpm-snapshot/...e-scripts.html

Last edited by pan64; 12-03-2013 at 06:58 AM.
 
1 members found this post helpful.
Old 12-03-2013, 07:38 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 33
Thanks for the infomation. It realy misleadings me.

What I want is: When I install (not %install) the RPM on the target machine, I will check first the host name of the target machine. Only by the correct machine it should install the components.

How can I do in this case? Maybe in the %post section?
 
Old 12-03-2013, 07:39 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,579

Rep: Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342Reputation: 4342
no, see the second link I posted. that is the %pre phase.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Difference between %install and %files section in rpm building ? Rohit_4739 Linux - Software 1 05-15-2012 01:50 AM
RPM SPEC file install script run anti43 Linux - Software 2 05-05-2009 08:17 AM
Call scripts in Rpm's: %pre %post section vibhor_agarwalin Linux - General 4 04-13-2009 01:18 AM
RPM Spec file creation, %files section question davidas Linux - Software 1 09-13-2007 03:26 AM
script in section 5.9 microsoft/linux Linux From Scratch 1 07-13-2005 01:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration