File: debuild.1

package info (click to toggle)
devscripts 2.5.8.2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 488 kB
  • ctags: 58
  • sloc: sh: 1,422; perl: 1,033; makefile: 214
file content (96 lines) | stat: -rw-r--r-- 4,971 bytes parent folder | download
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
.TH DEBUILD 1 "Debian Utilities" "DEBIAN" \" -*- nroff -*-
.SH NAME
debuild \- build a Debian package
.SH SYNOPSIS
\fBdebuild\fR [\fIdebuild-options\fR] [\fIdpkg-buildpackage-options\fR]
[\fB\-\-lintian\fR|\fB\-L\fR \fIlintian-options\fR]
.br
\fBdebuild\fR [\fIdebuild-options\fR]
\fBbinary\fR|\fBbinary-arch\fR|\fBbinary-indep\fR|\fBclean\fR ...
.SH DESCRIPTION
\fBdebuild\fR creates all the files necessary for uploading a Debian
package.  It first runs \fBdpkg-buildpackage\fR and then runs
\fBlintian\fR on the \fI.changes\fR file created (assuming that
\fBlintian\fR is installed).  Parameters can be passed to both
\fBdpkg-buildpackage\fR and \fBlintian\fR, where the parameters are
separated by the \fB\-L\fR or \fB\-\-lintian\fR option.  The allowable
options in this case are \fB\-\-no-lintian\fR to skip the \fBlintian\fR
step and the \fB\-\-preserve-envvar\fR/\fB\-e\fR or
\fB\-\-preserve-env\fR/\fB\-E\fR options described below in the
Environment Variables section.
.PP
An alternative way of using \fBdebuild\fR is to use one or more of the
parameters \fBbinary\fR, \fBbinary-arch\fR, \fBbinary-indep\fR and
\fBclean\fR, in which case \fBdebuild\fR will attempt to gain root
privileges and then run \fIdebian/rules\fR with the given parameters.
A \fB\-rootcmd=\fIgain-root-command\fR or \fB\-r\fIgain-root-command\fR
option may be used to specify a method of gaining root privileges.
The \fIgain-root-command\fR is likely to be one of \fIfakeroot\fR,
\fIsudo\fR or \fIsuper\fR.  See below for further discussion of this
point.  Again, the environment preservation options may be used.
.PP
\fBdebuild\fR has to be invoked from within the source code package
directory tree.
.SH ENVIRONMENT VARIABLES
As environment variables can affect the building of a package, often
unintentionally, \fBdebuild\fR sanitises the environment by removing
all environment variables except for TERM, HOME, LOGNAME, PGPPASS,
PGPPATH, FAKEROOTKEY, DEB_BUILD_OPTIONS and the locale variables LANG
and LC_*.  TERM is set to `dumb' if it is unset, and PATH is set to
"/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11".
.PP
If a particular environment variable is required to be passed through
untouched to the build process, this may be specified by using a
\fB\-\-preserve-envvar\fR \fIenvvar\fR (which can also be written as
\fB\-e\fR \fIenvvar\fR option).  The environment may be left untouched
by using the \fB\-\-preserve-env\fR or \fB\-E\fR option.  However, even
in this case, the PATH will be set to the sane value described above.
The \fBonly\fR way to prevent PATH from being reset is to specify a
\fB\-\-preserve-envvar PATH\fR option.  But you are warned that using
programs from non-standard locations can easily result in the package
being broken, as it will not be able to be built on standard systems.
.SH REQUIREMENTS
\fBdebuild\fR needs to be run as superuser to function properly.
There are three fundamentally different ways to do this.  The first,
and preferable, method is to use some root-gaining command.  The best
one to use is probably \fBfakeroot\fR(1), since it does not involve
granting any genuine privileges.  \fBsuper\fR(1) and \fBsudo\fR(1) are
also possibilities.  If no \fB\-r\fR ( or \fB\-\-rootcmd\fR) option is
given (and recall that \fBdpkg-buildpackage\fR also accepts a \fB\-r\fR
option) and neither of the following methods is used, then
\fB\-rfakeroot\fR will silently be assumed.
.PP
The second method is to use some command such as \fBsu\fR(1) to become
root, and then to do everything as root.  Note, though, that
\fBlintian\fR will abort if it is run as root or setuid root; this can
be overcome using the \fB\-\-allow-root\fR option of \fBlintian\fR if
you know what you are doing.
.PP
The third possible method is to have \fBdebuild\fR installed as setuid
root.  This is not the default method, and will have to be installed
as such by the system administrator.  It must also be realised that
anyone who can run \fBdebuild\fR as root or setuid root has \fBfull
access to the whole machine\fR.  This method is therefore not
recommended, but will work.  \fBdebuild\fR could be installed with
mode 4750, so that only members of the owning group could run it.  A
disadvantage of this method would be that other users would then not
be able to use the program.  There are many other variants of this
option involving multiple copies of \fBdebuild\fR, or the use of
programs such as \fBsudo\fR or \fBsuper\fR to grant root privileges to
users selectively.  The sysadmin would also need to set up the
permissions again after each upgrade of devscripts, although this can
be automated using the \fBsuidmanager\fR program.
.SH "SEE ALSO"
.BR dpkg-buildpackage (1),
.BR fakeroot (1),
.BR lintian (1),
.BR chmod (1),
.BR suidmanager (1),
.BR su (1),
.BR sudo (1)
and
.BR super (1).
.SH AUTHOR
The original debuild program was written by Christoph Lameter
<clameter@debian.org>.  The current version has been written by Julian
Gilbey <jdg@debian.org>.