Add package generator script

- add a 'pckgen' script to generate various OpenCAS packages like
release archives (tar, zip), RPMs (source and binary) as well as to
create version file with metadata
- add a SPEC file for RPM creation
- add Makefile targets to use 'pckgen' script through 'make <package>'

'pckgen' script has a bunch of features for package generation.
Read './pckgen --help' for more information on usage scenarios.

Script is also prepared to easily add new packages creation in the future.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
This commit is contained in:
Rafal Stefanowski
2020-03-03 16:21:31 +01:00
parent 09c585bbcd
commit 7335b321ea
4 changed files with 640 additions and 14 deletions

View File

@@ -1,28 +1,25 @@
#!/bin/bash
#
# Copyright(c) 2012-2019 Intel Corporation
# Copyright(c) 2012-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
VER_FILE=CAS_VERSION
if [ -f ${VER_FILE} ]; then
echo "Using existing ${VER_FILE} version file."
echo ""
echo -e "Using existing ${VER_FILE} version file.\n"
exit 0
else
echo "No ${VER_FILE} found. Preparing default version file."
echo ""
CAS_VERSION_MAIN=20
CAS_VERSION_MAJOR=1
CAS_VERSION_MINOR=0
CAS_BUILD_NO=0000`date +%m%d`
touch ${VER_FILE}
fi
echo -e "No ${VER_FILE} found. Preparing default version file.\n"
CAS_VERSION_MAIN=20
CAS_VERSION_MAJOR=3
CAS_VERSION_MINOR=0
CAS_BUILD_NO=0000`date +%m%d`
touch ${VER_FILE}
CAS_VERSION=$(printf "%02d.%02d.%02d.%s" $CAS_VERSION_MAIN $CAS_VERSION_MAJOR \
$CAS_VERSION_MINOR $CAS_BUILD_NO)