COWPOKE(1)
π COWPOKE(1) π
General Commands Manual Β· COWPOKE(1)
okay bestie sit DOWN because we're about to talk about cowpoke, and she is that girl. no cap.
β¨ NAME β¨
cowpoke β build a Debian source package in a remote cowbuilder instance ππ«Ά
πΈ SYNOPSIS πΈ
cowpoke [options] packagename.dsc
π¦ DESCRIPTION π¦
So what she does is: she uploads a Debian source package to a cowbuilder host and builds it there. and then, if you want, she'll also sign the result and upload it to an incoming queue. lowkey iconic. it's giving "I do your builds so you don't have to." π
π OPTIONS π
the following options are available, and yes we're going through every single one, because we respect her:
--arch=architectureβ specify the Debian architecture(s) to build for. you can pass a space separated list of architectures and she'll build for all of them in a single pass, slay. valid arch names are whateverdpkg-architecture(1)returns forDEB_BUILD_ARCH.--dist=distributionβ specify the Debian distribution(s) to build for. space separated list works here too, builds for all of them in one pass β¨. you can use either codenames (likesid, orsqueeze) or distribution names (likeunstable, orexperimental), but fr fr you should usually just pick one style and stick with it consistently, because this name might get used in file paths and to locate old packages for comparison reporting.
okay and here's the tea: you can now also use locally defined names with this option when you use it together with the BASE_DIST option in a configuration file. this lets you keep and use specially configured build chroots β ones that can source package dependencies from the backports archives or a local repository, or that have other unusual configuration options set β without polluting the chroots you use for clean package builds meant for upload to the main repositories. see the description of BASE_DIST below. π
--buildd=hostβ specify the remote host to build on.--buildd-user=nameβ specify the remote user to build as.--createβ create the remote cowbuilder root if it doesn't already exist. if you don't pass this option, it's an error for the specified--distor--archto not have an existing cowbuilder root in the expected location. π
heads up bestie: for this option to succeed, the--buildd-usermust have permission to create theRESULT_DIRon the build host. or an admin with the necessary permission has to create it first and give that user (or some group they're in) write access to it. no permission, no chroot. periodt.
--return=[path]β copy results of the build to path. if path isn't specified, she returns them to the current directory. and important: the given path must exist, she will not create it. π--no-returnβ do not copy results of the build toRETURN_DIR. this overrides a path set for it in the configuration files.--dpkg-opts='opt1 opt2 ...'β specify additional options to be passed todpkg-buildpackage(1). multiple options are delimited with spaces. this will override any options specified inDEBBUILDOPTSin the build host'spbuilderrc. π₯--create-opts='cowbuilder option'β specify additional arguments to be passed verbatim to cowbuilder when a chroot is first created (using the--createoption above). if you need to pass multiple arguments, specify this option separately for each one.
E.g.:
--create-opts "--othermirror" --create-opts "deb http://..."
this option will override any CREATE_OPTS specified for a chroot in the cowpoke configuration files.
--update-opts='cowbuilder option'β specify additional arguments to be passed verbatim to cowbuilder if the base of the chroot is updated. multiple arguments? same deal, specify this option separately for each of them.
this option will override any UPDATE_OPTS specified for a chroot in the cowpoke configuration files.
--build-opts='cowbuilder option'β specify additional arguments to be passed verbatim to cowbuilder when a package build is performed. again, multiple arguments means specifying this option separately for each one.
this option will override any BUILD_OPTS specified for a chroot in the cowpoke configuration files.
--sign=keyidβ specify the key to sign packages with. this will override anySIGN_KEYIDspecified for a chroot in the cowpoke configuration files. π--upload=queueβ specify thedputqueue to upload signed packages to. this will override anyUPLOAD_QUEUEspecified for a chroot in the cowpoke configuration files.--helpβ display a brief summary of the available options and current configuration. (bestie behaviour honestly π«Ά)--versionβ display the current version information. β
β¦and that's where part 1 ends, don't go anywhere, there's more coming π
πΈ CONFIGURATION OPTIONS πΈ
okay bestie so here's the tea: when cowpoke runs, it goes looking for these config options in your global, per-user, and per-project config files (if they exist). File paths can be absolute or relative β and if they're relative, they're relative to the BUILDD_USER's home directory. And because these paths are usually quoted when you use them, tilde expansion will not happen on them. sad but true. π
π Global defaults π
these apply to every arch and dist in a single cowpoke invocation. one run, all the vibes.
BUILDD_HOSTβ the network address or fqdn of the build machine where cowbuilder is configured. you can override this with the--builddcommand line option.BUILDD_USERβ the unprivileged user name for operations on the build machine. it defaults to the local name of the user executing cowpoke (or to a username that's specified in your SSH configuration forBUILDD_HOST), and you can override it with the--buildd-usercommand line option.BUILDD_ARCHβ the Debian architecture(s) to build for. this must match theDEB_BUILD_ARCHof the build chroot being used. defaults to the local machine architecture where cowpoke is executed, and can be overridden with the--archcommand line option. you can throw a (quoted) space separated list of architectures here to build for all of them in a single pass. efficiency queen. πBUILDD_DISTβ the Debian distribution(s) to build for. a (quoted) space separated list of distributions works here too, building all of them in one pass. overridable with the--distcommand line option.INCOMING_DIRβ the directory path on the build machine where the source package will initially be placed. this must be writable by theBUILDD_USER.PBUILDER_BASEβ the filesystem root for all pbuilder CoW and result files. arch and dist specific subdirectories will normally be created under this. the apt cache and temporary build directory also live under this path.SIGN_KEYIDβ if this is set, it's expected to contain the OpenPGP key ID to pass todebsign(1)if the packages are to be remotely signed. you'll be prompted to confirm whether you want to sign the packages after all builds are complete. if this option is unset or an empty string, no attempt to sign packages will be made, periodt. it can be overridden on an arch and dist specific basis using thearch_dist_SIGN_KEYIDoption described below, or per-invocation with the--signcommand line option.UPLOAD_QUEUEβ if this is set, it's expected to contain a 'host' specification fordput(1)which will be used to upload them after they're signed. you'll be prompted to confirm whether you want to upload the packages after they're signed. if this option is unset or an empty string, no attempt to upload packages will be made. and heads up: ifSIGN_KEYIDis not set, this option will be ignored entirely. it can be overridden on an arch and dist specific basis using thearch_dist_UPLOAD_QUEUEoption described below, or per-invocation with the--uploadcommand line option.BUILDD_ROOTCMDβ the command to use to gain root privileges on the remote build machine. if unset, the default issudo(8). this is only required to invoke cowbuilder and allow it to enter its chroot, so you may restrict this user to only being able to run that command with escalated privileges. something like this in sudoers will enable invoking cowbuilder without an additional password entry required:
youruser ALL = NOPASSWD: /usr/sbin/cowbuilder
alternatively you could use SSH with a forwarded key, or whatever other mechanism suits your local access policy. using su -c isn't really suitable here due to its quoting requirements being somewhat different to the rest. π
DEBOOTSTRAPβ the utility to use when creating a new build root. alternatives aredebootstraporcdebootstrap.RETURN_DIRβ if set, package files resulting from the build will be copied to the path (local or remote) that this is set to, after the build completes. the path must exist, it will not be created. this option is unset by default and can be overridden with--returnor--no-return.
π¦ Arch and dist specific options π¦
these are variables of the form: $arch_$dist_VAR which apply only for a particular target arch/dist build. so like, very specific. very targeted. main character of one build only. β¨
arch_dist_RESULT_DIRβ the directory path on the build machine where the resulting packages (source and binary) will be found, and where older versions of the package that were built previously may be found. if any such older packages exist,debdiffwill be used to compare the new package with the previous version after the build is complete, and the result will be included in the build log. files in it must be readable by theBUILDD_USERfor sanity checking withlintian(1)anddebdiff(1), and for upload withdput(1). if this option is not specified for some arch and dist combination then it will default to$PBUILDER_BASE/$arch/$dist/result.arch_dist_BASE_PATHβ the directory where the CoW master files are to be found (or created if the--createcommand line option was passed). if this option is not specified for some arch or dist then it will default to$PBUILDER_BASE/$arch/$dist/base.cow.arch_dist_BASE_DISTβ the code name to pass as the--distributionoption for cowbuilder instead ofdist. this is necessary whendistis a locally significant name assigned to some specially configured build chroot, such as'wheezy_backports', and not the formal suite name of a distro release known to debootstrap. this option cannot be overridden on the command line, since it would rarely, if ever, make any sense to change it for individual invocations of cowpoke. if this option is not specified for an arch and dist combination then it will default todist.arch_dist_CREATE_OPTSβ a bash array containing additional options to pass verbatim to cowbuilder when this chroot is created for the first time (using the--createoption). this is useful when options like--othermirrorare wanted to create specialised chroot configurations such as'wheezy_backports'. by default this is unset. all values set in it will be overridden if the--create-optsoption is passed on the command line.
each element in this array corresponds to a single argument (in the ARGV sense) that will be passed to cowbuilder. this ensures that arguments which may contain whitespace or have strange quoting requirements or other special characters will not be mangled before they get to cowbuilder. π«Ά
bash arrays are initialised using the following form:
OPTS=( "arg1" "arg 2" "--option" "value" "--opt=val" "etc.
etc." )
arch_dist_UPDATE_OPTSβ a bash array containing additional options to pass verbatim to cowbuilder each time the base of this chroot is updated. it behaves similarly to theCREATE_OPTSoption above, except for acting when the chroot is updated.arch_dist_BUILD_OPTSβ a bash array containing additional options to pass verbatim to cowbuilder each time a package build is performed in this chroot. this is useful when you want to use some option like--twicewhich cowpoke does not directly need to care about. it otherwise behaves similarly toUPDATE_OPTSabove except that it acts during the build phase of cowbuilder.arch_dist_SIGN_KEYIDβ an optional arch and dist specific override for the globalSIGN_KEYIDoption.arch_dist_UPLOAD_QUEUEβ an optional arch and dist specific override for the globalUPLOAD_QUEUEoption.
π CONFIGURATION FILES π
here's where cowpoke goes looking for all of the above, in order:
/etc/cowpoke.confβ global configuration options. will override hardcoded defaults.~/.cowpokeβ per-user configuration options. will override any global configuration..cowpokeβ per-project configuration options. will override any per-user or global configuration if cowpoke is called from the directory where they exist.
if the environment variable COWPOKE_CONF is set, it specifies an additional configuration file which will override all of those above. and options specified explicitly on the command line override all configuration files. the hierarchy is real and it's giving strict. π
π COWBUILDER CONFIGURATION π
Okay bestie, here's the tea: there is literally nothing special you gotta do to set up a cowbuilder instance for cowpoke. Like, none. Zero. Nada. β¨
- Just make them in whatever flavour you need with
cowbuilder --create, following the cowbuilder documentation like a good little devotee. - Then configure cowpoke with the user, arch, and path info it needs to reach that instance β on the machines you wanna invoke it from.
- OR, plot twist π: configure cowpoke with the path, arch, and distribution info instead, and just pass the
--createoption on the very first invocation.
And here's the cute part: the build host running cowbuilder does not need cowpoke installed locally. It's giving independent queen energy. π
The build machine should have the lintian and devscripts packages installed so you get that post-build sanity checking. Because we love a vibe check. π§ When it's all done, the build log and the results of the automated checks get recorded in the INCOMING_DIR.
Wanna upload signed packages? Then the build machine also needs dput(1) installed, configured to use the 'host' alias that UPLOAD_QUEUE specifies. Slay. π
And if rsync(1) is available on both the local and build machine, it'll be used to transfer the source package. Lowkey a lifesaver β it can save on some transfers of the orig.tar.* when you're building subsequent Debian revisions. Obsessed. πΈ
The user executing cowpoke must have SSH access to the build machine as the BUILDD_USER. And that user must be able to invoke cowbuilder as root by using the BUILDD_ROOTCMD. Root access, bestie, we love a main character with power. π
Signing keys? Not required on the build machine β and they'll be ignored there if they are present, sorry not sorry. π But if the package is signed, keys will be expected on the machine that executes cowpoke. That's the rule, periodt.
When cowpoke gets invoked, first thing it does is try to update the cowbuilder image β but only if that hasn't already been done on the same day. ποΈ
How does it know? By the presence or absence of a cowbuilder-$arch-$dist-update-log-$date file in the INCOMING_DIR. It's literally just vibes and file names.
You may move, remove, or touch this file if you want the image updated more or less often than that. Your file, your rules. β¨ And its contents? They log the output of cowbuilder during the update (or creation) of the build root.
β οΈ NOTES β οΈ
Okay so, real talk, not to be dramatic but: since cowbuilder creates a chroot, and to do that you need root, cowpoke also requires some degree of root access. Which means all the horrible things that can go wrong with that may well one day rain down upon you. π
cowbuilder has been known to accidentally wipe out bind-mounted filesystems outside the chroot. And worse than that can easily happen. So be careful, keep good backups of things you don't want to lose on your build machine, and use cowpoke to keep all that on a machine that isn't your bleeding edge dev box with your last few hours of uncommitted work.
Fr fr, protect your uncommitted work. It's giving fragile. π
π SEE ALSO π
cowbuilder(1)pbuilder(1)ssh-agent(1)sudoers(5)
π AUTHOR π
cowpoke was written by Ron <ron@debian.org>.
And that's the whole page, bestie!! π This was COWPOKE(1), dated April 28, 2008 β go forth and build your packages, and remember: back up your stuff first. π
β¨
π¦ where this page comes from
- debian trixie: devscripts 2.25.15+deb13u1 Β· GPL-2.0-or-later
- fedora 43: devscripts 2.25.19-2.fc43 Β· GPL-2.0-or-later
- fedora 43: devscripts 2.25.33-1.fc43 Β· GPL-2.0-or-later
- fedora 44: devscripts 2.26.5-1.fc44 Β· GPL-2.0-or-later
- ubuntu questing: devscripts 2.25.19ubuntu2
- ubuntu resolute: devscripts 2.26.7 Β· GPL-2.0-or-later
- ubuntu stonking: devscripts 2.26.11ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms