#!/bin/sh
#
# source:
#   $Source: /var/cvs/projects/debian/cracklib/debian/dpkg.scripts/substfiles,v $
#
# revision:
#   @(#) $Id: substfiles,v 1.9 1998/04/25 04:16:30 jplejacq Exp $
#
# copyright:
#   Copyright (C) 1998 Jean Pierre LeJacq <jplejacq@quoininc.com>
#
#   Distributed under the GNU GENERAL PUBLIC LICENSE.
#
# description:
#   Define file system structure for package.
#
#   The idea behind this file is to support a variety of directory
#   layouts.  Two layouts are supported here: standard and opt.  Each
#   layout defines the directories that the files are installed in and
#   links that may be reguired to these files from standard locations
#   in the debian file system.
#
#   In addition, this file may define several binary packages from the
#   single source package.  All must be defined simulataneously since
#   they may depend on one another.  Consequently, the file is
#   organized as:
#
#     file_structure_0
#       binary_package_0
#       binary_package_1
#       ...
#     file_structure_1
#       binary_package_0
#       binary_package_1
#       ...
#     ...
#
#   This is not a complete shell script.  Must be included in another
#   file.


# main:
  # package:
    pkgbase="cracklib"
    pkgdev="${pkg}-dev"
    pkgruntime="${pkgbase}-runtime"


  # source:
    f_pkg_src="${pkgbase},2.7.tgz"
    f_pkg_src_unpacked="${pkgbase},2.7"

    url_pkg_dir="http://www.users.dircon.co.uk/~crypto"
    url_pkg_src="${url_pkg_dir}/${f_pkg_src}"


  if [ -f "debian/scheme-opt" ]
  then
    # pkg binary package:
      d_pkg_root="${d_host_opt}/${pkg}"

      # directories:
        d_pkg_doc="${d_pkg_root}/doc"
        d_pkg_docbase="${d_pkg_doc}"
        d_pkg_lib="${d_pkg_root}/lib"


      # files:
        f_pkg_docbase="${d_pkg_docbase}/${pkg}.doc-base"


      # links:
        l_pkg_doc="${d_host_doc}/${pkg}"
        l_pkg_docbase="${d_host_docbase}/${pkg}"


    # pkgdev binary package:
      d_pkgdev_root="${d_host_opt}/${pkgdev}"

      # directories:
        d_pkgdev_doc="${d_pkgdev_root}/doc"
        d_pkgdev_doc_examples="${d_pkgdev_doc}/examples"
        d_pkgdev_docbase="${d_pkgdev_doc}"
        d_pkgdev_include="${d_pkgdev_root}/include"
        d_pkgdev_lib="${d_pkgdev_root}/lib"
        d_pkgdev_man="${d_pkgdev_root}/man"


      # files:
        f_pkgdev_docbase="${d_pkgdev_docbase}/${pkgdev}.doc-base"


      # links:
        l_pkgdev_doc="${d_host_doc}/${pkgdev}"
        l_pkgdev_docbase="${d_host_docbase}/${pkgdev}"

        l_pkgdev_pkg_relative_lib="../../${pkg}/lib"


    # pkgruntime:
      d_pkgruntime_root="${d_host_opt}/${pkgruntime}"

      # directories:
        d_pkgruntime_bin_s="${d_pkgruntime_root}/sbin"
        d_pkgruntime_doc="${d_pkgruntime_root}/doc"
        d_pkgruntime_docbase="${d_pkgruntime_doc}"
        d_pkgruntime_etc="${d_host_opt_etc}/${pkgbase}"
        d_pkgruntime_man="${d_pkgruntime_root}/man"

        d_pkgruntime_cache="${d_host_cache}/${pkgbase}"


      # files:
        f_pkgruntime_docbase="${d_pkgruntime_docbase}/${pkgruntime}.doc-base"
        f_pkgruntime_etc_conf="${d_pkgruntime_etc}/${pkgbase}.conf"
        f_pkgruntime_etc_crondaily="${d_pkgruntime_etc}/${pkgbase}.cron-daily"

        f_pkgruntime_dict_db_prefix="cracklib_dict"
        f_pkgruntime_dict_db="${d_pkgruntime_cache}/${f_pkgruntime_dict_db_prefix}"


      # links:
        l_pkgruntime_doc="${d_host_doc}/${pkgruntime}"
        l_pkgruntime_docbase="${d_host_docbase}/${pkgruntime}"
        l_pkgruntime_etc_crondaily="${d_host_etc_crondaily}/${pkgbase}"
  else
    # pkg binary package:
      # directories:
        d_pkg_doc="${d_host_doc}/${pkg}"
        d_pkg_docbase="${d_host_docbase}"
        d_pkg_lib="${d_host_lib_usr}"


      # files:
        f_pkg_docbase="${d_pkg_docbase}/${pkg}"


      # links:
        l_pkg_doc="${d_pkg_doc}"
        l_pkg_docbase="${f_pkg_docbase}"


    # pkgdev binary package:
      # directories:
        d_pkgdev_doc="${d_host_doc}/${pkgdev}"
        d_pkgdev_doc_examples="${d_pkgdev_doc}/examples"
        d_pkgdev_docbase="${d_host_docbase}"
        d_pkgdev_include="${d_host_include}"
        d_pkgdev_lib="${d_host_lib_usr}"
        d_pkgdev_man="${d_host_man}"


      # files:
        f_pkgdev_docbase="${d_pkgdev_docbase}/${pkgdev}"


      # links:
        l_pkgdev_doc="${d_pkgdev_doc}"
        l_pkgdev_docbase="${f_pkgdev_docbase}"

        l_pkgdev_pkg_relative_lib="."


    # pkgruntime:
      # directories:
        d_pkgruntime_bin_s="${d_host_bin_s_usr}"
        d_pkgruntime_doc="${d_host_doc}/${pkgruntime}"
        d_pkgruntime_docbase="${d_host_docbase}"
        d_pkgruntime_etc="${d_host_etc}/${pkgbase}"
        d_pkgruntime_man="${d_host_man}"

        d_pkgruntime_cache="${d_host_cache}/${pkgbase}"


      # files:
        f_pkgruntime_docbase="${d_pkgruntime_docbase}/${pkgruntime}"
        f_pkgruntime_etc_conf="${d_pkgruntime_etc}/cracklib.conf"
        f_pkgruntime_etc_crondaily="${d_host_etc_crondaily}/${pkgbase}"

        f_pkgruntime_dict_db_prefix="cracklib_dict"
        f_pkgruntime_dict_db="${d_pkgruntime_cache}/${f_pkgruntime_dict_db_prefix}"


      # links:
        l_pkgruntime_doc="${d_pkgruntime_doc}"
        l_pkgruntime_docbase="${f_pkgruntime_docbase}"
        l_pkgruntime_etc_crondaily="${f_pkgruntime_etc_crondaily}"
  fi
