From Fedora Project Wiki

Sugar Activity Packaging Guidelines

These guidelines are for packaging Sugar activities. Sugar is the core of the OLPC Human Interface.


Sugar looks for its activities in two fixed locations, which are defined in sugar-toolkit with rpm macros:

Architecture Independent (noarch):

%global sugaractivitydir /usr/share/sugar/activities/

Architecture Dependent:

%global sugarlibdir %{_libdir}/sugar/activities

Necessary BuildRequires

All Sugar Activities use, which is dependant upon sugar-toolkit. Accordingly, all activities need to:

BuildRequires: sugar-toolkit


All activities MUST be named sugar-<activity name>.

Architecture-specific Activities

All activities containing compiled code (thus, architecture-specific) must be built in the %build section. Any architecture-specific bits must either go in %{_bindir} %{_libdir} or %{sugarlibdir} as appropriate.

Runtime Dependencies

All runtime dependency information MUST be manually added. There is no build time detection for Sugar activities.

Sample SPEC

Name:           sugar-journal
Version:        79
Release:        1%{?dist}
Summary:        Journal for Sugar

Group:          Sugar/Activities
License:        GPLv2+
Source0:        journal-activity-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  python sugar-toolkit
Requires:       sugar
BuildArch:      noarch

The Journal activity provides an intuitive interface for viewing projects and
files saved by the XO user. Activities that the user has stopped will show in
the journal view with a timer showing how long ago they were stopped.

%setup -q -n journal-activity-%{version}


mkdir -p $RPM_BUILD_ROOT%{sugaractivitydir}
./ install $RPM_BUILD_ROOT%{sugaractivitydir}


%doc NEWS

* Fri Apr 04 2008 Dennis Gilmore <> - 79-1
- Initial packaging

Sample Checkout Script




git clone git://$NAME $NAME-$VERSION

tar -cjvf $NAME-$VERSION.tar.bz2 $NAME-$VERSION