Differences between revisions 24 and 25
Revision 24 as of 2015-09-21 08:45:59
Size: 4184
Editor: Praveen A
Revision 25 as of 2015-09-21 12:02:31
Size: 4208
Editor: Praveen A
Deletions are marked like this. Additions are marked like this.
Line 82: Line 82:
lintian -iIEcv --pedantic --color auto ../ruby-devise*.changes lintian ../ruby-devise*.changes
Line 87: Line 87:
Note: make sure you give correct path to changes file

Translation(s): none

Building with gem2deb

Note: Always verify the command has finished successfully and make sure there is no error before proceeding to next command.

Setup your environment

Add the following variables in your ~/.bashrc file. DEBEMAIL and DEBFULLNAME variables are used by debian tools to set your name and email.

export DEBEMAIL=your@email.domain
export DEBFULLNAME='Your Name'
alias lintian='lintian -iIEcv --pedantic --color auto'
alias git-import-dsc='git-import-dsc --author-is-committer --pristine-tar'
alias clean='fakeroot debian/rules clean'

Note: You can also use debclean command instead of setting alias for clean.

and update your current environment by running

$ source ~/.bashrc

Build the package

First you need install gem2deb

apt-get install gem2deb

Create a build directory and go there

mkdir -p ~/Build/diaspora-packaging && cd $_

You might also want to create a directory for your package

mkdir build_devise && cd $_

and then run

gem2deb devise

will run "gem fetch devise" to download the package.

  1. If you get an error that the Test failed, see ruby tests for hints to solve it.

  2. If you see "unmet build dependencies" error, install the build dependencies.

Note: To fetch rails-assets-* gems, you need to provide a different gem source like this example

You will see a directory created with your package name, and change to that directory (substitute actual version for x.y.z)

cd ruby-devise-x.y.z

Now you have to edit files inside debian subdirectory like

  • copyright
  • control
  • changelog

You will find such info at

  • rubygems (search for your gem and open the matching result) and the homepage of the package. The homepage you will find at rubygems too (right section). Usually there is a 'LICENSE' or 'COPYING' or README.{md,rdoc} file in the source which gives such information.

Note: Read http://www.debian.org/doc/manuals/maint-guide/dreq.en.html to learn more about each file.

Once that is done build the package with


If you get an error that it could not be signed, ignore it for now.

And when it has finished check for lintian errors:

lintian ../ruby-devise*.changes

If you get errors, you have to correct them. Then run dpkg-buildpackage again and test with lintian again.

Note: make sure you give correct path to changes file

Rails engines

If your package has a app/assets or vendor/assets (if the gem name starts with rails-assets or ends at rails) then your package is a rails engine. More about rails engines

  • 1 Install app or vendor in /usr/share/<package name> using debian/install

    2 Set rails engine root with quilt to /usr/share/<package name>. Look for 'class Engine < ::Rails::Engine' in lib/<gem name>.rb or lib/<gem name>/engine.rb and add config.root = '/usr/share/<package name>' like this

 if defined?(Rails)
    class Engine < ::Rails::Engine
      # Rails -> use app/assets directory.
      config.root = '/usr/share/ruby-rails-assets-jquery.slimscroll'
  • 3 Add a smoke test like this

Javascripts should be packaged as libjs-<js library name> if it is not packaged already (create a new binary package in debian/control and add 'Section: web' and create libjs-<js library name>.install).

Declare dependency on libjs-<js library name> and create a <package name>.links file.

Refer to ruby-rails-assets-favico.js] package for an example.