Scripts
There are two very useful scripts in SPECS
module. One is called builder, second is
adapter.awk.
Builder script
builder can be used to:
Fetch spec file along with tarballs, patches, icons etc from CVS
repository, or if they are not stored there, from http/ftp URLs.
In order just to fetch files needed for build use
-g option. If you don't want to fetch Source0
(that is usually the hugest), use -ns0 option.
Build binary and/or source RPMS. Use it without option, or with
-bs or -bb to do this.
It is used this on builder machines in PLD Linux.
Tag all files that constitutes package. Using
-T family of options one can add tags
not only for spec file, but also for patches and sources.
Note that having tags on all files in package is required to
make it build using -r
builder option. Even if you don't use
builder -r PLD builders does.
Adapter is your friend
adapter.awk is tool fixing common mistakes in
spec files, and making them all look the same. There are some style
guidelines in PLD concerning spec files. They are mostly formalized
through few thousand examples in SPECS module and
adapter.awk script. While this probably isn't
very good way of formalization, this is how it works -- it is simply
recommended to run specs through adapter.awk
before doing commit.
adapter.awk reads spec file passed as first
argument or, if nothing is passed, standard input. Processed spec
is dumped on standard output.
For example, let's say you finally completed great
foo.spec:
[you@somewhere SPECS]$ ./adapter.awk foo.spec > foo.spec-
[you@somewhere SPECS]$ diff -u foo.spec foo.spec-
...
[you@somewhere SPECS]$ mv foo.spec- foo.spec
[you@somewhere SPECS]$ cvs commit foo.spec
You always should look at what adapter.awk
broke^H^H^H^H^Hchanged. It is just a piece of awk and it is sometimes
misled. Thats what's diff above is for.
If you use vim to edit spec files you might
find useful its diff mode, instead of using diff
command. Simply instead of diff -u foo.spec foo.spec-
run vim -d foo.spec foo.spec-.
FIXME: There is probably something similar in operating system Emacs.