Okay, those instructions are pretty helpful. Now things are getting
complicated:

The application I want to RPM contains 4 components. Building the package
manually look like:

cd component1
/configure
make
make install
cd ..
cd component2
/configure
make
make install
.
.
.

The components are dependant: I can't run make on component2 before making
and installing component1.
It seems to me the only way to do this is put everything in the build
section of the RPM, and just the final make install (of component4) in the
install section. This seems to break the logic of RPMs, though.
Does anyone have any suggestions? Is there another way to do this?


-------------------------
Aviram Jenik

"Addicted to Chaos"

-------------------------
Today's quote:

If it weren't for electricity we'd all be watching television by
candlelight.
 - George Gobel


----- Original Message -----
From: "Tzafrir Cohen" <[EMAIL PROTECTED]>
To: "Aviram Jenik" <[EMAIL PROTECTED]>
Cc: "linux ILUG" <[EMAIL PROTECTED]>
Sent: Thursday, November 18, 1999 8:50 AM
Subject: Re: creating SRPMs


> Here's something I got from someone else in this list
>
> Date: Wed, 11 Aug 1999 12:07:02 +0300
> From: Oren Tirosh <[EMAIL PROTECTED]>
> Subject: Honey, I've RPMed the kids
>
>  <snip>
>
> > And one slightly related question:
> > Do you know how how to "patch" a rpm package (repackage with very
> > similar content and description, and keep the dependencies)?
>
> The SRPM consists of a .spec file (installed to /usr/src/redhat/SPECS)
> and one or more source and patch files (installed /usr/src/redhat/SOURCES)
> To rebuild both the binary and source RPMs use:
>
> rpm -ba /usr/src/redhat/SPECS/foo.spec
>
> When building an RPM package it unpacks the source, applies any patches,
> builds everything, installs into a temporary directory, verifies the .spec
> file list and only then, after successfully building a binary RPM it packs
> the spec and source files into a source RPM. There is no way to bypass
this
> when creating a source RPM - this ensures that the source RPM is indeed
> valid and can be used to rebuild the package.  Of course, if the .spec or
> makefile have references to components outside the build environment which
> may not be available on other machines the resulting source RPM will not
> work for them.
>
> The source tar in the SRPM is the original unmodified source from the
> program author. Any changes are done using patches, spec file changes or
> adding extra source files.
>
> Step 1:
> rpm -i foo-1.23.src.rpm
>  This installs the spec and sources to /usr/src/redhat/{SPECS|SOURCES}
>
> Step 2:
> rpm -bp /usr/src/redhat/SPECS/foo.spec
>  This tells rpm to run only the %prep section of the spec file: unpack the
>  sources to /usr/src/redhat/BUILD/foo-1.23 and apply patches.
>
>  cd to the build directory, examine the source, make changes, run make,
>  test, etc.  Before changing sources keep a backup (foo.c.orig)
>
>  You can use the actual commands in the spec file to compile:
>    rpm -bc --short-circuit
>  This tells rpm to run the %build section of the spec file. Short circuit
>  means it will skip the %prep section to avoid overwriting the changes
>  you made to the unpacked sources.
>
>   rpm -bi --short-circuit
>  Runs only the %install section of the spec file. Usually it installs
>  the package to /var/tmp/foo-root and creates there all the target
>  directories (/usr/bin, /usr/man/man1, etc).
>
>  When everything works ok you can generate the patches:
>  In the BUILD directory type:
>   diff -u foo-1.23/foo.c.orig foo-1.23/foo.c > ../SOURCES/foo-fixit.patch
>
>  Then add the patch file to the list of sources in the spec:
>    Patch7: foo-fixit.patch
>  And use the %patch macro to apply the patch in the %prep section
>    %patch7 -p1
>  (or -p0, depending on how many path elements you need to strip)
>
>  To test the patches use rpm -bp to rerun the %prep section which will
>  erase the build directory, unpack the source and apply the new patches.
>  After the patches apply cleanly you can test the %build and %install
>  sections or just go all the way:
>   rpm -ba /usr/src/redhat/specs/foo.spec
>
>  If everything is ok it will build a binary and source rpms and put them
in
>  /usr/src/redhat/RPMS/i386/foo-1.23-2.i386.rpm
>  /usr/src/redhat/SRPMS/foo-1.23-2.src.rpm
>
>  Remember to update the revision number. The version number is the version
>  of the original program, the revision is for modifications to the RPM.
>
> Oren
>
> Tzafrir Cohen
> mailto:[EMAIL PROTECTED]
> http://www.technion.ac.il/~tzafrir
>
>



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to