Discussion:
custom RPM build
Leigh Peterson
2008-02-13 14:10:46 UTC
Permalink
Hi All,

I'm currently trying to create an RPM which contains the NRPE service as well as some custom scripts. The problem I'm having is that the source for the plugins and NRPE are in seperate tar.gz files. The spec file I have at the moment allows me to build the NRPE executable and start-up scripts, etc, and create an RPM. I would like to include some extra plugins from the other tar.gz file. These plugins are all perl scripts, so they don't require compilation, just a straight copy into the plugins folder before the RPM is created. Any ideas of where I can start modifying the spec file?

Thanks in advance for your help!
Regards,
Leigh
_________________________________________________________________
Free games, great prizes - get gaming at Gamesbox.
http://www.searchgamesbox.com
Dario Alcocer
2008-02-15 05:43:54 UTC
Permalink
Post by Leigh Peterson
Hi All,
I'm currently trying to create an RPM which contains the NRPE service
as well as some custom scripts. The problem I'm having is that the
source for the plugins and NRPE are in seperate tar.gz files. The
spec file I have at the moment allows me to build the NRPE executable
and start-up scripts, etc, and create an RPM. I would like to include
some extra plugins from the other tar.gz file. These plugins are all
perl scripts, so they don't require compilation, just a straight copy
into the plugins folder before the RPM is created.
First, add the plug-ins tarball as another source file; for example:

Source: nrpe-source-tarball.tar.gz
Source1: plugins.tar.gz

Next, modify the %prep section to unpack the the extra plug-ins tarball:

%prep
%setup
%setup -T -D -a 1

The second %setup directive will unpack the plug-ins tarball in the
top-level source directory of NRPE.

Finally, add commands in the %install section to copy the plug-ins into
the install destination:

%install
# install NRPE
rm -fr $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# install plug-ins unpacked in top-level source directory
cp other-plugins/*.pl $RPM_BUILD_ROOT/usr/lib/nrpe/plugins

Make sure to add the plug-in scripts to the %files section so they'll be
included in the package.

HTH,

-- D.
Leigh Peterson
2008-02-25 17:20:54 UTC
Permalink
Post by Dario Alcocer
Source: nrpe-source-tarball.tar.gz
Source1: plugins.tar.gz
%prep
%setup
%setup -T -D -a 1
The second %setup directive will unpack the plug-ins tarball in the
top-level source directory of NRPE.
Finally, add commands in the %install section to copy the plug-ins into
%install
# install NRPE
rm -fr $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# install plug-ins unpacked in top-level source directory
cp other-plugins/*.pl $RPM_BUILD_ROOT/usr/lib/nrpe/plugins
Make sure to add the plug-in scripts to the %files section so they'll be
included in the package.
HTH,
-- D.
Hi Guys,

Thanks for the replies - much appreciated! I've been on holidays, so I'll have a play this evening and let you know if I come up against any other difficulties, but it sounds pretty much what I'm after!

Thanks again!
Regards,
Leigh

_________________________________________________________________
Get Hotmail on your mobile, text MSN to 63463!
http://mobile.uk.msn.com/pc/mail.aspx

Loading...