Difference between revisions of "Documentation Team/Obsolete/Services Binary Services HOWTO"

From Sugar Labs
Jump to navigation Jump to search
(Created page with '<noinclude> {{TOCright}} Category:Activity Team </noinclude> Work flow for services that require compilation stage: * create local initial service.info by invoking ''0sugar…')
 
Line 14: Line 14:
 
* if you added additional sections to ''service.info'', run ''0sugar dist_bin <section-name>'' in every environment, ''services.info'' has additional sections for
 
* if you added additional sections to ''service.info'', run ''0sugar dist_bin <section-name>'' in every environment, ''services.info'' has additional sections for
 
* ''0sugar push stable'' to rsync changed files from ''dist/'' to the server<br>see [[#Release workflows]] for other release scenarios
 
* ''0sugar push stable'' to rsync changed files from ''dist/'' to the server<br>see [[#Release workflows]] for other release scenarios
 +
 +
== Development tools support ==
 +
 +
Useful addons to popular development tools. These are optional features that simplify service development process.
 +
 +
=== Autotools ===
 +
 +
Add [http://git.sugarlabs.org/projects/toolkit/repos/mainline/blobs/master/m4/service.m4 service.m4] macros file to your project. It provides:
 +
 +
* ''SERVICE_INIT'' macro to initialize services support, use it after other (AC|AM)_INIT macros like in [http://git.sugarlabs.org/projects/toolkit/repos/mainline/blobs/master/configure.ac]<br>It takes optional string to define prefix value for ''DIST_'' variables,  in most cases it should be just ''sugar''<br>Macro exports follows variables:
 +
** ''SERVICE_NAME'', name of service in service.info file
 +
** ''SERVICE_VERSION'', version of service in service.info file
 +
** ''SERVICE_REVISION'', revision number from dist/revision file
 +
** ''DIST_NAME'', combines prefix macro argument with ''SERVICE_NAME'' to use it as a distribution name(see example below)
 +
** ''DIST_VERSION'', combines ''SERVICE_VERSION'' and ''SERVICE_REVISION'' to use it as a distribution version(see example below)
 +
** ''SERVICE_SUMMARY'', summary from service.info file
 +
** macro also changes ''PACKAGE'' and ''VERSION'' variables with values from proper ''DIST_'', so it rewrites ''AC_INIT'' arguments(you have to use fake values for ''AC_INIT'' macro)
 +
** if ''[Library]'' section exists in service.info file, macro will
 +
*** check if ''SERVICE_VERSION'' is a plain number
 +
*** export ''SERVICE_AGE'', age from ''[Library]'' section
 +
*** export ''SERVICE_LIBRARY_VERSION'' which is libtool's -version-info parameter
 +
*** if ''service.pc.in'' presents in root directory, rename it to ''DIST_NAME''.pc.in
 +
 +
* ''SERVICE_ECHO'' convenient macro to print various variables
 +
 +
These macros could be used like in [http://git.sugarlabs.org/projects/toolkit/repos/mainline/trees/master Toolkit] service.

Revision as of 12:45, 15 January 2010


Work flow for services that require compilation stage:

  • create local initial service.info by invoking 0sugar init, tweak newly created service/service.info file
  • provide relevant value for build-command field in service.info file
  • if you want to support binaries for different dependencies environments, add additional sections to service.info file with requires fields that describe dependencies versions of particular environment
  • increase/change version field in service.info file
  • 0sugar dist to add sources tarball to dist/ and change local feed correspondingly
  • on every platform, you are trying to support binaries for, run 0sugar dist_bin to build, and add to local field, binaries for this particular platform
  • if you added additional sections to service.info, run 0sugar dist_bin <section-name> in every environment, services.info has additional sections for
  • 0sugar push stable to rsync changed files from dist/ to the server
    see #Release workflows for other release scenarios

Development tools support

Useful addons to popular development tools. These are optional features that simplify service development process.

Autotools

Add service.m4 macros file to your project. It provides:

  • SERVICE_INIT macro to initialize services support, use it after other (AC|AM)_INIT macros like in [1]
    It takes optional string to define prefix value for DIST_ variables, in most cases it should be just sugar
    Macro exports follows variables:
    • SERVICE_NAME, name of service in service.info file
    • SERVICE_VERSION, version of service in service.info file
    • SERVICE_REVISION, revision number from dist/revision file
    • DIST_NAME, combines prefix macro argument with SERVICE_NAME to use it as a distribution name(see example below)
    • DIST_VERSION, combines SERVICE_VERSION and SERVICE_REVISION to use it as a distribution version(see example below)
    • SERVICE_SUMMARY, summary from service.info file
    • macro also changes PACKAGE and VERSION variables with values from proper DIST_, so it rewrites AC_INIT arguments(you have to use fake values for AC_INIT macro)
    • if [Library] section exists in service.info file, macro will
      • check if SERVICE_VERSION is a plain number
      • export SERVICE_AGE, age from [Library] section
      • export SERVICE_LIBRARY_VERSION which is libtool's -version-info parameter
      • if service.pc.in presents in root directory, rename it to DIST_NAME.pc.in
  • SERVICE_ECHO convenient macro to print various variables

These macros could be used like in Toolkit service.