How to prepare a Ghostscript release

## Table of contents

> - Introduction
> - Servers
>   - Development sources and bug reports
>   - Distributions
> - Adding or removing files
> - Making distributions
>   - Preparing the source code
>   - Testing
>     - Testing on Windows
>   - Finishing up
>     - Tester or beta distributions
>     - Public releases
> - After releasing
> - GNU Ghostscript releases
>   - GNU code
>   - After releasing (GNU)
> - Fonts

For other information, see the Ghostscript overview and the instructions on how to build Ghostscript.

# Introduction

This document describes the recommended procedure for rolling new Ghostscript releases. As time goes on, it will become a more suitable document for others wishing to prepare releases for distribution; at the moment this document is really meant only for developers working closely with artofcode LLC, the copyright holder of Ghostscript.

See the section on GNU releases below for information on making a GNU Ghostscript release from an existing AFPL Ghostscript release, and the section on fonts for information on releasing font packages.

File names below that don't include an explicit subdirectory name are in the `src` subdirectory.

If you do plan to make your own distribution, please be aware of some items you will want to change.

- If you make any significant changes, please edit `gscdef.c` to change `GS_PRODUCTFAMILY` and `GS_PRODUCT` from "GNU Ghostscript" to something else, in order to avoid confusion with artofcode's releases.
- In the same file, you may also want to edit `GS_COPYRIGHT` to add your own copyright notice (although you must not remove any notice that is there).
- You will almost certainly want to edit `version.mak` to change the revision date, `GS_REVISIONDATE`.
- If you want to change the version number, you must change it in both `version.mak` (`GS_VERSION_`*) and `lib/gs_init.ps` (the integer on a line by itself near the beginning of the file).

# Servers

The Ghostscript files are maintained on sites accessible to the public. One specific site hosts the active CVS repository for code, data, and documentation, and the bug report data base; several sites offer distributions with version numbers, intended for wider distribution.

## Development sources and bug reports

The primary repository for Ghostscript is SourceForge (`http://sourceforge.net/`). Please read the SourceForge AFPL Ghostscript home page (`http://ghostscript.sourceforge.net/`) first. CVS access information is available at `http://sourceforge.net/cvs/?group_id=1897`.

## Distributions

Both stable and development releases are available from

>     http://sourceforge.net/project/filelist.php?group_id=1897

Stable releases are also distributed from

>     ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/

Development releases are also distributed from

>     ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/test/

# Adding or removing files

When adding or removing files, don't forget to invoke `cvs add` or `cvs rm`.

When adding or removing files other than .c or .h: If the files will be used at runtime, check the install list in `unixinst.mak`.

When adding .c files, update the relevant `.mak` file (usually `devs.mak`, `int.mak`, or `lib.mak`).

When adding operators, or adding or changing filters, update `doc/Language.htm` if desired.

When adding .h files, add a _h definition in the appropriate `.mak` file.

When adding or changing fonts, update `lib/Fontmap.GS`, `fonts.mak`, and possibly the compiled fonts in `gs.mak` and the examples in `doc/Fonts.htm`.

When adding .ps files, update `doc/Psfiles.htm`.

# Making distributions

This document only discusses source distributions. Source distributions currently can only be made on GNU/Linux systems (but it probably wouldn't take much work to support other Unix systems). Ghostscript as distributed also often includes executables or other packages for the Windows and MacOS environments, but artofcode does not produce these, and this document does not discuss them. For more information about Windows packages, please contact `bug-gswin@ghostscript.com`; for more information about MacOS packages, please contact `mac-gs@ghostscript.com`.

To make a source distribution, you will need the scripts and data files in the `toolbin/` directory. You will probably find it convenient to include this directory in the PATH, but the instructions below don't assume that you have done this. To run the scripts, you will need reasonably current versions of Tcl, freely available from Scriptics (`http://www.scriptics.com`), and Python, freely available from `http://www.python.org`.

The instructions below also refer to some files that are deliberately omitted from the public distribution, because they are copyrighted by their authors and not freely redistributable. You will need to provide similar files for your environment.

>     data/*/*.ps (PostScript files) - needed for smoke testing
>     beta.msg - the announcement message for the release

## Preparing the source code

Update references to the date:

- In `version.mak`, the numeric date.
- In `doc/News.htm`, in 3 places, skipping the Id: line.

Also in `doc/News.htm`, update the number of the highest closed bug and the list of open bugs.

Check in `gscdef.c` that the definition of `GS_PRODUCT` includes the appropriate one of "TESTER RELEASE", "BETA RELEASE", or neither, and does not include "CVS PRE-RELEASE".

Check for patched configuration parameters, `#define TEST`s, version/date inconsistencies, and mismatches between the working directory and the CVS repository by running:

>     toolbin/pre

This program compares the result of various greps against a check file, writing the results of grep on one output file and the differences from the check file on another. See the source code of `toolbin/pre` for the default file names. The important one is the check file, `toolbin/pre.chk`. `pre` also verifies that the right information is in the following places:

- version number in `man/*.1`, `doc/*.htm`, `version.mak`, `doc/gs-vms.hlp`, `lib/gs_init.ps`
- revision date in `man/*.1`, `doc/*.htm`, `version.mak`, `doc/gs-vms.hlp`
- copyright year (if necessary) in `gscdef.c`

If necessary, run

>     toolbin/pre update

to update the version and revision date in the doc files, and then run

>     toolbin/pre

again.

Update the plain text version of the readme to match the html source:

>     lynx -dump -nolist doc/Readme.htm > doc/README

## Testing

Edit the makefile (presumably `unix-gcc.mak`) to set

>     FEATURE_DEVS=$(FEATURE_DEVS_ALL)
>     COMPILE_INITS=1

This will help catch compilation problems.

Run

>     make clean
>     make >& t.log

and look for warnings and errors in the log file.

Do a smoke test in a separate window, replacing `/gs` with the name of the development root directory if necessary:

>     unset GS_DEVICE GS_FONTPATH GS_LIB GS_OPTIONS
>     cd /tmp
>     /gs/bin/gs -I/gs/lib -I/gs/fonts -dNOPAUSE -dBATCH /gs/toolbin/smoke.ps | tee t
>     export TEMP=/gs/tmp
>     /gs/bin/gs -I/gs/lib -I/gs/fonts -dNOPAUSE -dBATCH -sDEVICE=bitcmyk\
>       -sOutputFile=/dev/null -r600 -dBufferSpace=50000 /gs/toolbin/smoke.ps | tee t

This reads files named

>     /gs/data/ps/*.ps
>     /gs/data/psl2/*.ps
>     /gs/data/psl3/*.ps
>     /gs/data/test/*.ps

(Edit `toolbin/smoke.ps` ad lib to use other test sets.) Watch for crashes, unusual error messages, or anomalous displayed output. If there are any problems, start over from the beginning of the process.

Undo the `FEATURE_DEVS` and `COMPILE_INITS` edits.

Run

>     cvs commit

to ensure the repository is up to date.

Execute

>     toolbin/cvs2hist.py -j previous_tag -r '-rbranch_tag' -v new_version > doc/Changes.htm

> e.g.

>     toolbin/cvs2hist.py -j gs7.04 -r '-rGS_7_0X' -v 7.05

This consolidates all the CVS logs since the previous release in a readable format. Note: the cvs2hist.py tool currently in the distribution is not very branch-aware (nor is the 'cvs log' command it depends on) so the extra complication of the -j and -r options are required when generating the Changes for a non-HEAD branch of Ghostscript.

Run

>     tclsh
>     % source toolbin/makeset.tcl
>     % makehist

This updates `doc/History#.htm` from `doc/News.htm` and `doc/Changes.htm`. Then run

>     cvs commit

again to check in the Changes and history files.

For the unix source distributions only, generate the configure scripts. From the top level directory, run

>     ./autogen.sh
>     make clean

This should create links to `configure.ac` and `Makefile.in` in the top level directory and invoke autoconf to create the `configure` script.

You should then verify that only autogen.sh, configure, Makefile.in exist as files at the top level. Running ./configure will create a number of files that should not be distributed. 'make clean' may or may not remove these depending on the version.

Make the source archives with various archive programs. Create the files:

>     ghostscript-#.##.tar.gz
>     ghostscript-#.##.tar.bz2

The general procedure is:

>     cvs -z3 -d <ghostscript cvsroot> export gs -d ghostscript-#.##
>     tar cvzf ghostscript-#.##.tar.gz ghostscript-#.##/*
>     zcat ghostscript-#.##.tar.gz | bzip2 -c > ghostscript-#.##.tar.bz2

The important issue is that the tarballs unpack into a directory of the same name, and that the code be a pristine copy without build or CVS housekeeping files.

It is also customary to make a `gs###src.zip` archive for the convenience of windows developers.

## Testing on Windows

For Windows testing, you will need, in addition to the files listed under "Source distributions" above:

>     toolbin/makewin (link to makeset.tcl)

The following procedures are very Aladdin-specific; they rely on a large number of MS-DOS batch scripts that are not discussed here.

Mount the Windows partition on `/c`, and create the `/c/work` directory if needed.

Make the zip archive of all files needed for a Windows build, and copy it to the Windows partition:

>     toolbin/makewin
>     cp gs###.zip /c/work

Boot into Windows. Unpack the archive:

>     cd \work
>     unzip -oq gs###.zip
>     gs###

The `gs###.bat` script creates some necessary directories, sets up `PATH` and `GS_LIB` for testing, and makes the `gs#.#[#]` directory current.

Build with the Borland compiler:

>     config bcwin32
>     copy /y /b ..\gs\makefile
>     erase obj\*.*
>     make > bc.log

Smoke test the executables (both `gswin32` and `gswin32c`), as described above for source distributions. Then build with the Microsoft compiler:

>     config msvc32
>     copy /y /b ..\gs\makefile
>     erase obj\*.*
>     nmake > msvc.log

Smoke test these executables too.

Building with the Watcom compiler doesn't work, because the `wmake` or `wmakel` program runs out of memory. However, if it did work, this is how to do it:

>     config watcw32
>     copy /y /b ..\gs\makefile
>     erase obj\*.*
>     wmake -u > watc.log

Boot back into GNU/Linux. If testing in Windows revealed problems, edit the source files as necessary, and go back to "Preparing the source code."

## Finishing up

Tag the source files with the release number by executing

>     cvs tag gs#_##

Upload `ghostscript-#.##.tar.*` to SourceForge (by anonymous FTP to `download.sourceforge.net`, directory `/incoming`), and then post it using the "File Release" facility in the AFPL Ghostscript project. If this is a test release, put it in the `gs-test` module, otherwise put it in the `ghostscript` module. If you are adding Windows executables to an existing source release, please use the same release date as the source release, not the current date.

If `ansi2knr.c` has changed, put it on `ftp://ftp.cs.wisc.edu/ghost/ansi2knr.c`.

If `doc/C-style.htm` has changed, put it on `ftp://ftp.cs.wisc.edu/ghost/aladdin/C-style.htm`.

### Tester or beta distributions

Do the steps for distributions in general.

Upload `ghostscript-#.##.tar.*` to `ftp://ftp.cs.wisc.edu/ghost/aladdin/test`.

Construct the e-mail announcement by editing `beta.msg`. Mail using:

>     To: gs-test

### Public releases

Do the steps for distributions in general.

E-mail the release announcement using:

>     To: gs-announce

Edit the Web pages on the Wisconsin server to reflect the new release.

# After releasing

Update the version number by incrementing it:

- In `lib/gs_init.ps`, at the very beginning of the file.
- In `version.mak`, in 3 definitions.
- In `doc/News.htm`, in 4 places.

Edit `doc/News.htm` to remove all the content.

# GNU Ghostscript releases

artofcode LLC re-releases each tested AFPL Ghostscript version with the GPL, as GNU Ghostscript, when the next tested AFPL Ghostscript version comes out.

## GNU code

Make source archive as described above and upload them to `ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/gs###/`.

## After releasing (GNU)

E-mail the full URL and the `md5sum` of the new archive(s) to `ftp-upload@gnu.org`.

# Fonts

artofcode LLC distributes a package of the base 35 PostScript fonts, and a package of other miscellaneous fonts. As with the Ghostscript code, each package is released both with the Aladdin License and with the GPL; however, unlike the Ghostscript code, artofcode releases these versions simultaneously rather than with a one-version delay.

To make the font packages, run the command

>     toolbin/makefonts #.##

This creates the following files:

>     ghostscript-fonts-std-#.#[#].tar.gz
>     ghostscript-fonts-other-#.#[#].tar.gz
>     gnu-gs-fonts-std-#.#[#].tar.gz
>     gnu-gs-fonts-other-#.#[#].tar.gz

The first two of these use the Aladdin License, and should be uploaded to `ftp://ftp.cs.wisc.edu/ghost/aladdin/fonts/`. The other two use the GPL, and should be uploaded to `ftp://ftp.cs.wisc.edu/ghost/gnu/fonts/`. For the GNU release, also see "After releasing (GNU)".

Copyright © 1999, 2001 artofcode LLC. All rights reserved.

This file is part of GNU Ghostscript. See the GNU General Public License (the "License") for full details of the terms of using, copying, modifying, and redistributing GNU Ghostscript.

GNU Ghostscript version 6.53, 13 February 2002