.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "dgit-downstream-dsc 7" .TH dgit-downstream-dsc 7 "Debian Project" "perl v5.24.1" "dgit" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" dgit\-downstream\-dsc \- setting up dgit push for a new distro .SH "INTRODUCTION" .IX Header "INTRODUCTION" This document is aimed at downstreams of Debian. It explains how you can publish your packages' source code both as traditional Debian source packages, and as git branches, using \fBdgit push\fR. Your users will be able to get the source with \fBdgit clone\fR, or with traditional tools such as \fBapt-get source\fR. .PP Note that often it is unnecessary to publish traditional source packages. Debian-format source packages can be complex, idiosyncratic and difficult to work with. You should avoid them if you can. If you do not need to publish source packages, you can work as a Debian downstream purely using git branches, (using dgit to get the source from Debian in git form). You can build binaries directly from git, and push package source code as a git branch to an ordinary git server. See \fIdgit\-user\fR\|(7). .PP Not every option is covered here. \&\fIdgit\fR\|(1) has a mostly-complete list of config options, although not always with useful descriptions. .SH "NAMES" .IX Header "NAMES" You need to choose some names. .IP "\fIdistro\fR name" 4 .IX Item "distro name" dgit understands each thing it interacts with as a \fBdistro\fR. So in dgit terms, you are setting up a distro. .Sp You need a name for yourself (ie for your distro). The name will appear in the git tags made by your tools, and in configuration settings. It must be globally unique across all people and institutions who use dgit. .Sp You could choose your organisation's domain name, or a part of it if you think that is going to be very unique. .Sp The distro name may contain ascii alphanumerics and \fB. + \-\fR, although \fB\-\fR may be confusing and is probably best avoided. Try to avoid uppercase letters (and underscore): you will be typing this name a lot. .Sp For example, if you were the Free Software Foundation Europe (fsfe.org) you might call your distro fsfe or fsfe.org. In the rest of this document we will write \&\fIdistro\fR for your distro name. .IP "\fIsuite\fR names" 4 .IX Item "suite names" In dgit and Debian archive terminology, a \fBsuite\fR is a line of development, and/or a Debian release. For example, at the time of writing, Debian has suites like \&\fBsid\fR aka \fBunstable\fR, \fBbuster\fR aka \fBtesting\fR, and \fBstretch\fR aka \fBstable\fR. There are also ancillary suites like \fBstretch-security\fR. .Sp If your releases align with Debian's releases, then your suites should contain the Debian suite names. \&\fBDo not\fR use just the Debian names. That will cause confusion. Instead, prepend your organisation's name and a hyphen. For example, \s-1FSFE\s0 might end up with suites like fsfe-stretch. .Sp Suite names end up in git ref and branch names, and on dgit command lines. Suite names can contain alphanumerics and \f(CW\*(C`\-\*(C'\fR. Other characters may work but are not recommended. .SH "SERVICES" .IX Header "SERVICES" You will need to run two parallel services: .IP "git server" 4 .IX Item "git server" This will hold the git branches accessed by dgit. .Sp Everyone who will use dgit push needs to be able to update \&\fBrefs/dgit/\fR\fIsuite\fR (note, not \fBrefs/heads/dgit/\fR\fIsuite\fR) on that server, and to make tags \&\fIdistro\fR\fB/\fR\fIversion\fR and \fBarchive/\fR\fIdistro\fR\fB/\fR\fIversion\fR. Normally this would be done over ssh. .Sp The server may host other branches and tags too. So this might be your ordinary git server, or an instance of a git hosting system. .Sp Everyone who obtains one of your source packages, or who will run \fBdgit clone\fR and \fBdgit fetch\fR, needs to have at least read access to the git server. Ideally everything would be published via the git smart https protocol. .Sp The git server name, and public git url structure, should be chosen so they will not need to change in the future. Best is to give the git server a \s-1DNS\s0 name of its own. .Sp Debian's dgit git server has special access control rules, implemented in \fBdgit-repos-server\fR and \fBdgit-repos-policy-debian\fR in the package \fBdgit-infrastructure\fR. but in most installations this is not needed. If there is no or little distinction between (i) developers who are entitled to upload (push) and (ii) repository administrators, then it is sufficient to provide a git server with a unix account for each user who will be pushing, perhaps using ssh restricted commands. .IP "Debian-format archive (repository)" 4 .IX Item "Debian-format archive (repository)" This holds the source packages. You will probably use the same archive to host your binaries, and point your \fBapt\fR at it. .Sp dgit uses the term \fBarchive\fR for this. .Sp There are a variety of tools for creating and managing a Debian-format archive. In this document we will assume you are using \fBreprepro\fR. .Sp Setting up reprepro is not covered in this tutorial. Instead, we assume you already have reprepro working. .Sp You should also write appropriate dput configuration, since dgit uses dput to upload packages to the archive. This will involve choosing a dput host name. That's probably your distro name, \fIdistro\fR. .SH "CONFIGURATION" .IX Header "CONFIGURATION" When you have all of the above set up, you are ready to explain to dgit how to access your systems. .PP dgit is configured via git's configuration system, so this is done with git configuration. See \fIgit\-config\fR\|(1). .PP Below, each heading is one or more git config keys. \&\fBbold\fR is literal text and \fIitalics\fR is things that vary. In the descriptions of the effects of config settings, we refer to the config values \f(CW\*(C`like this\*(C'\fR. .IP "\fBdgit-distro.\fR\fIdistro\fR\fB.git\-url\fR, \fB.git\-url\-suffix\fR" 4 .IX Item "dgit-distro.distro.git-url, .git-url-suffix" Specify the publicly accessible git URLs for your dgit git server. The urls generated are \&\f(CW\*(C`git\-url\*(C'\fR\fB/\fR\fIpackage\fR\f(CW\*(C`git\-url\-suffix\*(C'\fR .Sp The url should be stable, and publicly accessible, because its name is published in .dsc files. (Note that if you make modified versions of packages from Debian, the copyleft licences used for Free Software often require you to permit your users, employees, and downstreams to further distribute your modified source code.) .IP "\fBdgit-distro.\fR\fIdistro\fR\fB/push.git\-host\fR" 4 .IX Item "dgit-distro.distro/push.git-host" The domain name of your git server's ssh interface. .IP "\fBdgit-distro.\fR\fIdistro\fR\fB/push.git\-user\-force\fR \fBdgit-distro.\fR\fIdistro\fR\fB/push.username\fR" 4 .IX Item "dgit-distro.distro/push.git-user-force dgit-distro.distro/push.username" Some git hosting systems expect everyone to connect over ssh as the same user, often \fBgit\fR. If this is the case, set \f(CW\*(C`git\-user\-force\*(C'\fR to that user. .Sp If you have a normal git over ssh arrangement, where people ssh as themselves, leave \f(CW\*(C`git\-user\-force\*(C'\fR unset. If a user wishes to override the username (for example, if their local username is not the same as on the server) they can set \f(CW\*(C`username\*(C'\fR. .IP "\fBdgit-distro.\fR\fIdistro\fR\fB/push.git\-url\fR" 4 .IX Item "dgit-distro.distro/push.git-url" Set this to the empty string. This will arrange that push accesses to the ssh server will use \&\f(CW\*(C`/push.git\-host\*(C'\fR, etc. .IP "\fBdgit-distro.\fR\fIdistro\fR\fB/push.git\-proto\fR \fBgit+ssh://\fR" 4 .IX Item "dgit-distro.distro/push.git-proto git+ssh://" .PD 0 .ie n .IP """dgit\-distro.""\fIdistro\fR\fB/push.git\-path\fR" 4 .el .IP "\f(CWdgit\-distro.\fR\fIdistro\fR\fB/push.git\-path\fR" 4 .IX Item "dgit-distro.distro/push.git-path" .PD The path to your repositories. dgit push will try to push to \&\f(CW\*(C`git\-proto\*(C'\fR[\f(CW\*(C`git\-user\-force\*(C'\fR|\f(CW\*(C`username\*(C'\fR\fB@\fR]\f(CW\*(C`git\-path\*(C'\fR\fB/\fR\fIpackage\fR\fB.git\fR .IP "\fBdgit-distro.\fR\fIdistro\fR\fB.git\-check\fR, \fB.git\-check\-suffix\fR" 4 .IX Item "dgit-distro.distro.git-check, .git-check-suffix" dgit clone needs to be able to tell whether there is yet a git repository for a particular package. .Sp If you always have a git repository for every package in your archive, perhaps because you never use dput/dupload, and always dgit push, set \f(CW\*(C`git\-check\*(C'\fR to \fBtrue\fR. .Sp Otherwise, set \f(CW\*(C`git\-check\*(C'\fR to a url prefix \- ideally, https. dgit clone will try to fetch \&\f(CW\*(C`git\-check\*(C'\fR\fB/\fR\fIpackage\fR\f(CW\*(C`git\-check\-suffix\*(C'\fR and expect to get either some successful fetch (it doesn't matter what) or a file not found error (http 404 status code). Other outcomes are fatal errors. .Sp If your git server runs cgit, then you can set \f(CW\*(C`git\-check\*(C'\fR to the same as \f(CW\*(C`git\-url\*(C'\fR, and \f(CW\*(C`git\-check\-suffix\*(C'\fR to \fB/info/refs\fR. .IP "\fBdgit-distro.\fR\fIdistro\fR\fB/push.git\-check\fR, \fB/push.git\-create\fR" 4 .IX Item "dgit-distro.distro/push.git-check, /push.git-create" dgit push also needs to be able to check whether the repo exists. .Sp You can set both of these to \fBssh-cmd\fR, which will use an ssh shell command to test repository existence. Or leave them unset, and dgit push will use the readonly details. If repositories are created automatically on push, somehow, you can set \f(CW\*(C`git\-create\*(C'\fR to \fBtrue\fR. .IP "\fBdgit-distro.\fR\fIdistro\fR\fB.upload\-host\fR" 4 .IX Item "dgit-distro.distro.upload-host" What \fIhost\fR value to pass to dput, to upload. .Sp This is a nickname, not the real host name. You need to provide everyone who will push with an appropriate dput configuration. See \fIdput.cf\fR\|(5). .Sp A good nickname for your upload host is your distro name \fIdistro\fR. .IP "\fBdgit-distro.\fR\fIdistro\fR\fB.mirror\fR" 4 .IX Item "dgit-distro.distro.mirror" Set this to the url of your source package archive. This is the same string as appears in the 2nd field of each \fBsources.list\fR entry. .IP "\fBdgit-distro.\fR\fIdistro\fR\fB.archive\-query\fR, \fB.archive\-query\-url\fR" 4 .IX Item "dgit-distro.distro.archive-query, .archive-query-url" If you have a smallish distro, set \f(CW\*(C`archive\-query\*(C'\fR to \fBaptget:\fR (with a colon). .Sp If your distro is large (eg, if it contains a substantial fraction of Debian) then this will not be very efficient: with this setting, dgit often needs to download and update Sources files. .Sp For large distros, it is better to implement the Debian archive ftpmaster \s-1API.\s0 See , and set \f(CW\*(C`archive\-query\*(C'\fR to \fBftpmasterapi:\fR (with a colon) and \f(CW\*(C`archive\-query\-url\*(C'\fR to your \s-1API\s0 base \s-1URL.\s0 dgit uses these queries: \&\fBsuites\fR, \&\fBdsc_in_suite/\fR\fIisuite\fR\fB/\fR\fIpackage\fR and \&\fBfile_in_archive/\fR\fIpat\fR (so you need not implement anything else). .Sp Alternatively, if your system supports the rmadison protocol, you can set \f(CW\*(C`archive\-query\*(C'\fR to \fBmadison:\fR[\fImadison-distro\fR]. dgit will invoke \fBrmadison\fR \-u\fImadison-distro\fR. .IP "\fBdgit-suite.\fR\fIsuite\fR\fB.distro\fR \fIdistro\fR" 4 .IX Item "dgit-suite.suite.distro distro" Set this for every one of your suites. You will have to update this when new suites are created. If you forget, your users can explicitly specify \fB\-d\fR \fIdistro\fR to dgit. .SH "TEMPLATE GIT REPOSITORY" .IX Header "TEMPLATE GIT REPOSITORY" When dgit push is used for \fIpackage\fR for the first time, it must create a git repository on the git server. .PP If \f(CW\*(C`git\-create\*(C'\fR is set to \fBssh-cmd\fR, dgit will use the user's shell access to the server to \&\fBcp \-a _template.git\fR \fIpackage\fR\fB.git\fR. So you should create \fB_template.git\fR with suitable contents. .PP Note that the ssh rune invoked by dgit does not do any locking. So if two people dgit push the same package at the same time, there will be lossage. Either don't do that, or set up \fBdgit-repos-server\fR. .SH "SSH COMMANDS" .IX Header "SSH COMMANDS" When a user who can push runs dgit, dgit uses ssh to access the git server. .PP To make use of ssh restricted command easier, and for the benefit of dgit-repos-server, dgit's ssh commands each start with a parseable commentish rune. .PP The ssh commands used by dgit are these: .IP "\fB: dgit\fR \fIdistro\fR \fBgit-check\fR \fIpackage\fR \fB;\fR..." 4 .IX Item ": dgit distro git-check package ;..." Test whether \fIpackage\fR has a git repo on the server already. Should print \fB0\fR or \fB1\fR and a newline, and exit status zero in either case. The rest of the command, after \fB;\fR, is a shell implementation of this test. Used when \f(CW\*(C`git\-check\*(C'\fR is set to \fBssh-cmd\fR. .IP "\fB: dgit\fR \fIdistro\fR \fBgit-create\fR \fIpackage\fR \fB;\fR..." 4 .IX Item ": dgit distro git-create package ;..." Create the git repository for \fIpackage\fR on the server. See \*(L"\s-1TEMPLATE GIT REPOSITORY\*(R"\s0, above. The rest of the command is an appropriate invocation of cd and cp. Used when \f(CW\*(C`git\-create\*(C'\fR is set to \fBssh-cmd\fR. .IP "\fBgit-receive-pack\fR..., \fBgit-upload-pack\fR..." 4 .IX Item "git-receive-pack..., git-upload-pack..." dgit invokes git to access the repository; git then runs these commands. Note that dgit push will first do a git fetch over ssh, so you must provide upload-pack as well as receive-pack. .PP (There are also other ssh commands which are historical or obscure.) .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIdgit\fR\|(1)