[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Integrating cdd-dev with dh-make



Hi all,

I'm going on with my analysis of the cdd source package.

As I'm going to migrate the demudi-tasks source package [0] to the new
templates provided by cdd-dev, I think I'm a perfect case of study ;-)

I think that   rather then barely providing  an  example directory for
meta-package  creation (the  one  /usr/share/doc/cdd-dev/examples), it
would  be useful  to have a  script which  takes care of transparently
instantiating such templates.

I think that dh_make is perfect for this, and  that the example of the
kernel module packages can be considered the way to go.

Quoting from dh_make man page:

PACKAGE CLASSES
       Single binary (s)
              [...]

       Multiple binary (m)
              [...]

       Library (l)
              [...]

       Kernel module (k)
              The package  will generate   a binary-all  kernel module
              -source package for  use with the make-kpkg  command. It
              also   generates   a   binary  package   for  additional
              utilities, daemons, etc. that may come with the source.

Have  a look to  /usr/share/debhelper/dh_make   to see the   templates
already available.

So why do not add a CDD category? E.g:

       CDD (c[dd?])
              The package will generate a set  of task packages, which
              are packages which do  not install any file,  but simply
              depends  on other packages. Such  packages will be named
              <packagename>-<task>, and will be generated according to
              the definition files found in the tasks/ sub-directory.
              [Add further details about menus, -common package, etc.]


So that a simple

mkdir <cdd>-0.1
cd <cdd>-0.1
dh_make --cdd

would create a basic skeleton cdd source package.

In order to do that we should simple ask to the dh_make maintainer to add a

/usr/share/debhelper/dh_make/debianc[dd?]

template directory, and a --cdd command line flag.

Or if do not want to involve him we can just move the cdd templates of
the cdd-dev packages from

/usr/share/doc/cdd-dev/examples

to

/usr/share/debhelper/dh_make/debianc[dd?]

and then call

dh_make --templates /usr/share/debhelper/dh_make/debianc

Furthermore   I'd add the  following  scripts to  the cdd-dev package,
which are sort of  debhelper tools, similar in  concept to those found
in the dh-make, dh-kpatches and dpsycho-* packages.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NAME
        cdd-addtask - add a task file

SYNOPSIS
        cdd-addtask <TASK>

DESCRIPTION
        Creates a new file in the tasks/ sub-directory of a CDD source package.
        Please fill the boiler-plate description field.


So  that issuing a  cdd-addtask  task1 from  the  command line, simply
generates a tasks/task1 file, containing:

Architecture: all
Description: Debian-_CDD_ task1 packages
 This meta package will install Debian packages for use in
 task1 of Debian-_CDD_.

It might  seem a stupid but  thing now, this way  we if we want to add
features and tags to  the task files,  we have a better framework. 

For example we may want  to add a  "Menu:" field, containing the title
of the menu branch under which all the packages of  the task should be
showed. So that the tasks/dsp file of the  demudi source package would
add "Menu: Digital Signal Processing", and have  all the relevant menu
files under the menus/   directory change accordingly somehow  (I have
still to thing about this, it's just an hypotesis).


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

NAME
        cdd-addpackage - add a package to a task file

SYNOPSIS
        cdd-addpackage [--menu] --task <TASK> <PKG>

DESCRIPTION 

        Creates a new Depends entry in the tasks/<TASK>  file of a CDD
        source package,  making the task package  depend on <PKG>.  If
        such entry already exists exits with error.

OPTIONS

        --task
                the task

        --menu

                if a menu file for <PKG> exists in /usr/lib/menu, than copy it
                in the menu/ directory [possibly replacing the section= field 
                according to the Menu: tag of the task file...]


Well... I think it's enough for now ;-)

Anyhow I'd like to underline that these are only rough ideas. The main
goal  IMHO would be to  have a  more  structured way  for creating and
modifying a cdd source package. For example this would make it simpler
to automatically  build  a draft  cdd source    package  from list  of
packages, or similar things.

bye,

free

[0] http://cvs.agnula.org/cgi-bin/cvsweb.cgi/packages/demudi-tasks/?cvsroot=demudi



Reply to: