Trouble rebuilding JDS3 from source
[I originally posted this in the Solaris 10 forum -- sorry for the crosspost.]
I recently successfully installed Solaris 10 from the media kit on an x86 machine. I also successfully downloaded from the specified site the JDS3 source tarballs and untar'd them. I eventually figured out how to set my PATH (and LD_LIBRARY_PATH?) environment variable up so that all the requisite tools for building JDS3 from source are in my path. However, I'm failing miserably when I try to use 'pkgbuild --rebuild /path/to/somepackage-src', as detailed in the instructions on building JDS3 from source. The errors I get depend on what package I try the pkgbuild on.
I really only want to be able to peruse the source code (especially the GNOME sources included with the JDS3 source), so I would be happy just to get the "prep" or maybe the "compile" phases of pkgbuild to work, if not the entire rebuild. I have googled and visited solaris /jds forums for days, and have yet to discover any good information about how to build JDS3 from source on Solaris 10. Surely there are a bunch of people who successfully do this. Can anyone point me to some helpful info? Is there a source code repository that I could browse, so that I don't have to pkgbuild successfully? Thanks in advance...
[1300 byte] By [
Anguilla] at [2007-11-25 20:17:22]

# 1
I'd be interested what kind of errors you got when trying to rebuildpackages.To do %prep only try this:pkgbuild --define '_topdir /path/to/SUNWfoo-src' -bp /path/to/SUNWfoo-src/SPECS/SUNWfoo.spec
laca at 2007-7-4 15:00:52 >

# 2
Oops, I should have tested it before posting, sorry.
This one should work better:
pkgbuild \
--define '_sourcedir /path/to/SUNWfoo-src/reloc/share/src/SUNWfoo-<version>/SOURCES' \
--define '_specdir /path/to/SUNWfoo-src/reloc/share/src/SUNWfoo-<version>/SPECS' \
-bp /path/to/SUNWfoo-src/reloc/share/src/SUNWfoo-<version>/SPECS/SUNWfoo.spec
laca at 2007-7-4 15:00:52 >

# 3
Thanks so much for your reply -- I definitely wouldn't have figured out the _sourcedir/_specdir stuff on my own. However, I'm still running into the same error I had before, when I try to pkgbuild -bp the SUNWgnome-base-libs (there is some sort of glib problem). I'm wondering if I need to try to build the various source directories in a certain order, and if so, where do I find information on that? Also, I'm currently building as root, in case permissions were causing me problems when pkgbuild'ing as a regular user (stupid, I know; is there anything I need to do specially in order to build as a regular user?).
Anyway, here is the command line I used to try to pkgbuild -bp the gnome base libs, followed by the error message:
# pkgbuild --define '_sourcedir /export/home/Solaris10_JDS_Downloaded_Src/SUNWgnome-base-libs-src/reloc/share/s rc/SUNWgnome-base-libs-2.6.0/SOURCES' \
> --define '_specdir /export/home/Solaris10_JDS_Downloaded_Src/SUNWgnome-base-libs-src/reloc/share/s rc/SUNWgnome-base-libs-2.6.0/SPECS' \
> -bp /export/home/Solaris10_JDS_Downloaded_Src/SUNWgnome-base-libs-src/reloc/share/s rc/SUNWgnome-base-libs-2.6.0/SPECS/SUNWgnome-base-libs.spec
pkgbuild: error: SUNWGlib conflicts with SUNWgnome-base-libs
# 4
Ahh... it's what the error message says (;
SUNWGlib conflicts with SUNWgnome-base-libs, i.e. the build
of SUNWgnome-base-libs fails if SUNWGlib is installed.
Since you aren't actually trying to build, you can safely force
to ignore this by adding the --nodeps option.
laca at 2007-7-4 15:00:52 >

# 5
Okay, does this SUNWGlib conflict mean that I have set something up wrong in my environment? I consistently run into a different error when using pkgbuild on some of the other source directories: "Looks like a unified context diff. The next patch looks like a unified context diff. File to patch:", and then it just sits there waiting for me to input something, I know not what.
I'm wondering if all my problems are due to the fact I'm a complete newbie to Solaris, and I don't have my environment set up correctly. After some googling, I have hacked on /etc/default/login (etc.) to throw a whole bunch of directories into the PATH environment variable "just in case." At least the tools are found and executed now, I'm just not sure if in my blind setting of PATH and LD_LIBRARY_PATH I have screwed something up, and that is why pkgbuild throws so many errors.
Is there some repository of information where I can learn how to set up my environment correctly to build JDS3 using pkgbuild on x86 Solaris 10? Also, do I need to build the sources in a certain order? I've done a lot of googling, and looked at a lot of forum topics, and I'm just not finding anything that helps with either of those questions (aside from your replies, of course, which reminds me that I need to award you those Duke Dollars!).
# 6
The patch problem is indeed caused by PATH setting.
Most of the patches in the JDS source packages are in unified
diff format and require GNU patch. You need to have GNU
patch in the PATH before /usr/bin/patch.
As for setting up the build environment, please stay tuned to
the opensolaris desktop community pages at
http://www.opensolaris.org/os/community/desktop/
We're soon releasing the JDS Common Build Environment (CBE)
and the most recent JDS sources there together with step by
step instructions.
laca at 2007-7-4 15:00:52 >

# 7
Terrific! How soon do you expect this to happen? I had found my way to the opensolaris site before, but wasn't sure whether the CBE discussed there was targetting the same JDS sources released with Solaris 10.
Would you mind posting the PATH (and perhaps LD_LIBRARY_PATH, and any other relevant environment variables) from an environment that *might* work to build the JDS3 sources using pkgbuild?
Here is my stab-in-the-dark, non-working PATH:
PATH=/opt/sfw/bin:/usr/sfw/bin:/usr/local/bin:/usr/ccs/bin:/usr/ucb:/usr/sbin:/ usr/bin
I discovered gpatch in /usr/bin/ along with patch. I guess pkgbuild execs patch, as opposed to gpatch. I'll look into this further. Perhaps I'll just rename gpatch to patch, and see if that gets me further.
Thanks for all your help. I look forward to the JDS CBE from opensolaris, and to the step-by-step instructions 8=).