Hi Stan,
I think I can help simplify this a bit.
stan wrote:
As far as I'm aware, the way to do this is to create a build tree in your home directory, rpmdev-setuptree
FWIW, this is not needed since rpm-4.6 (F10) as rpm now defaults to using your home dir and creates these directories as needed.
and then get the src.rpm package, yumdownloader --source<package name> and install it in the build tree, as a user. rpm -ivh<package name> Once this is done, move to the SPEC directory, cd ~/rpmbuild/SPEC and run the rpmbuild command to unpack everything. rpmbuild -bp<package name>.spec At this point the source will be unpacked in ~/rpmbuild/BUILD/<package name> You can then look at it with the editor of your choice.
Thank you for the concise description of how to do this, I'm going to use it (with attribution) the next time someone hits me with "how do I..." on building from source.
You're welcome, glad it was helpful. It probably exists on the Fedora wiki somewhere, though probably not so succinctly stated. I do know the "compile a custom kernel" page has a more detailed and involved explanation. I forgot to mention in the above that the patches that fedora applies will be in the ~/rpmbuild/SOURCE directory after unpacking.
On the whole, I'd avoid all of the manual work and just use fedpkg. You can yum install it on Fedora and CentOS/RHEL.
# Clone the package, anonymously (drop the -a if you're in the fedora # packager group). fedpkg clone -a foo
# Change to the newly create package dir. cd foo
# Have fedpkg download the source tarball(s) and extract it, applying # any patches as well. fedpkg prep
At this point, you will have the package source in a subdirectory, typically %{name}-%{version}. This will be the contents for rawhide. If you wish to see a different release, use fedpkg switch-branch prior to the fedpkg prep call (e.g. fedpkg switch-branch f14).
One nice thing (IMO) about this method is that all the patches and source files are in one directory. I always hated having things spread out in rpm's default {BUILD,SOURCES,SPECS} dirs (and I setup an ~/.rpmmacros to not use that layout).
HTH,