# autobuild3 defines for autobuild3.

# timestamp_convert unixtimestamp [utcoffset]
timestamp_convert(){
  if [ "$2" ]; then
    # Split hour and minute.
    if [ "${2:0:1}" == "-" ]
    then calc="+"
    else calc="-"
    fi
    hour=${2:1:2}; minute=${2:3:2}; # utcoffset should always contain + or - signs.
    # Delete 0 in hour and minute. having that 0 will make them recognized as oct.
    [ "${minute:0:1}" == "0" ] && minute="${minute:1:1}"
    [ "${hour:0:1}" == "0" ] && hour="${hour:1:1}"
    echo $(($1$calc(${hour}*3600+${minute}*60)))
  else echo "$1"
  fi
}

[ -e .git ] && : ${_GIT=1}
: ${AB_CONTRIB=1}

PKGNAME=autobuild3$( ((_GIT)) && echo "-git-$(git branch 2>/dev/null | grep '*' | sed 's/*\ //g')")
PKGEPOCH=1
PKGVER=1.5.7$( ((_GIT)) && echo "+$(timestamp_convert $(git log -1 --date=raw --pretty=format:%cd))")
PKGDES="Automatic package building tool."
PKGRECOM="distcc ccache"
PKGDEP="dpkg bash apt coreutils autoconf automake autogen spdx-licenses"
PKGREP="autobuild"
PKGSEC=devel

if ((_GIT)); then
	abwarn "You are packing a GIT version of autobuild.
	A trunk version that is not tagged is more likely to have bugs."
fi

ABCLEAN=1
