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

1.1     ! snw         1: #!/usr/bin/bash
        !             2: 
        !             3: #
        !             4: #   $Id$
        !             5: #    Solaris package builder
        !             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: PKG=CLDfreem
        !            45: ARCH=${_fmd_subarch}
        !            46: OS=${_fmd_distribution}
        !            47: VERS=${_fmd_freem_version}
        !            48: SOLVER=${_fmd_osversion}
        !            49: PKGFILE=${PKG}-${VERS}-${OS}${SOLVER}-${ARCH}.pkg
        !            50: 
        !            51: echo "${PGM}:  producing pkgadd package \"${PKGFILE}\""
        !            52: 
        !            53: TMPDIR="/tmp/fmd-pkg-pkgadd"
        !            54: rm -rf "${TMPDIR}"
        !            55: mkdir -p "${TMPDIR}"
        !            56: 
        !            57: LOGFILE="${TMPDIR}/pkgbuild.log"
        !            58: echo "${PGM}:  logging to ${LOGFILE}"
        !            59: 
        !            60: cat <<EOF > pkginfo
        !            61: PKG=${PKG}
        !            62: NAME=Coherent Logic Development FreeM programming language and database
        !            63: ARCH=${ARCH}
        !            64: VERSION=${VERS}
        !            65: CATEGORY=application
        !            66: BASEDIR=/usr/local
        !            67: EOF
        !            68: 
        !            69: echo -n "${PGM}:  running pkgmk... "
        !            70: pkgmk -o -d /tmp -a ${ARCH} &>> "${LOGFILE}"
        !            71: if [[ $? == 0 ]]
        !            72: then
        !            73:     echo "[OK]"
        !            74: else
        !            75:     echo "[FAIL]"
        !            76:     exit 1
        !            77: fi
        !            78: touch ${PKGFILE}
        !            79: 
        !            80: echo -n "${PGM}:  running pkgtrans... "
        !            81: pkgtrans -s /tmp ${PKGFILE} ${PKG} &>> "${LOGFILE}"
        !            82: if [[ $? == 0 ]]
        !            83: then
        !            84:     echo "[OK]"
        !            85: else
        !            86:     echo "[FAIL]"
        !            87:     exit 1
        !            88: fi
        !            89: 
        !            90: echo -n "${PGM}:  cleaning up... "
        !            91: rm -r /tmp/${PKG}
        !            92: if [[ $? == 0 ]]
        !            93: then
        !            94:     echo "[OK]"
        !            95: else
        !            96:     echo "[FAIL]"
        !            97:     exit 1
        !            98: fi

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