Difference between revisions of "Documentation Team/Obsolete/Services Binary Services HOWTO"
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Obsolete | Was only draft content.}} | ||
+ | |||
<noinclude> | <noinclude> | ||
{{TOCright}} | {{TOCright}} | ||
Line 4: | Line 6: | ||
</noinclude> | </noinclude> | ||
− | Work flow for services that require compilation stage: | + | Work flow for services that require a compilation stage: |
− | * | + | * Create a local, initial service.info file by invoking ''0sugar init'', then tweak the newly-created ''service/service.info'' file. |
− | * | + | * Provide a relevant value for the ''build-command'' field in the ''service.info'' file. |
− | * | + | * If you want to support binaries for different dependency environments, add additional sections to the ''service.info'' file with ''requires'' fields that describe the dependency's versions for the particular environment. |
− | * | + | * Increase/change the version field in the ''service.info'' file. |
− | * ''0sugar dist'' to add sources tarball to ''dist/'' and change local feed correspondingly | + | * Execute ''0sugar dist'' to add the sources tarball to ''dist/'' and change the local feed correspondingly. |
− | * | + | * For every platform you are trying to support binaries on, run ''0sugar dist_bin'' to build, and add to local field, binaries for this particular platform. |
− | * | + | * If you added additional sections to the ''service.info'' file, run ''0sugar dist_bin <section-name>'' in every environment that ''services.info'' has additional sections for. |
− | * ''0sugar push stable'' to rsync changed files from ''dist/'' to the server<br> | + | * Run ''0sugar push stable'' to rsync changed files from ''dist/'' to the server.<br>See [[#Release workflows]] for other release scenarios. |
== Support several ABIs of service dependencies == | == Support several ABIs of service dependencies == | ||
− | + | The file ''service.info'' could contain other sections for various binary implementations. These sections are intended to describe a particular dependency's environment and should contain only | |
− | * ''requires'' that overwrite ''Service'''s section ''requires'' | + | * the ''requires'' that overwrite ''Service'''s section ''requires'' values. |
− | For example if service developer is going to add binary implementations for | + | For example, if a service developer is going to add binary implementations for F9/F11, and the same service dependency in these distributions has different ABIs, the activity developer has to build two additional binaries, for F9 and F11. In that case, the developer creates two sections ''F9'' and ''F11'', putting the exact dependency versions (to separate a particular section from others), and invoke ''0sugar dist_bin <section-name>'' in the appropriate F9/F11 environment. |
== Development tools support == | == Development tools support == | ||
− | + | There are useful addons for popular development tools. These are optional features that simplify the service development process. | |
=== Autotools === | === Autotools === | ||
− | Add [http://git.sugarlabs.org/projects/toolkit/repos/mainline/blobs/master/m4/service.m4 service.m4] macros file to your project. It provides: | + | Add the [http://git.sugarlabs.org/projects/toolkit/repos/mainline/blobs/master/m4/service.m4 service.m4] macros file to your project. It provides the following: |
− | * ''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_INIT'', a 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 an 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_NAME'', name of service in service.info file | ||
** ''SERVICE_VERSION'', version of service in service.info file | ** ''SERVICE_VERSION'', version of service in service.info file | ||
** ''SERVICE_REVISION'', revision number from dist/revision 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_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) | + | ** ''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 | ** ''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) | + | ** ''SERVICE_EXTRA_DIST'', extra files to include to sources tarball |
+ | ** ''SERVICE_DISTCLEANFILES'', auto generated files to cleanup | ||
+ | ** 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 | ** if ''[Library]'' section exists in service.info file, macro will | ||
*** check if ''SERVICE_VERSION'' is a plain number | *** check if ''SERVICE_VERSION'' is a plain number | ||
*** export ''SERVICE_AGE'', age from ''[Library]'' section | *** export ''SERVICE_AGE'', age from ''[Library]'' section | ||
*** export ''SERVICE_LIBRARY_VERSION'' which is libtool's -version-info parameter | *** export ''SERVICE_LIBRARY_VERSION'' which is libtool's -version-info parameter | ||
− | *** if ''service.pc.in'' | + | *** if ''service.pc.in'' is present in root directory, rename it to ''DIST_NAME''.pc.in |
− | * ''SERVICE_ECHO'' convenient macro to print various variables | + | * ''SERVICE_ECHO'', a 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. | + | These macros could be used like in the [http://git.sugarlabs.org/projects/toolkit/repos/mainline/trees/master Toolkit] service. |
Latest revision as of 13:41, 25 November 2010
Support several ABIs of service dependenciesThe file service.info could contain other sections for various binary implementations. These sections are intended to describe a particular dependency's environment and should contain only
For example, if a service developer is going to add binary implementations for F9/F11, and the same service dependency in these distributions has different ABIs, the activity developer has to build two additional binaries, for F9 and F11. In that case, the developer creates two sections F9 and F11, putting the exact dependency versions (to separate a particular section from others), and invoke 0sugar dist_bin <section-name> in the appropriate F9/F11 environment. Development tools supportThere are useful addons for popular development tools. These are optional features that simplify the service development process. AutotoolsAdd the service.m4 macros file to your project. It provides the following:
These macros could be used like in the Toolkit service. |