Meego Wiki
Views

Release Infrastructure/Packaging

From MeeGo wiki
Jump to: navigation, search

The infrastructure team has to package various scripts and applications for our target distributions: openSuse and Debian.

Contents

Dependencies

When 'standard' modules and libraries are used they should be packaged for deployment

Ruby

openSuse

Should be done in an openSuse VM.

Tools:

 zypper in rubygem-gem2rpm rake ruby-bundler meld dbus-1-x11

Create an OBS project targeting devel:languages:ruby:extensions eg:

<project name="home:lbt:ruby">  
  <title>ruby</title>  
  <description>Packages intended for d:l:r:e
  
</description>  
  <person role="maintainer" userid="lbt"/>  
  <person role="bugowner" userid="lbt"/>  
  <repository name="devel_languages_ruby_extensions_devel_languages_ruby_openSUSE_11.2">  
    <path project="devel:languages:ruby:extensions" repository="devel_languages_ruby_openSUSE_11.2"/>  
    <arch>x86_64</arch>  
    <arch>i586</arch>  
  </repository>  
  <repository name="devel_languages_ruby_extensions_devel_languages_ruby_openSUSE_11.3">  
    <path project="devel:languages:ruby:extensions" repository="devel_languages_ruby_openSUSE_11.3"/>  
    <arch>x86_64</arch>  
    <arch>i586</arch>  
  </repository>  
</project>

Use this script to fetch and prepare a gem package

Note that some validation is done and changes to the gems may be needed.

The gem can be manipulated by using:

gem unpack TheGem.gem
# edit data and change version
gem build TheGem.gemspec


Python

Generic

Well written setup.py for setup-tools (python-setuptools in debian) :

   #!/usr/bin/python2
   from distutils.core import setup
   import os, sys
   setup(name = 'package_name',
     version = VERSION,
     description = 'short description',
     author = 'your name',
     author_email = 'your email',
     url = 'upstream url',
     scripts = ['script1', 'script2'],
     packages = ['package1', 'package2', 'package1.package3'],
           package_dir={'mypkg': 'src/mypkg'},
           package_data={'mypkg': ['data/*.dat']},
           data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
                 ('config', ['cfg/data.cfg']),
                 ('/etc/init.d', ['init-script'])]
         )

RPM based distro

generate spec file from the setup.py file and modify to your needs :

   python setup.py bdist_rpm --spec-only

DEB based distro

Easiest to use dh_auto_tools to build the deb.

debian/rules template :

   #!/usr/bin/make -f
   # Uncomment this to turn on verbose mode.
   #export DH_VERBOSE=1
   %:
       dh $@ --buildsystem=python_distutils
   #override steps if needed
   #override_dh_install:
   #	dh_install

debian/control template:

   Source: package_name
   Section: devel
   Priority: extra
   Maintainer: Your name <your email>
   Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, python-support
   Standards-Version: 3.7.2
   Homepage: upstream url
   
   Package: package_name
   Architecture: all
   Depends: ${shlibs:Depends},
        ${misc:Depends},
        ${python:Depends}
   Description: short description
       long description

Debian changelog can be generated using dch --create and incremented using dch -i. To simply refresh for actual release, use dch -r.

Personal tools