NAME

makedpkg - Facilitate building Debian packages with templates

VERSION

version 0.05

DESCRIPTION

The makedpkg command line application helps building Debian packages based on configuration files and templates.

OPTIONS

-c --config        configuration file (makedpkg.{yml,json,...} by default)
-v --verbose       enable verbose output
-t --templates     template directory (./makedpkg by default)
--init             initialize or update template directory
-n --dry           don't build, just show
-p --prepare       don't build, just prepare sources
-f --force         use the force, Luke!

CONFIGURATION

Unless explicitly specified via the config option, a config file with name makedpkg.yaml (or any other extension recognized by Config::Any) is expected. Important configuration variables include:

name

package name

version

package version

author

package author

changes

changes to be used in changelog template

timestamp

timestamp to be used in changelog template

section

section to be used in control template

priority

priority to be used in control template (for instance extra)

build_depends

build dependencies, to be used in control template (for instance perl (>= 5.14))

binary_depends

binary dependencies, to be used in control template

architecture

architecture, to be used in control template

description

description, to be used in control template

build

Build configuration, consisting of directory, before, files, and options.

directory

Directory to build package in (default is debuild).

before

List of commands to execute before build. Commands are executed before files are copied to the package directory, so more files can be generated or processed via commands listed in this field.

files

package files, to be used in install template (see Debian manual). Files can be specified as mapping which files to copy to which directory, such as

files:
    copy:
        "lib/*": "srv/myapp/lib"
        "index.html": "srv/myapp"

and/or as list which directories and files to copy from to which directory

files:
    to: srv/myapp
    from:
        - lib
        - index.html
command

Command to execute build. Set to debuild by default. This option can be used for instance to add command line options, e.g. debuils -uc -us.

verbose

Autmatically set to 0 or 1 by the --verbose command line flag, this variable is used to disable or enable verbose mode of debhelper in the default rules template.

CONFIGURATON EXPANSION

After reading the config file, all values having the form `...` are expanded by executing ... in a shell. For instance

curdir: `pwd`

Will be expanded by setting curdir to the output of command pwd. To give a more complex example, the following config file value can be used to get the date of the latest git commit in RFC form:

timestamp: "`git log -n1 --format=\"%ad\" --date=rfc`"

TEMPLATES

Template are evaluated with Text::Template, so make sure to escape braces ({ and }) with a backslash (\). All configuration values are available as template variables.

The CPAN distribution of this packages includes a set of default templates which are used if no template directory is selected with option templates. use --init to copy these default templates into subdirectory makedpkg for further modification.

Typical templates files include:

  • control (included as default template)

  • changelog (included as default template)

  • rules (included as default template)

  • compat (included as default template)

  • source/format (included as default template)

    You should remove this file unless you explicitly include the sources.

  • the control scripts preinst, postinst, prerm, and postrm

  • copyright

  • upstart

  • ...

SEE ALSO

The Debian New Maintainers' Guide, especially chaper 4 to 6.

AUTHOR

Jakob Voß

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Jakob Voß.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.