LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-04-2009, 11:33 AM   #1
anti43
LQ Newbie
 
Registered: May 2009
Posts: 2

Rep: Reputation: 0
RPM SPEC file install script run


Hi!

I created a spec for my rpm, which builds fine. However the script which i provided in the "%install% section is only executed during build..

maybe i got something wrong, but shouldnt the %install section be executed during installation of the rpm?

if not, where do i have to specify a script to be run during installation on the target machine?

any help would be highly appreciated :-)

PHP Code:
SummaryMein Proggi
Name
meinproggi
Version
6
Release
4
License
Restricted
Group
Applications/System
BuildRoot
: %{_builddir}/%{name}-root
URL
http://www.com
Vendorich
Packager
ich
BuildArchitectures
noarch
Requires
jre-sun

%description
lalala


%define my_requires   /tmp/meinprogramm.tar
%define my_properties /tmp/meinprogramm.properties



%prep


%build
pwd
cd 
%{_sourcedir}

%
install
dos2unix 
%{my_properties}
pwd
rm 
-rf $RPM_BUILD_ROOT

mkdir 
-p $RPM_BUILD_ROOT/tmp/meinprogrammX
cd $RPM_BUILD_ROOT
/tmp/meinprogrammX
cp 
%{my_requires} .

tar -xf meinprogramm.tar
mkdir 
-p $RPM_BUILD_ROOT`head -1 %{my_properties}|awk '{print $1}'`

$RPM_BUILD_ROOT/tmp/meinprogrammX/install -silent -d $RPM_BUILD_ROOT`head -1 %{my_properties}|awk '{print $1}'` -`head -1 %{my_properties}|awk '{print $2}'` -sno `head -1 %{my_properties}|awk '{print $3}'` `head -1 %{my_properties}|awk '{print $4}'`
find $RPM_BUILD_ROOT`head -1 %{my_properties}|awk '{print $1}'`/meinprogrammX -print > %{_builddir}/files.list
sed -"s|$RPM_BUILD_ROOT||" %{_builddir}/files.list > /tmp/tempfile.tmp
mv 
/tmp/tempfile.tmp %{_builddir}/files.list

rm -rf /tmp/meinprogrammX
rm 
-rf /tmp/tempfile.tmp

%post

%clean

%files -f files.list
%
defattr(-,root,root)
/
tmp/meinprogrammX/InstallArchive.jar
/tmp/meinprogrammX/README.txt
/tmp/meinprogrammX/env.class
/
tmp/meinprogrammX/install.ncf
/tmp/meinprogrammX/meinprogrammX.properties
/tmp/meinprogrammX/meinprogrammX.tar
/tmp/meinprogrammX/support.tar
/tmp/meinprogrammX/meinprogramm.tar
%attr(755,root,root)
/
tmp/meinprogrammX/install


%preun

%postun
rm 
-/etc/rc3.d/S99meinprogrammX
rm 
-/etc/rc3.d/S99meinprogrammX
rm 
-/etc/rc5.d/S99meinprogrammX


%changelog
Mon May 5 2009 AW
Created initial spec file 
 
Old 05-04-2009, 04:52 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
You probably want "%post" (not "%pre").
 
Old 05-05-2009, 07:17 AM   #3
anti43
LQ Newbie
 
Registered: May 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thats it, thanks!
 
  


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
rpm spec file help AutoC Fedora 3 01-30-2008 08:25 AM
rpm spec file alrawab Linux - General 2 03-28-2007 06:39 AM
RPM Spec file adddy Linux - Software 8 11-07-2006 05:02 AM
RPM spec file install rule how its evaluated? cranium2004 Programming 2 03-11-2005 02:03 AM
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 10:36 PM

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

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