]> Pileus Git - ~andy/fetchmail/blob - dist-tools/shipper/shipper.1
Fix compiler warnings.
[~andy/fetchmail] / dist-tools / shipper / shipper.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "SHIPPER" 1 "" "" ""
21 .SH NAME
22  shipper \- automatic drop-shipping of project releases
23 .SH "SYNOPSIS"
24
25 .nf
26 \fBshipper\fR [-h] [-n] [-N] [-f] [-v]
27 .fi
28
29 .nf
30 \fBbuildrpms\fR {\fItarball\fR}
31 .fi
32
33 .SH "DESCRIPTION"
34
35 .PP
36 shipper is a tool for shipping project releases. Its job is to make it possible for you to run the command \fBshipper\fR in the top-level directory of a project and have a release be properly exported to all the places that you normally deliver it -- your personal website, Linux source code archive sites, and distribution submission queues. A second goal is to arrange your shipping process in such a way that metadata like your project version only have to be kept in one place and modified once per release. The overall goal is to reduce the friction cost of shipping releases to as near zero as possible.
37
38 .PP
39 buildrpms is a helper script that builds source and binary RPMs from a specified tarball with a BuildRoot field. shipper also calls \fBrpm2lsm\fR(1) to do part of its work.
40
41 .PP
42 As much as possible, shipper tries to deduce what it should do rather than requiring you to tell it. In order to do this, it relies on your project obeying standard GNU-like naming conventions. It also relies on being able to mine project metadata out of a package specfile. (Presently the only variety of package specfile supported is an RPM spec; this may change in the future, when we fully support shipping Debian packages.)
43
44 .PP
45 In normal use, you need set only one configuration variable, which is the list of private destinations to ship to. You may also want to add some magic ``Keywords'' comments to your project specfiles. Once you have shipper up and running, you can experiment with more advanced features such as having the program generate project web pages for you.
46
47 .SH "THEORY OF OPERATION"
48
49 .PP
50 shipper pushes deliverables out to destinations. Deliverables include: source tarballs, source zip archives, source RPMs, binary RPMs, ChangeLog files, README files, LSM files, and various other project metadata files. Destinations include both private destinations like websites, FTP archive sites and mailing lists, and public channels like ibiblio, freshmeat.net, and the submission queues for various well-known operating-system distributions. The shipper framework is extensible and it is relatively easy to add new channel types and new deliverables; in the future, we hope to support (for example) Debian packages as deliverables and SourceForge as a channel.
51
52 .PP
53 shipper's first step is to find the project name and version, then to check that the minimum set of files that shipper requires to continue is in place. To start with, shipper needs a source tarball and a specfile. Once it knows those are in place, it can extract various pieces of information it will need to do its real work. It also reads in a handful of configuration variables. The -N (nobuild) option causes it to dump all configuration values and stop there.
54
55 .PP
56 The first real work that gets done is finding or building local deliverables. These are either generated deliverables (like RPMs) that can be rebuilt automatically, or or stock deliverables (like a README file) that have to be changed by hand. shipper rebuilds any generated deliverable that doesn't exist when it starts up. Building local deliverables is separated from uploading because it means that you can stop and inspect what you're going to ship before committing to an upload.
57
58 .PP
59 The -n (noupload) option stops before uploading, leaving all local deliverables in place but displaying the exact upload commands that would have been used to ship them. The -f (force) option forces a rebuild of all generated deliverables, even those that already exist. The command \fBshipper -f -n\fR will show you exactly what shipper would do for a real upload.
60
61 .PP
62 Once all local deliverables have been built, shipper can begin uploading files and posting announcements. It does private destinations first, then public channels. This means, for example, that if you give shipper your personal website as a destination, the website will get updated each time before any submissions or announcements are sent to public sites like ibiblio.org or freshmeat.net.
63
64 .PP
65 When uploads are complete, shipper cleans up after itself by deleting any deliverables it created for this run. Deliverables that were found and up to date are not removed.
66
67 .PP
68 Finally, note that shipper makes one important assumption about the structure of your website(s). Beneath each directory in your \fIdestinations\fR list, there will be one subdirectory for each project, with the directory leaf name being the same as the project. Thus, for example, if you have three projects named ruby, diamond and sapphire, and your personal site is at \fIgemstones.net:/public/www/precious/\fR, shipper will expect to be able to drop deliverables in three directories \fIgemstones.net:/public/www/precious/ruby\fR, \fIgemstones.net:/public/www/precious/diamond/\fR, and \fIgemstones.net:/public/www/precious/sapphire/\fR. Note that shipper will not create these project directories for you if they're missing; this is deliberate, so that uploads to sites that are not prepared for them will fail noisily.
69
70 .SH "HOW SHIPPER DEDUCES WHAT TO DO"
71
72 .PP
73 The behavior of shipper depends on a handful of internal variables. Some of these variables have defaults computed at startup time. All can be set or overridden in the per-user \fI~/.shipper\fR file, and overridden in any per-project \fI.shipper\fR file. Both files are Python code and the syntax of variable settings is Python's.
74
75 .PP
76 If a variable is set in a config file, that value is locked in (except for the \fIdestinations\fR variable which can be appended to from a specfile, see below) Variables that are not set in a config file may be set by the values of fields in your project specfile.
77
78 .PP
79 For basic use, it is only necessary to set one such variable: \fIdestinations\fR, the list of destinations to ship to. Normally you'll set this globally, pointing all your projects at your main distribution website, in your \fI~/.shipper\fR file; it is also possible to add destinations on a per-project basis by giving a comma-separated list in a #Destinations: comment in the specfile. You can set the variable in a per-project \fI.shipper\fR to ignore your global destination list.
80
81 .PP
82 The first thing shipper looks for is a specfile in the current directory; there must be exactly one. It extracts the project name from the Name field. Next step is to find the project version (the variable \fIpackage\fR). This is extracted from the specfile, or by looking for a makefile macro with a name beginning with VERS; if the value of that macro is a shell command wrapped in $(shell ...), it is executed and the output is captured to yield the version. If both versions are present, they are consistency-checked.
83
84 .PP
85 shipper gets most of the rest of the data it uses to decide what to do from headers in the specfile. The following table lists all the variables and their corresponding specfile fields. shipper uses the RPM spec file fields: the Debian entries are informational only.
86 VariableRPM specfile fieldDebian specfile fieldMeaning\fIdestinations\fR#Destinations:XBS-Destinations:
87 .PP
88 A list of remote directories to ship to using \fBscp\fR(1). Each location is a place to drop deliverables: either a [user@]site:path destination that \fBscp\fR(1) can use, or an FTP url that \fBlftp\fR(1) can use. Note that actual project directories are computed by appending the value of \fIpackage\fR to the destination you're shipping to.
89
90 .PP
91 There is no default.. If you do not set this variable, shipper will ship only to public channels.
92 \fIchannels\fR--
93 .PP
94 The list of public channels to be shipped to after the private channels in the \fIdestination\fR list. You can disable one or more of these in a config file by calling the function \fBdisable()\fR; for example with \fBdisable('freshmeat')\fR.
95 \fIwhoami\fR--
96 .PP
97 A plausible email address for the user. If not specified in the config file, it's generated from \fB$USERNAME\fR and \fB$HOSTNAME\fR.
98 \fIdate\fR--
99 .PP
100 The program's startup time. This can be used in the web page and email announcement templates.
101
102 .PP
103 You can use the Python function time.strftime("...") in your \fI~/.shipper\fR file to format this date to your taste. If you don't set this in the config file, the program will set it for you.
104 \fIindextemplate\fR--
105 .PP
106 Template HTML from which to generate index.html for shipping. There is a default which generates a very simple page containing a title, a date, and a table listing downloadable resources. This is used when shipping to a web directory, if no index page exists when shipper is run.
107 \fImailtemplate\fR--
108 .PP
109 Template text from which to generate the file ANNOUNCE.EMAIL to be shipped to destinations that are mailto URLs. There is a default which generates a very simple email containing a subject, a pointer to the project web page, and the last entry in the project changelog.
110 \fIpackage\fRName:Package:
111 .PP
112 Project name, used to generate the stem part of the names of RPMs and other deliverables that shipper builds. If the specfile is a Debian control file, the Debian-specific part of the version number (after the dash) is removed.
113 \fIversion\fRVersion:Version:
114 .PP
115 Project version, used in generating the names of RPMs and other deliverables that shipper builds.
116 \fIhomepage\fRURL:XBS-Home-Page:
117 .PP
118 Project home page URL. Used when generating project announcements.
119 \fIarch\fRBuildArch:Architecture:
120 .PP
121 Build architecture. If this field is ``noarch'', noarch rather than binary RPMs will be built.
122 \fIkeywords\fR#Keywords:XBS-Keywords:
123 .PP
124 Topic keywords. Used when generating LSM files.
125 \fIfreshmeat_name\fR#Freshmeat-Name:XBS-Freshmeat-Name:
126 .PP
127 Freshmeat shortname, used in generating freshmeat.net announcements. If this isn't present, it defaults to the project name; you only need to set it if they differ.
128 \fIsummary\fRSummaryDescription:
129 .PP
130 The one-line project summary field from your specfile.
131 \fIdescription\fR%descriptionDescription:
132 .PP
133 The Description field from your specfile.
134 \fIchangelog\fRChangeLog or %changelog-
135 .PP
136 If a \fIChangeLog\fR file exists in the project directory, its entire contents. Otherwise, if it exists, the entire changelog section from the specfile.
137 \fIlastchange\fRChangeLog or %changelog-
138 .PP
139 If the source of your changlog was your specfile, this is the most recent entry from your changelog without its date/author/release header. If the source was Changelog, a line of text directing the user to see the ChangeLog file. This becomes the Changes field in your freshmeat.net announcement, and freshmeat.net doesn't like the bulleted format of GNU ChangeLog entries.
140 \fIresourcetable\fR--
141 .PP
142 The HTML table of links to downloadable resources. This variable is only computed if the index page is built. Any setting of it in the startup files is ignored.
143
144 .PP
145 All these variables are available for substitution at the time a web page or email announcement is generated. In general, any variable you set in your \fI~/.shipper\fR file will be available at the time the web page or email announcement is generated. Use the Python "%(variable)s" syntax, not shell-substitution syntax.
146
147 .SH "FINDING AND BUILDING LOCAL DELIVERABLES"
148
149 .PP
150 The following files are considered stock deliverables and may be shipped if they are present when shipper starts up:
151 FileExplanationREADME
152 .PP
153 Project roadmap file.
154 tarball
155 .PP
156 The current source tarball, that is the file named ${package}-${version}.tar.gz.
157 zipfile
158 .PP
159 The current source zip archive, that is the file named ${package}-${version}.zip.
160 NEWS
161 .PP
162 Project news file.
163 ChangeLog
164 .PP
165 Project change log.
166 HISTORY
167 .PP
168 Project history file.
169 BUGS
170 .PP
171 Project bug list.
172 TODO
173 .PP
174 Current to-do list.
175 *.html
176 .PP
177 Any files with an .html extension will be shipped to all website destinations.
178
179 .PP
180 Here are the generated deliverables that shipper will build and ship, if they don't exist when it starts up. Any of these that are created will be deleted after a successful upload.
181 TypeExplanationindex.html
182 .PP
183 An index web page, to be shipped to any website destination.
184 RPMs
185 .PP
186 Source and either binary or noarch RPMs.
187 LSM
188 .PP
189 If the ibiblio channel is enabled, shipper will generate a Linux Software Map file for it.
190 CHANGES
191 .PP
192 If there is no ChangeLog file but there was a %changelog in your specfile, shipper will generate a CHANGES from the changelog entries in the specfile and ship that.
193 ANNOUNCE.FRESHMEAT
194 .PP
195 If there is no ANNOUNCE.FRESHMEAT file, shipper will generate one. It will be a job card that can be fed to freshmeat.net's XML-RPC interface via \fBfreshmeat-submit\fR(1).
196 ANNOUNCE.EMAIL
197 .PP
198 If there is no ANNOUNCE.EMAIL file, shipper will generate one to be emailed to destinations that are mailto URLs.
199
200 .SH "SHIPPING TO DESTINATIONS"
201
202 .PP
203 In operation, shipper walks through a list of destinations, building the required deliverables for each one and performing the required shipping actions to push them out to the destination. Here are the channel types shipper knows about:
204 Channel TypeDeliverablesSpecified byExplanationibibliotarball, RPMs, LSM file-
205 .PP
206 If the ibiblio channel is enabled (it is by default), shipper will attempt to ship a source tarball, RPMs, and an an LSM file to ibiblio.org via FTP. The LSM file will be automatically generated.
207 redhatRPMs-
208 .PP
209 If the Red Hat channel is enabled (it is by default), shipper will attempt to ship source and binary RPMs to the Red Hat submission directory via FTP.
210 freshmeatANNOUNCE.FRESHMEAT-
211 .PP
212 If the freshmeat channel is enabled (it is by default), shipper will attempt to post a release announcement on freshmeat.net using \fBfreshmeat-submit\fR(1). The announcement will include URLs for whichever of the following deliverables are shipped, using the URL field from your specfile: tarball, zipfile, RPMs, CHANGES. The user will be prompted for a Freshmeat release-focus. This announcement is generated into the local deliverable ANNOUNCE.FRESHMEAT.
213 Generic Web siteREADME, tarball, zipfile, RPMs, CHANGES, NEWS, HISTORY, *.html, 
214 BUGS, TODO.scp destination ([user@]host:dir)
215 .PP
216 This channel type represents a website. shipper uses \fBscp\fR(1) to put deliverables on websites. If the user part of the scp destination is absent, it will be taken from the environment variable \fBUSERNAME\fR.
217
218 .PP
219 No generic Web sites are shipped to by default. You must declare them by putting scp destinations in the \fIdestinations\fR variable.
220 Generic FTP sitetarball, RPMsFTP URL
221 .PP
222 Old-fashioned FTP site with no metadata. The FTP URL is parsed to get the sitename and directory where deliverables should be dropped. The FTP username to be used will be taken from the environment variable \fBUSERNAME\fR. The FTP password will be looked up in your \fI~/.netrc\fR file.
223
224 .PP
225 No generic FTP sites are shipped to by default. You must declare them by putting FTP urls in the \fIdestinations\fR variable.
226 Email addressANNOUNCE.EMAILmailto URL
227 .PP
228 The contents of the generated ANNOUNCE.EMAIL file is emailed to each email address specified as a channel.
229
230 .PP
231 No email channels are set up by default. You must declare them by putting mailto: urls in the \fIdestinations\fR variable.
232 rsync unitSRPMrsync address ([user@]host::unit)
233 .PP
234 An SRPM is shipped to each destination that is rcognized as an rsync address (by the double colon).
235
236 .PP
237 No rsync channels are set up by default. You must declare them by putting rsync addresses in the \fIdestinations\fR variable.
238
239 .SH "COMMAND-LINE OPTIONS"
240
241 .PP
242 The -n option of shipper suppresses uploads, just building all deliverables locally. The -N option suppresses both uploads and builds, generating a configuration dumop instead. The -f option forces rebuilding of local deliverables even if they already exist. The -v option makes shipper chatty about what it's doing. The -h option prints a usage message and exits.
243
244 .SH "HINTS AND TIPS"
245
246 .PP
247 The following variable definition in your makefile will ensure that the makefile version is derived from (and thus always consistent with) the specfile version.
248
249 .nf
250
251 VERS=$(shell sed <*.spec -n -e '/Version: \\(.*\\)/s//\\1/p')
252
253 .fi
254
255 .PP
256 A makefile production like the following will allow you to type \fBmake release\fR and be sure that all the deliverables shipper knows about will be rebuilt before being shipped.
257
258 .nf
259
260 release: package-$(VERS).tar.gz package.html 
261         shipper -f
262
263 .fi
264
265 .PP
266 You will want to change package to your project name. Note that you should not use this recipe if your project has its own (non-generated) index page, as the -f option will overwrite \fIindex.html\fR.
267
268 .PP
269 To make \fBrpm\fR(1) build noarch rather than binary RPMs, insert the following header in your specfile:
270
271 .nf
272
273 BuildArch: noarch
274
275 .fi
276
277 .SH "AUTHOR"
278
279 .PP
280 Eric S. Raymond <esr@thyrsus.com>. The buildrpms script was originally by Sean Reifschneider.
281
282 .PP
283 There is a project web page at : http://www.catb.org/~esr/shipper/http://www.catb.org/~esr/shipper/.
284
285 .SH "BUGS"
286
287 .PP
288 The rsync channel type is untested. Shipping Debian packages should be supported.
289
290 .SH "SEE ALSO"
291
292 .PP
293  \fBfreshmeat-submit\fR(1), \fBlftp\fR(1), \fBrpm2lsm\fR(1), \fBscp\fR(1), \fBssh\fR(1).
294