--- freem/mk-solaris-package	2025/03/08 02:12:22	1.1
+++ freem/mk-solaris-package	2025/03/09 19:14:24	1.6
@@ -1,29 +1,57 @@
 #!/usr/bin/bash
 
-PKGTMP="/tmp/CLDWfreem"
+#
+#   $Id: mk-solaris-package,v 1.6 2025/03/09 19:14:24 snw Exp $
+#    Solaris package builder
+#
+#  
+#   Author: Serena Willis <snw@coherent-logic.com>
+#    Copyright (C) 1998 MUG Deutschland
+#    Copyright (C) 2023, 2025 Coherent Logic Development LLC
+#
+#
+#   This file is part of FreeM.
+#
+#   FreeM is free software: you can redistribute it and/or modify
+#   it under the terms of the GNU Affero Public License as published by
+#   the Free Software Foundation, either version 3 of the License, or
+#   (at your option) any later version.
+#
+#   FreeM is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU Affero Public License for more details.
+#
+#   You should have received a copy of the GNU Affero Public License
+#   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
+#
+#   $Log: mk-solaris-package,v $
+#   Revision 1.6  2025/03/09 19:14:24  snw
+#   First phase of REUSE compliance and header reformat
+#
+#
+# SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
+# SPDX-License-Identifier: AGPL-3.0-or-later
+#
 
-OLDDIR=$(pwd)
-DISTROOT="../../../../"
 
-rm -rf "${PKGTMP}"
+PKG=CLDfreem
+ARCH=$1
+OS=$2
+VERS=$(cat sem.ver)
+SOLVER=$(uname -a | cut -d' ' -f3)
+PKGFILE=${PKG}-${VERS}-${OS}${SOLVER}-${ARCH}.pkg
 
-cd "${DISTROOT}"
-./configure --prefix=${PKGTMP}
-make clean
-make
-make install
-./configure --prefix=/usr/local
-make clean
-make
-cp src/freem ${PKGTMP}/bin/
-cp src/fmadm ${PKGTMP}/bin/
-cd "${OLDDIR}"
-
-cat <<EOF > "${PKGTMP}/pkginfo"
-PKG=CLDWfreem
-NAME=FreeM programming language and database.
-ARCH=sparcv9
-VERSION=$(cat ../../../../sem.ver)
+cat <<EOF > pkginfo
+PKG=${PKG}
+NAME=Coherent Logic Development FreeM programming language and database.
+ARCH=${ARCH}
+VERSION=${VERS}
 CATEGORY=application
 BASEDIR=/usr/local
 EOF
+
+pkgmk -o -d /tmp -a ${ARCH}
+touch ${PKGFILE}
+pkgtrans -s /tmp ${PKGFILE} ${PKG}
+rm -r /tmp/${PKG}