1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
Notes on the build system: -*- Text -*-
-------------------------
This package uses an experimental new debian/rules helper, a makefile
called "librules.mk", which does all the boring work of building a
package.
Usage:
Include "debian/librules.mk" in the top of your debian/rules. Precede
it with a variable definition "native_pkg=yes" if the package you are
building is a Debian native package.
Define a target debian/stamp/build that builds the package (like the
build target does in conventional debian/rules files). Put "touch $@"
as the last action in that rule.
Define targets debian/stamp/binary/indep and debian/stamp/binary/arch
that correspond to the binary-arch and binary-indep targets in
conventional rules files. The last action in both targets needs to be
"touch $@".
For every binary package <package> you want to build:
- If the package is "arch: all", make debian/stamp/binary/indep depend
on debian/stamp/binary/<package>; otherwise make debian/stamp/binary/arch
depend on that target
- Write a target debian/stamp/binary/<package> using the following template:
debian/stamp/binary/<package>: package=<package>
debian/stamp/binary/<package>: debian/stamp/build
$(prebinary)
# Add here your own commands
$(postbinary)
touch $@
The $(prebinary) macro will create a skeletal build tree for the
package. It also installs debian/prerm.<package> and
debian/postinst.<package> as the prerm and postinst scripts;
it will also install the copyright file (debian/copyright)
and the Debian changelog file (debian/changelog).
See below for instructions about how to write your own install commands.
The $(postbinary) macro fixes directory permissions, generates the binary
control file and builds the package.
- You may want to define targets "clean", "clean-binary" and "clean-build"
to reverse the effects of your own commands in the build and binary targets.
The librules.mk file cleans up for itself, you don't need to worry about that.
How to write your own commands for binary targets:
Use the following macros to install files:
$(install_exec) SOURCE TARGET
$(install_exec) SOURCE SOURCE ... DIRECTORY
installs one or more binary executables
(TARGET need not be a directory name)
$(install_nonex) SOURCE TARGET
$(install_nonex) SOURCE SOURCE ... DIRECTORY
install one or more non-executable files
(TARGET need not be a directory name)
$(install_dir) DIRECTORY
create the directory
$(install_script) SOURCE TARGET
$(install_script) SOURCE SOURCE ... DIRECTORY
install one or more executable scripts
(TARGET need not be a directory name)
The macros above are wrappers around the "install" utility.
$(install_symlink) SOURCE [TARGET]
Install a symlink from SOURCE to TARGET
(This macro is a wrapper around ln -s)
$(gzip) FILE ...
Compress the given files
(This is a wrapper around gzip)
$(strip_lib) FILE ...
Strip the given files the way shared libraries are stripped
(This is a wrapper around strip)
*Never* refer to a file in the install target tree by their real name.
Use the following macros instead:
$(rootdir) - the directory that masquerades as / in the target tree
(usually a subdirectory under debian/tmp)
$(ctldir) - the directory where control files are installed
(usually $(rootdir)/DEBIAN)
$(bindir) - the main binary directory
(usually $(rootdir)/usr/bin)
$(docdir) - the main doc directory
(usually $(rootdir)/usr/share/doc/<package>)
...
(see librules.mk for what's available)
|