[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: running external scripts from rpm install



On Sun, 10 Aug 2003, Galit Hayat wrote:

> Thanks James,
> 
> The reason I need to run external scripts is that I'm creating a Linux
> installation
> for a product that already has a Solaris installation and I want to use the
> same scripts.
> My problem is that I don't know how to include scripts inside the package
> without actually 
> installing them. Is there a way?
>
I completly understand what your trying to do, as I too have went from 
Solaris to Linux, and have probably crossed all the bridges that you are
about cross.  So lets see if I can help.

The first thing you have to realize (and try not to fight) is that RPM's 
scriptlets (i.e. the the analogues to the Solaris package's) are all 
contained inside the spec file, and are not external scripts.  As I said 
earlier you can call external scripts from these scriptlets, but of course
the scripts that are called must have been placed on the system for them
to be called.  Now here are a couple strategies you could take:

	1) Place all these scripts that are external to the specfile in
	   a seperate rpm that the rpm that will use them requires.
	   Then in the scriptlets in the requireing rpm, you simply call
	   these scripts.
	2) Make the building of your rpms send a specfile through a 
	   preprocessing phase, where you take the external scripts and
	   insert them into the spec file with the appropriate scriplet
	   label (i.e. %pre, %post, %preun, %postun).

I personally prefer the second option, as it can lead you down the road of 
creating platform neutral packaging format, but it of course requires more
coding.  The first is fairly easy to do, and you could find ways to 
automate the building of such rpms (e.g. a script could be written that 
would look for relevant solaris install/uninstall scripts and 
automatically generate a spec file that packages them up; it could be 
taken a step further, by writing code to make sure the proper scriptlets 
are generated to call the external scripts in the specfile that requires
the rpm that delivers the scripts).

There are probably other ways of handling this, also, but however you do 
it fighting rpm's implementation of analagous behavior is not going to 
help you.  Go with the stream (-;

Cheers...james

 
> Galit.
> -----Original Message-----
> From: James Olin Oden [mailto:joden@malachi.lee.k12.nc.us]
> Sent: Sunday, August 10, 2003 4:34 PM
> To: Rpm-List (E-mail)
> Subject: Re: running external scripts from rpm install
> 
> 
> On Sun, 10 Aug 2003, Galit Hayat wrote:
> 
> > Hi Guys,
> > 
> > I would like to run external shell scripts from my RPM installation.
> > How do I make sure the scripts files are included in the RPM package?
> > (kind of Support Files)
> >
> Normally, rpm has scriptlets inside the spec file that are 
> ran at install time.  These are:
> 
> 	%pre              - Run before rpm files are installed.
> 	%post             - Run after rpm files are installed.
> 	%preun            - Run before rpm files are erased.
> 	%postun           - Run after rpm files are erased.
>  	%triggerin        - Install trigger.
> 	%triggerun        - uninstall trigger
> 	%triggerpostun    - postuninstall trigger.
> 
> The scripts are normally bash scripts, but you can change the interpreter
> with the -p option.
> 
> Also, as they are bash scripts you can call external scripts from these.
> 
> Cheers...james
> > Thanks,
> > Galit Hayat
> > R&D
> > Sofaware Technologies Ltd.
> > 
> > 
> > 
> > _______________________________________________
> > Rpm-list mailing list
> > Rpm-list@redhat.com
> > https://www.redhat.com/mailman/listinfo/rpm-list
> > 
> 
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://www.redhat.com/mailman/listinfo/rpm-list
> 
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://www.redhat.com/mailman/listinfo/rpm-list
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []