export HASH=`curl https://git.tesses.org/tesses50/tessesframework/archive/$VERSION.tar.gz 2> /dev/null | shasum -a 256 | awk '{print $1}'`

echo "class Tessesframework < Formula" > "Formula/tessesframework.rb"
echo "  desc \"\"" >> "Formula/tessesframework.rb"
echo "  homepage \"\"" >> "Formula/tessesframework.rb"
echo "  url \"https://git.tesses.org/tesses50/tessesframework/archive/$VERSION.tar.gz\"" >> "Formula/tessesframework.rb"
echo "  sha256 \"$HASH\"" >> "Formula/tessesframework.rb"
echo "  license \"GPLv3\"" >> "Formula/tessesframework.rb"
echo "  depends_on \"cmake\" => :build" >> "Formula/tessesframework.rb"
echo "  depends_on \"mbedtls@3\"" >> "Formula/tessesframework.rb"
echo "  def install" >> "Formula/tessesframework.rb"
echo "    system \"cmake\", \"-S\", \".\", \"-B\", \"build\", \"-DTESSESFRAMEWORK_FETCHCONTENT=OFF\", *std_cmake_args" >> "Formula/tessesframework.rb"
echo "    system \"cmake\", \"--build\", \"build\"" >> "Formula/tessesframework.rb"
echo "    system \"cmake\", \"--install\", \"build\"" >> "Formula/tessesframework.rb"
echo "  end" >> "Formula/tessesframework.rb"
echo "  test do" >> "Formula/tessesframework.rb"
echo "    system \"true\"" >> "Formula/tessesframework.rb"
echo "  end" >> "Formula/tessesframework.rb"
echo "end" >> "Formula/tessesframework.rb"