File:  [Coherent Logic Development] / freem / scripts / fmd-package
Revision 1.3: download - view: text, annotated - select for diffs
Mon Apr 7 00:45:52 2025 UTC (3 months, 3 weeks ago) by snw
Branches: MAIN
CVS tags: HEAD
Enhance fmd-pkg-dpkg to auto-generate the debian/changelog file from the FreeM ChangeLog

    1: #!/usr/bin/env bash
    2: 
    3: #
    4: #   $Id: fmd-package,v 1.3 2025/04/07 00:45:52 snw Exp $
    5: #    Prepare a binary package for the current platform
    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: fmd-package,v $
   28: #   Revision 1.3  2025/04/07 00:45:52  snw
   29: #   Enhance fmd-pkg-dpkg to auto-generate the debian/changelog file from the FreeM ChangeLog
   30: #
   31: #   Revision 1.2  2025/04/06 05:01:21  snw
   32: #   Initial working implementation of fmd package for dpkg
   33: #
   34: #   Revision 1.1  2025/04/06 03:38:05  snw
   35: #   Prepare for adding packaging functionality to fmd
   36: #
   37: #
   38: # SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
   39: # SPDX-License-Identifier: AGPL-3.0-or-later
   40: #
   41: 
   42: PGM=$(basename $0)
   43: SCRIPT_DIR=$(dirname "$0")
   44: 
   45: function usage() {
   46:     echo
   47:     echo "Builds a binary package of the current FreeM code"
   48:     echo
   49:     echo "usage:"
   50:     echo
   51:     echo "  fmd package"
   52:     echo
   53:     echo "NOTE: You cannot build a package for a different"
   54:     echo "      platform. That is, if you're running on a"
   55:     echo "      Solaris system, you can only build a Solaris"
   56:     echo "      package."
   57:     echo
   58:     exit 0
   59: }
   60: 
   61: if [[ $1 == "help" ]]
   62: then
   63:     usage
   64: fi
   65: 
   66: if [[ $# != 1 ]]
   67: then
   68:     echo "package:  must be run from 'fmd package'"
   69:     exit 1
   70: fi
   71: 
   72: if [[ ${_fmd_can_package} == 0 ]]
   73: then
   74:     echo "package:  FreeM does not yet support binary packages on ${_fmd_distribution} ${_fmd_kernel}"
   75:     exit 1
   76: else
   77:     echo "package:  building ${_fmd_pkg_mechanism} package on ${_fmd_distribution} ${_fmd_kernel}"
   78: fi
   79: 
   80: CMDSCRIPT="${SCRIPT_DIR}/fmd-pkg-${_fmd_pkg_mechanism}"
   81: 
   82: if [[ -f "${CMDSCRIPT}" ]]
   83: then
   84:     ${CMDSCRIPT} $1 $2
   85: else
   86:     echo "package:  ${CMDSCRIPT} not found"
   87: fi

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