#!/bin/sh

#
#  Copyright (C) 2004-2008 Freeciv team

# Version definition for Freeciv.

MAJOR_VERSION="3"
MINOR_VERSION="0"
PATCH_VERSION="6"
EMERGENCY_VERSION=""
VERSION_LABEL=""

# Type is either "development" or "stable"
# Date is relevant only for "stable" releases
if test "$VERSION_LABEL" = "" ; then
  RELEASE_TYPE="stable"
  RELEASE_DATE="2023-02-03"
else
  RELEASE_TYPE="development"
fi

# 1) Development until MAJOR and MINOR version numbers are
#    set to new release series:
#   - IS_DEVEL_VERSION=1
#   - IS_FREEZE_VERSION=0
#   - IS_BETA_VERSION=0
#
# 2) Development from version number bump to entering beta mode:
#   - IS_DEVEL_VERSION=1
#   - IS_FREEZE_VERSION=1
#   - IS_BETA_VERSION=0
#
# 3) Development during beta mode, starting latest from beta1,
#    until first RC:
#   - IS_DEVEL_VERSION=0
#   - IS_FREEZE_VERSION=0
#   - IS_BETA_VERSION=1
#
# 4) Stable, starting from first RC:
#   - IS_DEVEL_VERSION=0
#   - IS_FREEZE_VERSION=0
#   - IS_BETA_VERSION=0
#
# 5) Final.
# Update DEFAULT_FOLLOW_TAG to "stable", and also
# windows/installer_msys2/Makefile --with-followtag to "windows"

IS_DEVEL_VERSION=0
IS_FREEZE_VERSION=0
IS_BETA_VERSION=0

NEXT_STABLE_VERSION="3.0.0"

# 0 to disable display of release month until we can make better estimate
RELEASE_MONTH=3

DATASUBDIR=3.0
DEFAULT_FOLLOW_TAG=stable

# Freeciv network capstring: see documentation in common/capstr.c
#
# +Freeciv.Devel.YYYY.MMM.DD is the base capability string.
#
#   - No new mandatory capabilities can be added to the release branch; doing
#     so would break network capability of supposedly "compatible" releases.
#
#   - Avoid adding a new mandatory capability to the development branch for
#     as long as possible.  We want to maintain network compatibility with
#     the stable branch for as long as possible.
NETWORK_CAPSTRING_MANDATORY="+Freeciv-3.0-network"
NETWORK_CAPSTRING_OPTIONAL="year32 plrculture32 pingfix researchclr cityculture32"

FREECIV_DISTRIBUTOR=""

if test "x$FREECIV_LABEL_FORCE" != "x" ; then
  VERSION_LABEL=$(echo $FREECIV_LABEL_FORCE | sed "s/<base>/$VERSION_LABEL/g")
fi

if test x$VERSION_REVTYPE = xgit && command -v git > /dev/null ; then
  VERSION_REV="$(git rev-parse --short HEAD)"
else
  VERSION_REV=""
fi
if test "x$VERSION_REV" != "x" ; then
  case "x$VERSION_LABEL" in
    x*+) ;;
    *) VERSION_REV="+${VERSION_REV}" ;;
  esac
fi

if test x$EMERGENCY_VERSION != x ; then
  EMERG_PART=".${EMERGENCY_VERSION}"
fi

if test x$VERSION_SCRIPT_SILENT != xyes ; then
  VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EMERG_PART}${VERSION_LABEL}${VERSION_REV}
  echo ${VERSION}
fi
