1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Setup GAR on your own build machine

To get started you first need to equip your machine with pkgutil from OpenCSW and use it to install a set of base packages that are required for GAR.

sudo pkgutil -y -i vim gar_dev mgar gcc4core gcc4g++ sudo

Oracle Solaris Studio Compiler

You need a compiler. Most of the packages use Oracle Solaris Studio (historically called 'SOS'), which you can download from Oracle. You want to go with the packaged (non-tar) version. In case you have access to an Oracle Solaris development tools support contract, please make sure to also install the latest Oracle Solaris Studio compiler patches. The compilers should be installed at the following locations:

Sun Studio 11
/opt/studio/SOS11
Sun Studio 12
/opt/studio/SOS12
Sun Studio 12u1
/opt/studio/sunstudio12.1
Solaris Studio 12u2
/opt/solstudio12.2
Solaris Studio 12u3
/opt/solarisstudio12.3

You can install multiple versions of SOS on one system. If you have your compiler installed at a different location you can set it in your ~/.garrc with the following lines:

SOS11_CC_HOME = /opt/SUNWspro
SOS12_CC_HOME = /opt/studio12/SUNWspro

Installing Oracle Solaris Studio 12

  1. cd ss12
  2. ./batch_installer -d /opt/studio/SOS12 --accept-sla

Installing Oracle Solaris Studio 12u3

sudo ./solarisstudio.sh --non-interactive --tempdir /var/tmp

Patching the installed compilers

Remember to patch the compilers, with PCA or manually (requires a software service contract from Oracle).

Setup ~/.garrc

Finally, you need to create your personal ~/.garrc configuration file. It contains your name and e-mail adress, both of which are included in the metadata of built packages. Further, GAR needs to know where to store downloaded sources and generated packages.

Here's an example:

# Data for pkginfo
SPKG_PACKAGER   = Dagobert Michelsen
SPKG_EMAIL      = dam@opencsw.org

# Where to store generated packages
SPKG_EXPORT     = /home/dam/pkgs

# Where to store downloaded sources
GARCHIVEDIR     = /home/dam/src

# Disable package sanity checks by checkpkg if you are building on your
# own host (checkpkg depends on OpenCSW buildfarm infrastructure)
ENABLE_CHECK    = 0

In case you are sitting behind a proxy, you would also want to configure this in ~/.garrc.

http_proxy = http://proxy[:port]

You can customize several other things in ~/.garrc which we'll see later. Do not customize anything which makes the build dependant on your ~/.garrc-settings! This includes changing compilers flags, PATH, etc. This is equally true for gar.conf.mk - please don't modify it! If you feel it needs change please subscribe to the users@ mailing list and discuss your change there.

Basic git configuration

Git will be installed as one of dependencies. It is used by GAR to make source patching easier. Provide basic configuration for git:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

You also need to set up the EDITOR command, because git's expectations don't match up with the behavior of /bin/vi. Here's an example how to set it to use vim:

sudo pkgutil -y -i vim
echo "export EDITOR=/opt/csw/bin/vim" >> ~/.bashrc

Of course, it can be your editor of choice.

Initialize the source tree

As regular user (do not use root for safety reasons) to be used for building init your local repository:

mgar init [<path-for-build-recipes>] (defaults to ~/opencsw)

Please make yourself familiar with the mgar utility.

Fetch all the build recipes:

mgar up --all

Done!

Congratulations, you now have all pre-requisites in place to continue to learn building packages with GAR.