#!/bin/bash # Copyright (c) 2020-2021 Status Research & Development GmbH. Licensed under # either of: # - Apache License, version 2.0 # - MIT license # at your option. This file may not be copied, modified, or distributed except # according to those terms. set -e #################### # argument parsing # #################### GETOPT_BINARY="getopt" if uname | grep -qi darwin; then # macOS GETOPT_BINARY=$(find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null || true) [[ -f "$GETOPT_BINARY" ]] || { echo "GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting."; exit 1; } fi ! ${GETOPT_BINARY} --test > /dev/null if [ ${PIPESTATUS[0]} != 4 ]; then echo '`getopt --test` failed in this environment.' exit 1 fi OPTS="hb:t:" LONGOPTS="help,binary:,tarball:,install-fpm" # default values BINARY="" TARBALL="" PKG_ARCH="" print_help() { cat </dev/null fpm -s dir -t rpm -n "${PKG_NAME}" \ -v "${PKG_VERSION}" \ -C "${PKG_IMG_DIR}" \ -p "${PKG_PATH_RPM}" \ -a "${PKG_ARCH_RPM}" \ --depends redhat-lsb-core \ --after-install "${PKG_SRC_DIR}/after_install" \ --before-remove "${PKG_SRC_DIR}/before_remove" \ --after-remove "${PKG_SRC_DIR}/after_remove" \ --after-upgrade "${PKG_SRC_DIR}/after_upgrade" \ --license "Apache 2.0 + MIT" \ --maintainer "The Nimbus Team" \ --description "$(cat ${PKG_SRC_DIR}/description)" \ --url "https://nimbus.team/" \ 2>/dev/null ls -l "${PKG_PATH_DEB}" "${PKG_PATH_RPM}"