|
From: Jeff S. <jsq...@us...> - 2002-10-30 12:31:02
|
jsquyres 02/10/30 04:31:00
Added: dist .cvsignore Makefile.am VERSION get_maildb_version
maildb_functions.m4 maildb_get_version.m4
Log:
First take of skeleton structure for maildb
Revision Changes Path
1.1 maildb/dist/.cvsignore
Index: .cvsignore
===================================================================
Makefile
Makefile.in
config.guess
config.sub
install-sh
ltmain.sh
missing
mkinstalldirs
1.1 maildb/dist/Makefile.am
Index: Makefile.am
===================================================================
# -*- makefile -*-
#
# Copyright (c) 2002 Jeff Squyres
#
# This file is part of the MailDB software package. For license
# information, see the LICENSE file in the top level directory of the
# MailDB source distribution.
#
# $Id: Makefile.am,v 1.1 2002/10/30 12:31:00 jsquyres Exp $
#
EXTRA_DIST = \
get_maildb_version \
maildb_functions.m4 \
maildb_get_version.m4
1.1 maildb/dist/VERSION
Index: VERSION
===================================================================
major=0
minor=1
release=0
alpha=0
beta=1
cvs=1
1.1 maildb/dist/get_maildb_version
Index: get_maildb_version
===================================================================
#!/bin/sh
#
# Copyright (c) 2002 Jeff Squyres
#
# This file is part of the MailDB software package. For license
# information, see the LICENSE file in the top level directory of the
# MailDB source distribution.
#
# $Id: get_maildb_version,v 1.1 2002/10/30 12:31:00 jsquyres Exp $
#
# Since we do this in multiple places, it's worth putting in a
# separate shell script. Very primitive script to get the version
# number of LAM into a coherent variable. Can query for any of the
# individual parts of the version number, too.
#
srcfile="$1"
option="$2"
if test "$srcfile" = ""; then
option="--help"
else
LAM_MAJOR_VERSION="`cat $srcfile | grep major | cut -d= -f2`"
LAM_MINOR_VERSION="`cat $srcfile | grep minor | cut -d= -f2`"
LAM_RELEASE_VERSION="`cat $srcfile | grep release | cut -d= -f2`"
LAM_ALPHA_VERSION="`cat $srcfile | grep alpha | cut -d= -f2`"
LAM_BETA_VERSION="`cat $srcfile | grep beta | cut -d= -f2`"
LAM_CVS_VERSION="`cat $srcfile | grep cvs | cut -d= -f2`"
if test "$LAM_RELEASE_VERSION" != "0" -a "$LAM_RELEASE_VERSION" != ""; then
LAM_VERSION="$LAM_MAJOR_VERSION.$LAM_MINOR_VERSION.$LAM_RELEASE_VERSION"
else
LAM_VERSION="$LAM_MAJOR_VERSION.$LAM_MINOR_VERSION"
fi
if test "`expr $LAM_ALPHA_VERSION \> 0`" = "1"; then
LAM_VERSION="${LAM_VERSION}a$LAM_ALPHA_VERSION"
elif test "`expr $LAM_BETA_VERSION \> 0`" = "1"; then
LAM_VERSION="${LAM_VERSION}b$LAM_BETA_VERSION"
fi
if test "$LAM_CVS_VERSION" = "1"; then
LAM_VERSION="${LAM_VERSION}cvs"
elif test "`expr $LAM_CVS_VERSION \> 0`" = "1"; then
LAM_VERSION="${LAM_VERSION}cvs$LAM_CVS_VERSION"
fi
if test "$option" = ""; then
option="--full"
fi
fi
case "$option" in
--full|-v|--version)
echo $LAM_VERSION
;;
--major)
echo $LAM_MAJOR_VERSION
;;
--minor)
echo $LAM_MINOR_VERSION
;;
--release)
echo $LAM_RELEASE_VERSION
;;
--alpha)
echo $LAM_ALPHA_VERSION
;;
--beta)
echo $LAM_BETA_VERSION
;;
--cvs)
echo $LAM_CVS_VERSION
;;
-h|--help)
cat <<EOF
$0 <srcfile> [<option>]
<srcfile> - Text version file
<option> - One of:
--full - Full version number
--major - Major version number
--minor - Minor version number
--release - Release version number
--alpha - Alpha version number
--beta - Beta version nmumber
--cvs - CVS date stamp
--help - This message
EOF
esac
exit 0
1.1 maildb/dist/maildb_functions.m4
Index: maildb_functions.m4
===================================================================
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2002 Jeff Squyres
dnl
dnl This file is part of the MailDB software package. For license
dnl information, see the LICENSE file in the top level directory of the
dnl MailDB source distribution.
dnl
dnl $Id: maildb_functions.m4,v 1.1 2002/10/30 12:31:00 jsquyres Exp $
dnl
AC_DEFUN(MAILDB_CONFIGURE_SETUP,[
# Some helper script functions. Unfortunately, we cannot use $1 kinds
# of arugments here because of the m4 substitution. So we have to set
# special variable names before invoking the function. :-\
maildb_show_title() {
cat <<EOF
============================================================================
== ${1}
============================================================================
EOF
}
maildb_show_subtitle() {
cat <<EOF
*** ${1}
EOF
}])
AC_DEFUN(MAILDB_BASIC_SETUP,[
#
# Make automake clean emacs ~ files for "make clean"
#
CLEANFILES="*~"
AC_SUBST(CLEANFILES)
#
# This is useful later
#
AC_CANONICAL_HOST
])
AC_DEFUN(MAILDB_LOG_MSG,[
# 1 is the message
# 2 is whether to put a prefix or not
if test -n "$2"; then
echo "configure:__oline__: $1" >&5
else
echo $1 >&5
fi])dnl
AC_DEFUN(MAILDB_LOG_FILE,[
# 1 is the filename
if test -n "$1" -a -f "$1"; then
cat $1 >&5
fi])dnl
AC_DEFUN(MAILDB_LOG_COMMAND,[
# 1 is the command
# 2 is actions to do if success
# 3 is actions to do if fail
echo "configure:__oline__: $1" >&5
$1 1>&5 2>&1
maildb_status=$?
MAILDB_LOG_MSG([\$? = $maildb_status], 1)
if test "$maildb_status" = "0"; then
unset maildb_status
$2
else
unset maildb_status
$3
fi])dnl
1.1 maildb/dist/maildb_get_version.m4
Index: maildb_get_version.m4
===================================================================
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2002 Jeff Squyres
dnl
dnl This file is part of the MailDB software package. For license
dnl information, see the LICENSE file in the top level directory of the
dnl MailDB source distribution.
dnl
dnl $Id: maildb_get_version.m4,v 1.1 2002/10/30 12:31:00 jsquyres Exp $
dnl
define(MAILDB_GET_VERSION,[
gv_glv_dir="$1"
gv_ver_file="$2"
gv_prefix="$3"
# Find the get_maildb_version program
gv_prog="sh $gv_glv_dir/get_maildb_version $gv_ver_file"
dnl quote eval to suppress macro expansion with non-GNU m4
gv_run() {
[eval] ${gv_prefix}_${2}=`$gv_prog --${1}`
}
gv_run full VERSION
gv_run major MAJOR_VERSION
gv_run minor MINOR_VERSION
gv_run release RELEASE_VERSION
gv_run alpha ALPHA_VERSION
gv_run beta BETA_VERSION
gv_run cvs CVS_VERSION
# Clean up
unset gv_glv_dir gv_ver_file gv_prefix gv_prog gv_run
])
|