Link to home
Start Free TrialLog in
Avatar of Anonymouslemming
Anonymouslemming

asked on

Adding a helper file to an RPM

Hi all,

I am trying to create an RPM for the Emulex 2.01g drivers for our kernel. The base RPM works fine, but I am now trying to include a helper script in the RPM. This script lives outside the driver source, as I wan't to preserve the emulex tarball.

I tried including
Source: updateinitrd.sh
in my spec file, but it died because it tries to unpack all source files during the RPM creation.

I then tried just adding the file where I do the other installs, but instead of doing
install -m $RPM_BUILD_ROOT/blah
I did
install -m /usr/src/redhat/SOURCES/updateinitrd.sh /usr/local/bin

This works fine, and the file then appears in my binary RPM and is installed at installation time.

The problem I have is that the file is _NOT_ included in the resulting source RPM, so rebuilding the source RPM means finding this file and manually copying it into place.

Can anyone advise a solution for this ?
Avatar of tykeal
tykeal

Is updateinitrd.sh listed as one of the sources in the .spec header as well as located in the SOURCES directory from out of which you are working?

For instance:

...
Source0: <baseurl>/%{name}-%{version}.tar.gz
Source1: updateinitrd.sh
...

Later down in %install you should have something like this

...
install -m %{SOURCE1} /usr/local/bin

Now, when you build the sources it should get included inside the srpm as well.  At least that's the theory.  It's been a while since I did something like that ;)
Avatar of Anonymouslemming

ASKER

As I said in my question, if I include updateinitrd.sh as a Source statement in the SPEC file, it tries to untar it, so it fails with an error.
ASKER CERTIFIED SOLUTION
Avatar of tykeal
tykeal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial