Annotation of freem-mk-debian-package/mk-debian-package, revision 1.1

1.1     ! snw         1: #!/usr/bin/env bash
        !             2: 
        !             3: #
        !             4: #   $Id$
        !             5: #    Creates a Debian package for a specific FreeM version
        !             6: #
        !             7: #  
        !             8: #   Author: Serena Willis <snw@coherent-logic.com>
        !             9: #    Copyright (C) 1998 MUG Deutschland
        !            10: #    Copyright (C) 2025 Coherent Logic Development LLC
        !            11: #
        !            12: #
        !            13: #   This file is part of FreeM.
        !            14: #
        !            15: #   FreeM is free software: you can redistribute it and/or modify
        !            16: #   it under the terms of the GNU Affero Public License as published by
        !            17: #   the Free Software Foundation, either version 3 of the License, or
        !            18: #   (at your option) any later version.
        !            19: #
        !            20: #   FreeM is distributed in the hope that it will be useful,
        !            21: #   but WITHOUT ANY WARRANTY; without even the implied warranty of
        !            22: #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        !            23: #   GNU Affero Public License for more details.
        !            24: #
        !            25: #   You should have received a copy of the GNU Affero Public License
        !            26: #   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
        !            27: #
        !            28: #   $Log$
        !            29: #
        !            30: # SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
        !            31: # SPDX-License-Identifier: AGPL-3.0-or-later
        !            32: #
        !            33: 
        !            34: PGM=$(basename $0)
        !            35: 
        !            36: function usage() {
        !            37:     echo "usage:  ${PGM} <freem-version>"
        !            38:     exit 1
        !            39: }
        !            40: 
        !            41: if [[ $# != 1 ]]
        !            42: then
        !            43:     usage
        !            44: fi
        !            45: 
        !            46: FREEM_VERSION=$1
        !            47: 
        !            48: SRCDIR=$(pwd)
        !            49: TMPDIR=$(mktemp -d)
        !            50: INFILE="freem-${FREEM_VERSION}.tar.gz"
        !            51: OUTFILE="${TMPDIR}/freem_${FREEM_VERSION}.tar.gz"
        !            52: TARDIR="${TMPDIR}/freem-${FREEM_VERSION}"
        !            53: 
        !            54: URL="https://freem.coherent-logic.com/downloads/freem-${FREEM_VERSION}.tar.gz"
        !            55: echo -n "${PGM}:  downloading ${URL} to ${OUTFILE}..."
        !            56: curl -s "${URL}" > "${OUTFILE}"
        !            57: if [[ $? == 0 ]]
        !            58: then
        !            59:     echo "[OK]"
        !            60: else
        !            61:     echo "[FAIL]"
        !            62:     exit 1
        !            63: fi
        !            64: 
        !            65: echo -n "${PGM}:  extracting ${OUTFILE} to ${TARDIR}..."
        !            66: tar zxf "${OUTFILE}" -C "${TMPDIR}"
        !            67: if [[ $? == 0 ]]
        !            68: then
        !            69:     echo "[OK]"
        !            70: else
        !            71:     echo "[FAIL]"
        !            72:     exit 1
        !            73: fi
        !            74: 
        !            75: sed -i "s/FREEM_VERSION/${FREEM_VERSION}/g" debian/changelog
        !            76: 
        !            77: echo -n "${PGM}:  copying Debian packaging control info to ${TARDIR}..."
        !            78: cp -r debian "${TARDIR}/"
        !            79: if [[ $? == 0 ]]
        !            80: then
        !            81:     echo "[OK]"
        !            82: else
        !            83:     echo "[FAIL]"
        !            84:     exit 1
        !            85: fi
        !            86: 
        !            87: echo "${PGM}:  building the package..."
        !            88: cd "${TARDIR}"
        !            89: debuild -us -uc

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