EnvironmentSetup/0sugar

Back to Environment Setup

The purpose of this Guide is to describe how to build binaries for 0install OOo4Kids feed.

It is not about creating 0install feed directly but about using 0sugar, high level tool that lets creating spec files (similar to RPM spec files) and generates 0install files from such spec files.

Setup environment

 * Install the latest version of zeroinstall-injector, 0sugar relies on recent 0install features and natively packaged 0install version could be too old.

echo 'PATH=~/.local/bin:$PATH' >> ~/.bashrc
 * Tweak the PATH environment variable (you need to relogin) to make ~/.local/bin path accessible:

0alias 0sugar http://services.sugarlabs.org/0sugar
 * Register 0sugar alias, main packaging tool

0alias 0export http://services.sugarlabs.org/0export
 * Register 0export alias, will be used to create installer


 * 0install feeds should be signed, so install gnupg and create at least one key (for more than one keys, use --key 0sugar argument to chose right one) to sign newly generated feeds

All 0sugar command calls should happen within OOo4Kids sources directory (there is no need in being in the root).

While working, 0sugar command will create local repository in .0sugar sub-directory. This directory could be removed at any time if you don't need results since last uploading to the server.

One of .0sugar sub-directories is remote directory that contains files that should go to the server. All files related to this project are placed to separate directory on the server and remote directory is a mirror (in most cases, not full). To upload/download files between remote directory and server, 0sugar uses rsync command. Particular rsync destination path could be passed to 0sugar by --rsync-path argument. Default value is sunjammer.sugarlabs.org:/upload/services. So, OOo4Kids 0install files are hosted on Sugar Labs server. To get access to sunjammer sever, please make a request or use your own rsync path.

If you all time use 0sugar arguments like --rsync-path or --key, define ZSUGAR_OPTIONS environment variable with all arguments you are using.

Build
Scenario to build tarballs is described in 0sugar/service.info file (see 0sugar specification).

To build OOo4Kids just run: 0sugar build -i

where -i will reuse source directory without need to create sources tarball (it is useless to create sources tarball for huge projects like OO). Build will happen in ''.0sugar/build.  directory and final tarballs will be placed to .0sugar/remote''.

If you already have any-arch tarballs built in .0sugar/remote directory and need only to create/rebuild binaries, pass -B argument: 0sugar build -iB

Upload files
At any time you can upload .0sugar/remote content to the server: 0sugar commit

Pass -v argument to get rsync verbose output.

Make an installer
In most cases OOo4Kids users can follow regular 0install workflow for OOo4Kids feed. But if user doesn't know what 0install is, installer could be useful.

Followed command creates lightweight installer (-n argument) which contains only bundled 0install distribution and will create menu items and start OOo4Kids downloading on launch.

0export -j http://services.sugarlabs.org/zeroinstall-injector -n http://services.sugarlabs.org/ooo4kids ooo4kids-install.sh