Packaging:SugarActivityGuidelines

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Imported from MoinMoin)
 
(Remove "Draft" from the title; this hasn't been a draft for years.)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
<!-- page was renamed from DennisGilmore/SugarActivityGuidelines
 
<!-- page was renamed from DennisGilmore/SugarActivityGuidelines
 
-->
 
-->
= Sugar Draft Packaging Guidelines =
+
= Sugar Activity Packaging Guidelines =
 
These guidelines are for packaging Sugar activities. [http://wiki.laptop.org/go/Sugar Sugar]  is the core of the OLPC Human Interface.
 
These guidelines are for packaging Sugar activities. [http://wiki.laptop.org/go/Sugar Sugar]  is the core of the OLPC Human Interface.
  
Line 11: Line 11:
 
Architecture Independent (noarch):
 
Architecture Independent (noarch):
 
<pre>
 
<pre>
%define sugaractivitydir /usr/share/sugar/activities/
+
%global sugaractivitydir /usr/share/sugar/activities/
 
</pre>
 
</pre>
  
 
Architecture Dependent:
 
Architecture Dependent:
 
<pre>
 
<pre>
%define sugarlibdir %{_libdir}/sugar/activities
+
%global sugarlibdir %{_libdir}/sugar/activities
 
</pre>
 
</pre>
  
Line 75: Line 75:
  
 
%files
 
%files
%defattr(-,root,root,-)
 
 
%doc NEWS
 
%doc NEWS
 
%{sugaractivitydir}/Journal.activity/
 
%{sugaractivitydir}/Journal.activity/

Latest revision as of 22:32, 15 August 2012

Contents

[edit] Sugar Activity Packaging Guidelines

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


[edit] Macros

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

[edit] Necessary BuildRequires

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

BuildRequires: sugar-toolkit

[edit] Naming

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

[edit] 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.

[edit] Runtime Dependencies

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

[edit] Sample SPEC

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

Group:          Sugar/Activities
License:        GPLv2+
URL:            http://wiki.laptop.org/go/Journal
Source0:        journal-activity-%{version}.tar.bz2
Source1:        sugar-journal-checkout.sh
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

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

%description
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.

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


%build


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{sugaractivitydir}
./setup.py install $RPM_BUILD_ROOT%{sugaractivitydir}


%clean
rm -rf $RPM_BUILD_ROOT


%files
%doc NEWS
%{sugaractivitydir}/Journal.activity/


%changelog
* Fri Apr 04 2008 Dennis Gilmore <dennis@ausil.us> - 79-1
- Initial packaging

[edit] Sample Checkout Script

#!/bin/bash

VERSION=79
NAME=journal-activity

rm -rf $NAME-$VERSION

git clone git://dev.laptop.org/$NAME $NAME-$VERSION

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

rm -rf $NAME-$VERSION