A.D.F. -> httpd -> thttpd -> patches -> how-to-patch
This chapter explains how patches are named and how to apply them to thttpd.
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).
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:
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
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
change directory:
cd thttpd-V.VVv-pNN
Example:
cd thttpd-2.21b-p22
change permissions of source files:
chmod u+rw *
extract patch file from tar(1) archive:
tar xvfz thttpd-V.VVv-pNN.tar.gz
Example:
tar xvfz thttpd-2.21b-p22.tar.gz
apply extracted patch:
patch < thttpd-V.VVv-pNN.patch
Example:
patch < thttpd-2.21b-p22.patch
configure thttpd:
./configure
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.