A.D.F. - thttpd, how to apply A.D.F.'s patches


1. How to patch thttpd


1. How to patch thttpd

This chapter explains how patches are named and how to apply them to thttpd.

1.1 Name conventions

Each patch is named like this:

thttpd-V.VVv-pNN.patch

and it is enclosed / contained in a compressed tar(1) archive:

thttpd-V.VVv-pNN.tar.gz

Legenda

These are the fixed and variable parts of composed names:

thttpd
program name (fixed string);
-
name separator (fixed char);
V.VVv
version number (i.e. 2.21b) (variable part);
-
name separator (fixed char);
p
patch prefix (fixed char);
NN
patch level (01-99) (variable part);
.patch
name extension (fixed string);
.tar.gz
name extensions (.tar + .gz), they mean that file is a compressed gzip(1) archive in tar(1) format (fixed string).

1.2 How to apply a patch

Each patch includes also all previous (older) patches for a specific version of thttpd, thus, you have to apply only one patch to original version of thttpd.

These are the recommended steps to apply a patch:

  1. download original version of thttpd (i.e. thttpd-2.21b.tar.gz), matching chosen (usually latest) patch (i.e. thttpd-2.21b-p22.tar.gz), and extract it:

    tar xvfz thttpd-V.VVv.tar.gz

    Example:

    tar xvfz thttpd-2.21b.tar.gz
  2. rename created subdirectory so that it matches name of chosen patch:

    mv thttpd-V.VVv thttpd-V.VVv-pNN

    Example:

    mv thttpd-2.21b thttpd-2.21b-p22
  3. change directory:

    cd thttpd-V.VVv-pNN

    Example:

    cd thttpd-2.21b-p22
  4. change permissions of source files:

    chmod u+rw *
  5. extract patch file from tar(1) archive:

    tar xvfz thttpd-V.VVv-pNN.tar.gz

    Example:

    tar xvfz thttpd-2.21b-p22.tar.gz
  6. apply extracted patch:

    patch < thttpd-V.VVv-pNN.patch

    Example:

    patch < thttpd-2.21b-p22.patch
  7. configure thttpd:

    ./configure
  8. compile thttpd:

    make clean; make;

    NOTE: if (by mistake) file config.cache exists before you run ./configure then try these commands instead of those in steps 7 and 8:

    make distclean; ./configure; make;

Now you can install it (see instructions in thttpd HOME page / FAQs) and hopefully enjoy it.


Last Updated: 14-SEP-2002