re: [SLE] Re: working with source rpms [WAS [Is there a howto for building a source rpm?]]
Anders, Many thanks, I will be trying this out this afternoon. Greg
On Tuesday 01 April 2003 01:16, you wrote:
If you want to make any changes to the rpm, the standard procedure would be to install the src.rpm with rpm -ivh, edit the spec file in /usr/src/packages/SPECS and finally build the new rpm with "rpm -bb <spec file>" or "rpm -ba <spec file>" if you want a new src.rpm built with your new edited spec file included.
Anders,
Thanks, that does seem to work but is not quite what I was looking for.
I guess there is not a HowTo that describes using the *.src.rpm and associated spec files. :(
I still have a few questions, maybe you can answer them:
(for all of the below, I am working with shadow-4.0.2-47.src.rpm) ---- 1) The above ("rpm -ivh; rpm -ba") is apparently missing some dependency checking.
Yes, there is none. You have to manually make sure the required dependencies are installed.
At least on my machine rpm -ba is dying because I don't have ldap.h installed.
The dependency on openldap2-devel is in the specfile under both "# neededforbuild" and "# usedforbuild".
How do I get rpm to test for it?
You don't. Those are tags used by SuSE's internal build system. You can use them as hints for what you need to install.
2) What is the difference between "# neededforbuild" and "#
usedforbuild"
in the specfile.
neededforbuild are the direct dependencies that the package uses to compile.
As I understand it, the SuSE build system works in a chroot()ed environment. Every time a package is built, a clean environment is created. usedforbuild describes that chrooted environment. As you can see, it includes all the basic packages that are needed for the compile all the way from aaa_base to the top level dependencies.
3) If I want to create a patch file of my own, do I just create a shadow-4.0.2-greg.dif file and reference it in the specfile?
Yes
If so, do I create the diff file with a diff -c like a normal patch?
That is up to you. In the spec file you apply the patch manually, so you can give whatever parameters to patch you like. Look at the %patch statements in the %prep section.
Incidentally, the standard usage is to use unified patches (-u). But as I say you can use whatever you prefer.
4) While developing my patches, I want to modify the actual source, compile, and install.
The below seems to work, and it installs to /var/tmp/shadow-root, which
is
nice for initial testing. === # rpm -ivh shadow-4.0.2-47.src.rpm (.src.rpm from the CDs) # cd /usr/src/packages/SPECS # rpm -bp shadow.spec # Apply SuSE specific patches # rpm -bc --short-circuit shadow.spec # Run ./configure as SuSE does # cd /usr/src/packages/BUILD # make source code changes # Invoke local makes as necessary # cd /usr/src/packages/SPECS # rpm -bi --short-circuit shadow.spec # Install === For final testing, how do I get rpm to install to /?
You could change the build root in the spec file. But I always build the binary rpm and install it as per normal when I work with them. When I make
changes in rpms, here's my procedure
rpm -ivh rpm -bp
edit source files and create diffs, edit the spec file to use those diffs
rpm -bb rpm -Uvh on the binary rpm
I'm sure there are other ways of doing it, with the "interrupted style" build you describe above, but this is the way I do it and it seems to work. I haven't really looked at your method, so I can't discuss it.
regards Anders
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
participants (1)
-
Greg Freemyer