spf_template gnu &&
spf_url home  'http://www.ijg.org/' &&
spf_url watch 'http://www.ijg.org/files/' &&
spf_url src   "http://www.ijg.org/files/jpegsrc.v${spf_version?}.tar.gz" &&
case ${spf_version?} in
  6b)
    spf_args configure --enable-static &&
    spf_args configure --enable-shared;;
  *) :;;
esac &&
spf_template_gnu_do_before_configure() {
  prj_u2 prj_set pkg_edits '' &&
  spf_edit c_define pkg_edits noquote D_MAX_BLOCKS_IN_MCU 64 &&
  prj_sedfile jpeglib.h "${pkg_edits?}" &&
  case ${spf_version?} in
    6b) mkdir "${spf_path_prefix?}" \
              "${spf_path_prefix?}"/bin \
              "${spf_path_prefix?}"/include \
              "${spf_path_prefix?}"/lib \
              "${spf_path_prefix?}"/man \
              "${spf_path_prefix?}"/man/man1;;
    *) :;;
  esac
} &&
spf_template_gnu_do_after_install() {
  set cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h jversion.h \
    transupp.h &&
  case ${spf_version?} in
    6b) set "$@" jchuff.h jdhuff.h;;
    *) :;;
    esac &&
  cp -p "$@" "${spf_path_prefix?}"/include/
} &&
spf_tested_version 8c &&
spf_tested_version 8b &&
spf_tested_version 8a &&
spf_tested_version 8 &&
spf_tested_version 7 &&
spf_tested_version 6b

