Annotation of freem/scripts/fmd-pkg-rpm, revision 1.1

1.1     ! snw         1: #!/usr/bin/env bash
        !             2: 
        !             3: #
        !             4: #   $Id$
        !             5: #    Creates an rpm package
        !             6: #
        !             7: #  
        !             8: #   Author: Serena Willis <snw@coherent-logic.com>
        !             9: #    Copyright (C) 2025 Coherent Logic Development LLC
        !            10: #
        !            11: #
        !            12: #   This file is part of FreeM.
        !            13: #
        !            14: #   FreeM is free software: you can redistribute it and/or modify
        !            15: #   it under the terms of the GNU Affero Public License as published by
        !            16: #   the Free Software Foundation, either version 3 of the License, or
        !            17: #   (at your option) any later version.
        !            18: #
        !            19: #   FreeM is distributed in the hope that it will be useful,
        !            20: #   but WITHOUT ANY WARRANTY; without even the implied warranty of
        !            21: #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        !            22: #   GNU Affero Public License for more details.
        !            23: #
        !            24: #   You should have received a copy of the GNU Affero Public License
        !            25: #   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
        !            26: #
        !            27: #   $Log$
        !            28: #
        !            29: # SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
        !            30: # SPDX-License-Identifier: AGPL-3.0-or-later
        !            31: #
        !            32: 
        !            33: PGM=$(basename $0)
        !            34: SCRIPT_DIR=$(dirname "$0")
        !            35: 
        !            36: source "${SCRIPT_DIR}/_fmd_common.bash"
        !            37: 
        !            38: if [[ $# != 1 ]]
        !            39: then
        !            40:     echo "${PGM}:  must run from fmd package"
        !            41:     exit 1
        !            42: fi
        !            43: 
        !            44: TMPDIR="/tmp/fmd-pkg-rpm"
        !            45: rm -rf "${TMPDIR}"
        !            46: mkdir -p "${TMPDIR}"
        !            47: 
        !            48: LOGFILE="${TMPDIR}/pkgbuild.log"
        !            49: echo "${PGM}:  logging to ${LOGFILE}"
        !            50: 
        !            51: if [[ ! -f Makefile ]]
        !            52: then
        !            53:     echo -n "${PGM}:  running autogen.sh..."
        !            54:     ./autogen.sh &>> "${LOGFILE}"
        !            55:     if [[ $? != 0 ]]
        !            56:     then
        !            57:        echo "[FAIL]"
        !            58:        exit 1
        !            59:     else
        !            60:        echo "[OK]"
        !            61:     fi
        !            62:     echo -n "${PGM}:  running configure..."
        !            63:     ./configure &>> "${LOGFILE}"
        !            64:     if [[ $? != 0 ]]
        !            65:     then
        !            66:        echo "[FAIL]"
        !            67:        exit 1
        !            68:     else
        !            69:        echo "[OK]"
        !            70:     fi
        !            71: 
        !            72: fi
        !            73:     
        !            74: 
        !            75: echo -n "${PGM}:  running 'make dist' to prepare source tarball..."
        !            76: make dist &>> "${LOGFILE}"
        !            77: if [[ $? != 0 ]]
        !            78: then
        !            79:     echo "[FAIL]"
        !            80:     exit 1
        !            81: else
        !            82:     echo "[OK]"
        !            83: fi
        !            84: 
        !            85: echo -n "${PGM}:  uploading source tarball..."
        !            86: scp freem*.tar.gz jpw@freem.coherent-logic.com://var/www/freem.coherent-logic.com/downloads/ &>> "${LOGFILE}"
        !            87: if [[ $? != 0 ]]
        !            88: then
        !            89:     echo "[FAIL]"
        !            90:     exit 1
        !            91: else
        !            92:     echo "[OK]"
        !            93: fi

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>