#!/bin/sh
#
# source:
#   /var/cvs/projects/debian/dpkg.common/substfiles,v
#
# revision:
#   @(#) substfiles,v 1.5 1998/09/12 21:45:03 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 host and package name and version.
#
#   Definition of the standard directories and files in Debian.
#   Currently it is a mix of fhs and fsstnd.  This files is intended
#   to be supplemented by each package using the file
#   ../dpkg.scripts/substfiles.
#
#   I also parse the changelog file to find the source package name
#   and version.
#
#   This is incomplete shell script.  It must be included in another
#   file.


# host:
  # directories:
    d_host_bin="/bin"
    d_host_bin_usr="/usr/bin"
    d_host_bin_s="/sbin"
    d_host_bin_s_usr="/usr/sbin"
    d_host_bin_cgi="/usr/lib/cgi-bin"

    d_host_include="/usr/include"

    d_host_lib="/lib"
    d_host_lib_usr="/usr/lib"
    d_host_lib_python="${d_host_lib_usr}/python1.5"
    d_host_lib_python_sitepackages="${d_host_lib_python}/site-packages"

    d_host_man="/usr/man"

    d_host_dict="/usr/share/dict"
    d_host_doc="/usr/doc"
    d_host_docbase="/usr/share/doc-base"
    d_host_pixmaps="/usr/X11R6/include/X11/pixmaps"

    d_host_etc="/etc"
    d_host_etc_crondaily="${d_host_etc}/cron.daily"
    d_host_etc_initd="${d_host_etc}/init.d"

    d_host_info="/usr/info"
    d_host_menu="/usr/lib/menu"

    d_host_tmp="/tmp"
    d_host_var="/var"
    d_host_log="/var/log"
    d_host_run="/var/run"
    d_host_cache="/var/cache"

    d_host_www="/var/www"
    d_host_www_doc="${d_host_www}/doc"
    d_host_www_cgi="${d_host_www}/cgi-bin"

    d_host_opt="/opt"
    d_host_opt_etc="/etc/opt"
    d_host_opt_var="/var/opt"


  # files:
    f_host_perl="/usr/bin/perl"
    f_host_python="/usr/bin/python"
    f_host_wish="/usr/bin/wish"

    f_host_etc_inetd="/etc/inetd.conf"
    f_host_etc_service="/etc/services"

    f_host_mimetypes="/etc/mime.types"

    f_host_dict_words="${d_host_dict}/words"
    f_host_dict_cracklib="${d_host_dict}/cracklib"


# package information (from changelog):
  subtmp=$(dpkg-parsechangelog | grep "Date: ")
  date="${subtmp#Date: }"
  date_utc=$(date --utc --rfc --date "${date}")

  subtmp=$(dpkg-parsechangelog | grep "Source: ")
  pkg="${subtmp#Source: }"

  subtmp=$(dpkg-parsechangelog | grep "Version: ")
  subtmp="${subtmp#Version: }"
  ver="${subtmp%-*}"
  ver_major="${ver%.*}"
  ver_minor="${ver##*.}"
  ver_deb="${subtmp##*-}"

  pvd="${pkg}-${ver}-${ver_deb}"
