--- freem/scripts/_fmd_common.bash 2025/04/06 03:38:05 1.1 +++ freem/scripts/_fmd_common.bash 2025/04/14 13:06:46 1.6 @@ -1,5 +1,5 @@ # -# $Id: _fmd_common.bash,v 1.1 2025/04/06 03:38:05 snw Exp $ +# $Id: _fmd_common.bash,v 1.6 2025/04/14 13:06:46 snw Exp $ # fmd common functions # # @@ -23,6 +23,21 @@ # along with FreeM. If not, see . # # $Log: _fmd_common.bash,v $ +# Revision 1.6 2025/04/14 13:06:46 snw +# Add OS/2 RPM build script to fmd +# +# Revision 1.5 2025/04/10 15:27:39 snw +# Detect Devuan distribution and fix OS/2 problem with iniconf.c +# +# Revision 1.4 2025/04/07 05:19:15 snw +# Initial work on moving rpm packaging to fmd +# +# Revision 1.3 2025/04/07 01:23:10 snw +# Add OS detection for Raspbian +# +# Revision 1.2 2025/04/07 00:45:52 snw +# Enhance fmd-pkg-dpkg to auto-generate the debian/changelog file from the FreeM ChangeLog +# # Revision 1.1 2025/04/06 03:38:05 snw # Prepare for adding packaging functionality to fmd # @@ -40,6 +55,15 @@ function _fmd_os_detect() case $_fmd_kernel in + "os/2") + export _fmd_arch=i386 + export _fmd_subarch=i386 + export _fmd_osversion=$(echo "${_fmd_uname}" | cut -d" " -f3) + export _fmd_distribution="OS/2" + export _fmd_distfamily="OS/2" + export _fmd_can_package=1 + export _fmd_pkg_mechanism=os2rpm + sunos) export _fmd_arch=$(isainfo | cut -d" " -f2) export _fmd_subarch=$(isainfo | cut -d" " -f1) @@ -170,13 +194,27 @@ function _fmd_os_detect() export _fmd_can_package=0 export _fmd_pkg_mechanism="pacman" ;; - + + devuan) + export _fmd_distribution="devuan" + export _fmd_distfamily="debian" + export _fmd_can_package=1 + export _fmd_pkg_mechanism="dpkg" + ;; + debian) export _fmd_distribution="debian" export _fmd_distfamily="debian" export _fmd_can_package=1 export _fmd_pkg_mechanism="dpkg" ;; + + raspbian) + export _fmd_distribution="raspbian" + export _fmd_distfamily="debian" + export _fmd_can_package=1 + export _fmd_pkg_mechanism="dpkg" + ;; ubuntu) export _fmd_distribution="ubuntu" @@ -203,21 +241,21 @@ function _fmd_os_detect() export _fmd_distribution="opensuse" export _fmd_distfamily="suse" export _fmd_can_package=0 - export _fmd_pkg_mechanism="rpm+zypper" + export _fmd_pkg_mechanism="rpm" ;; - rocky) + rockylinux) export _fmd_distribution="rocky" export _fmd_distfamily="redhat" export _fmd_can_package=1 - export _fmd_pkg_mechanism="rpm+yum" + export _fmd_pkg_mechanism="rpm" ;; fedora) export _fmd_distribution="fedora" export _fmd_distfamily="redhat" export _fmd_can_package=1 - export _fmd_pkg_mechanism="rpm+dnf" + export _fmd_pkg_mechanism="rpm" ;; unknown) @@ -247,7 +285,8 @@ function _fmd_loadconfig() { export _fmd_cvsuser=$(cat "${_fmd_rc}" | grep "user=" | cut -d= -f2) export _fmd_email=$(cat "${_fmd_rc}" | grep "email=" | cut -d= -f2) - export _fmd_fullname=$(cat "${_fmd_rc}" | grep "fullname=" | cut -d= -f2) + export _fmd_fullname=$(cat "${_fmd_rc}" | grep "fullname=" | cut -d= -f2) + export _fmd_mantis_key=$(cat "${_fmd_rc}" | grep "mantis_key=" | cut -d= -f2) } function _fmd_reconfig() @@ -260,9 +299,12 @@ function _fmd_reconfig() read _fmd_email echo -n "What is your full name? " read _fmd_fullname + echo -n "What is your Mantis API key? " + read _fmd_mantis_key echo "user=${_fmd_cvsuser}" > "${_fmd_rc}" echo "email=${_fmd_email}" >> "${_fmd_rc}" echo "fullname=${_fmd_fullname}" >> "${_fmd_rc}" + echo "mantis_key=${_fmd_mantis_key}" >> "${_fmd_rc}" echo echo "fmd: wrote ${_fmd_rc}" } @@ -280,6 +322,14 @@ function _fmd_chkconfig() _fmd_loadconfig } +function _fmd_next_dpkg() +{ + local URL="https://freem.coherent-logic.com/nextdpkg.cfm?release=${_fmd_freem_version}&arch=${_fmd_arch}" + local RESULT=$(curl "${URL}" 2>/dev/null) + + echo "${RESULT}" +} + function _fmd_commands() { ls -1 ${_fmd_script_dir}/fmd-* | cut -d'-' -f2 | grep -v "~"