#!/bin/sh -e
#
# Build the project, generate the documentation and source tarball
#
# Use these script at your own risk!
# These are generally for Unix platforms.
# Start this script from the source directory.
#
# License:
#      Zipios -- a small C++ library that provides easy access to .zip files.
#
#      Copyright (c) 2015-2022  Made to Order Software Corp.  All Rights Reserved
#
#      This library is free software; you can redistribute it and/or
#      modify it under the terms of the GNU Lesser General Public
#      License as published by the Free Software Foundation; either
#      version 2.1 of the License, or (at your option) any later version.
#
#      This library is distributed in the hope that it will be useful,
#      but WITHOUT ANY WARRANTY; without even the implied warranty of
#      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#      Lesser General Public License for more details.
#
#      You should have received a copy of the GNU Lesser General Public
#      License along with this library; if not, write to the Free Software
#      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
#


# Run the standard build process
# This include running all the test and if that fails the packing will
# also fail
dev/build

# Generate the package source
make -C ../BUILD/zipios package_source

# Generate the Doxygen documentation (you must have Doxygen and DOT)
make -C ../BUILD/zipios zipios_Documentation

# Copy the resulting files to the packages folder
. dev/version

mkdir -p ../packages
cp ../BUILD/zipios/zipios-${FULL_VERSION}.tar.gz ../packages
cp ../BUILD/zipios/doc/zipios-doc-${VERSION}.tar.gz ../packages

