makedpkg - Facilitate building Debian packages with templates
version 0.05
The makedpkg command line application helps building Debian packages based on configuration files and templates.
-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!
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:
config
makedpkg.yaml
package name
package version
package author
changes to be used in changelog template
changelog
timestamp to be used in changelog template
section to be used in control template
control
priority to be used in control template (for instance extra)
extra
build dependencies, to be used in control template (for instance perl (>= 5.14))
perl (>= 5.14)
binary dependencies, to be used in control template
architecture, to be used in control template
description, to be used in control template
Build configuration, consisting of directory, before, files, and options.
directory
before
files
options
Directory to build package in (default is debuild).
debuild
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.
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
install
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 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.
debuils -uc -us
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.
0
1
--verbose
debhelper
rules
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:
curdir
pwd
timestamp: "`git log -n1 --format=\"%ad\" --date=rfc`"
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.
templates
--init
makedpkg
Typical templates files include:
control (included as default template)
changelog (included as default template)
rules (included as default template)
compat (included as default template)
compat
source/format (included as default template)
source/format
You should remove this file unless you explicitly include the sources.
the control scripts preinst, postinst, prerm, and postrm
preinst
postinst
prerm
postrm
copyright
upstart
The Debian New Maintainers' Guide, especially chaper 4 to 6.
Jakob Voß
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.
To install App::makedpkg, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::makedpkg
CPAN shell
perl -MCPAN -e shell install App::makedpkg
For more information on module installation, please visit the detailed CPAN module installation guide.