By User12821160-Oracle on Dec 17, 2008
As OpenSolaris is being targeted at developers it makes sense that you should be able to build the Desktop on OpenSolaris with relative ease. Initially I thought it was going to be difficult but it's actually not, once you follow the following steps.
Bear in mind this is probably not the complete set of steps required and is a work in progess list :), So if you encounter something that I've missed let me know and I will update this blog entry.
1. Install Sun Studio compiler
This can be installed via the ss-dev package.
$ pfexec pkg install ss-dev
2. Install Required Packages.
Install GNOME development tools package SUNWgnome-common-devel :
$ pfexec pkg install SUNWgnome-common-devel
Install Perl XML::Parser package SUNWperl-xml-parser :
$ pfexec pkg install SUNWperl-xml-parser
Install GNU gettext package SUNWgnu-gettext for po procesing :
$ pfexec pkg install SUNWgnu-gettext
Install GNOME xml documentation packages SUNWgnome-xml\* :
$ pfexec pkg install SUNWgnome-xml-root $ pfexec pkg install SUNWgnome-xml $ pfexec pkg install SUNWgnome-xml-share $ pfexec pkg install SUNWdoxygen
3. Install docbook catalog.
Once you've installed all the xml stylesheets, you still need to manually update the docbook catalog, this is to ensure xsltproc knows that DTD's are installed locally and it won't try to access the net for DTD's :
$ pfexec /usr/share/sgml/docbook/docbook-catalog-install.sh
4. Install JDS CBE (Common Build Environment) 1.7+.
Download the CBE from :
Ensure you select the correct architecture. Once downloaded, extract the contents from the tarball.
To install run cbe-install. This needs to be run by a user with Primary Administrator privileges. Users wishing to run and CBE once installed successfully should have at least Software Installation privileges. Privilages are easy enough to add, by either manually editing the /etc/user_attr file or using usermod(1) with the -P CLI option.
NOTE : cbe-install will build and install SVR4 packages.
5. install latest pkgbuild to get IPS support.
CBE 1.7+ includes a version of pkgbuild which at the moment does not generate IPS packages. If you just want to compile packages and generate SVR4 packages then there is no need to perform this step.
Download latest pkgbuild from here :
Which at time of writing is version 1.3.98. Remove the CBE installed version :
$ pfexec pkgrm SFpkgbuild
Use the installed CBE to build the downloaded latest pkgbuild package
$ cd pkgbuild-1.3.98 $ ./configure --prefix=/opt/dtbld/ $ make $ pfexec make install
When building some packages you may encounter ACLOCAL build failure messages.
This is caused by aclocal being unable to locate CBE m4 files installed under /opt/dtbld/share/aclocal. By default it looks in /usr/share/aclocal, it also needs to look in /opt/dtbld/share/aclocal.
To fix this ensure the file /usr/share/aclocal/dirlist exists and contains the following :
7. JDS Source and spec-files.
In order to build JDS packages you need to download the spec-files that are used by pkgbuild. You can get the latest set of JDS sources from the SVN repository with anonymous access :
$ svn co svn+ssh://firstname.lastname@example.org/svn/jds/spec-files/trunk spec-files-trunk
This will check the trunk version of spec-files into the local directory spec-files-trunk.
Bear in mind trunk is the latest development branch of JDS and some components my not build as they are being currently developed. The GNOME version on !OpenSolaris 2008.11 is 2.24, and the spec-files and JDS sources for this version can be downloaded with anonymous access as follows :
$ svn co svn+ssh://email@example.com/svn/jds/spec-files/branches/gnome-2-24 spec-files-2-24
This will check out the gnome-2-24 branch of spec-files into the local directory spec-files-2-24.
Before you can use _pkgtool_ to build JDS components, you need to ensure manpage tarballs and po-sun tarballs are created. To do this :
$ cd spec-files-2-24/manpages $ make $ cd ../po-sun $ make
8. Building JDS packages.
You are now ready to build packages for JDS packages using pkgtool. Before using pkgtool or pkgbuild you need to ensure you have the correct environment conifgured, pkgtool comes with two convenience scripts for this very purpose. For csh shell users :
$ source /opt/dtbld/bin/env.csh
For non csh shell users :
$ . /opt/dtbld/bin/env.sh
Now pkgtool will be on your path and you can build your spec file :
$ cd spec-files-2-24 $ pkgtool --download build-only SUNWblah.spec
At the moment I would recommend using the flag --with-indiana-branding. But this will likely go away in the future.
9. Generating IPS Packages
This will of course build SVR4 packages, if you want to play with IPS you need to use the --ips CLI option for pkgtool. This will build local SVR4 packages, and generate IPS packages from these and by default will populate your local package repository, http://localhost:80/
Before doing this you will of course need to enable your local repository via the smf service pkg/server as follows :
$ pfexec svcadm enable pkg/server
This will put your local IPS server online http://localhost:80/.
Now you can build your IPS package and have pkgtool populate the local server :
$ pkgtool --download --ips build-only SUNWblah.spec
10. Installing Your IPS Packages
To actually install and test your local IPS repository and the packages that you have built. Firstly you need to add your local server as an authority :
$ pfexec pkg set-authority -e -O http://localhost:80/ MyLocalRepo
This will create an authority called MyLocalRepo and enable it. To see what authorities exist :
$ pkg authority AUTHORITY URL MyLocalRepo http://localhost:80/ opensolaris.org (preferred) http://pkg.opensolaris.org/dev/
You can see what packages exist in your local repository via Package Manager GUI application or the following command will also list them :
$ pkg list -a | grep "MyLocalRepo" or $ pkg list -av SUNWblah
If you don't see your package name listed you may need to refresh and indexes :
$ pfexec pkg refresh --full $ pfexec pkg rebuild-index
Before proceeding and installing packages from your local repository it is recommended to take a snapshot of where you are currently at. This will give you the option to rollback to a given point if something goes wrong, ZFS rocks !. Use beadm to create a boot environment snapshot before you install from your local repository :
$ beadm create -a opensolaris-snap-1
This will create a boot environment snapshot which you can boot from and will return you to a point before you installed anything from your local repo. See beadm man page for more information.
Before installing your packages, if it is already installed on your system but from another authority, probably best to uninstall it first :
$ pfexec pkg uninstall SUNWblah
To install a package from your local repository you can use the Package Manager GUI application or the following command :
$ pfexec pkg install pkg://MyLocalRepo/SUNWblah
So in 8 easy steps you are building desktop packages, in 10 steps you building IPS packages!!
These steps are relatively simple to follow, especially if you are already familiar with using the JDS CBE.
There are plans on making this process really seamless, and provide a meta IPS package, which when installed will simply pull down and install all the required packages in one swoop... it's a work in progress...
Happy building !!!