Meego Wiki
Views

SDK/Docs/1.0/Packaging/Tutorial

From MeeGo wiki
< SDK | Docs | 1.0
Revision as of 04:07, 24 May 2010 by Wwhbuaa (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

== Introduction MeeGo uses RPM as the package format. After you finish your application development work, you need to make a RPM package to publish it. This page will introduce a tutorial to create RPM package with MeeGo SDK and tools. To generate MeeGo adapted RPM packages, the MeeGo Packaging Guideline should be followed. This page will provides a simple tutorial to create a MeeGo rpm package.

Contents

Create spec file

MeeGo recommends to use Spectacle to either create MeeGo spec file or convert existing spec file to MeeGo spec file.

Install Spectacle

  • On MeeGo platform or MeeGo chroot environment, you can install it directly.
yum install spectacle

Create package meta-data file in YAML format.

Spectacle uses a package meta-data file as the input to generate MeeGo spec file. The meta-data file is in YAML format. Spectacle defines specific Syntax of Spectacle YAML.

  • An YAML file can also be created from an existing spec file:
spec2spectacle package_name.spec

Generate spec file from YAML meta-data file

With the YAML file, the spec file can be easily generated. With above simple yaml file, a file named "spectacle.spec" will be created:

specify spectacle.yaml
  • Modify the generated spec file to add customized build procedures.

Note: Normally, if all related information has been provided in .yaml file, then the spec file does not need any change.

Build rpm in MeeGo SDK chroot

For application developers, they may want to create package directly from the MeeGo SDK chroot environment. It's quite easy to use rpmbuild to do that.

  • Install rpmbuild
yum install rpmbuild
  • Generate rpm package with above "spectacle.spec"
cd ~/rpmbuild/SPECS
rpmbuild -ba spectacle.spec

Then the rpm packages will be generated and put at ~/rpmbuild/RPMS/ and ~/rpmbuild/SRPMS/.

  • More about rpmbuild can be found at rpmbuild

Build rpm on development host machine

For people who do build or release, they may just want to build packages without the MeeGo SDK chroot environment. The following steps are useful for them.

Linux

Under Linux, a tool called "build" is used to create rpm packages directly from spec file.

  • Install build on your Linux host machine. You can find the repo link and packages at MeeGo Tools Repo. Following Lnux distributions are supported
   * MeeGo
   * Fedora 10,11,12
   * openSUSE(s)    
   * xUbuntu 8.10/9.04/9.10
   * Debian 5.0   
  • Create rpm package with build and spec file
sudo build --repository http://repo.meego.com/MeeGo/release/1.0/core/repo/ia32/os/ --arch i686 spectacle.spec

The packages will be generated at /var/tmp/build-root/home/abuild/rpmbuild/RPMS/ and /var/tmp/build-root/home/abuild/rpmbuild/SRPMS/

Personal tools