--- freem/scripts/fmd-pkg-rpm 2025/04/07 05:19:36 1.1 +++ freem/scripts/fmd-pkg-rpm 2025/04/07 05:39:23 1.2 @@ -1,7 +1,7 @@ #!/usr/bin/env bash # -# $Id: fmd-pkg-rpm,v 1.1 2025/04/07 05:19:36 snw Exp $ +# $Id: fmd-pkg-rpm,v 1.2 2025/04/07 05:39:23 snw Exp $ # Creates an rpm package # # @@ -25,6 +25,9 @@ # along with FreeM. If not, see . # # $Log: fmd-pkg-rpm,v $ +# Revision 1.2 2025/04/07 05:39:23 snw +# Further work on fmd rpm porting +# # Revision 1.1 2025/04/07 05:19:36 snw # Initial work on moving rpm packaging to fmd # @@ -51,6 +54,8 @@ mkdir -p "${TMPDIR}" LOGFILE="${TMPDIR}/pkgbuild.log" echo "${PGM}: logging to ${LOGFILE}" +RPM_RELEASE=$(echo "${_fmd_freem_version}" | sed "s/-/~/g") + if [[ ! -f Makefile ]] then echo -n "${PGM}: running autogen.sh..." @@ -85,11 +90,47 @@ else echo "[OK]" fi +ORIG_TARBALL="freem-${_fmd_freem_version.tar.gz}" + +echo -n "${PGM}: decompressing source tarball..." +tar xzf "${TARBALL}" +if [[ $? != 0 ]] +then + echo "[FAIL]" + exit 1 +else + echo "[OK]" +fi + + echo -n "${PGM}: uploading source tarball..." scp freem*.tar.gz jpw@freem.coherent-logic.com://var/www/freem.coherent-logic.com/downloads/ &>> "${LOGFILE}" if [[ $? != 0 ]] then echo "[FAIL]" + exit 1 +else + echo "[OK]" +fi + +echo "${PGM}: performing substitutions on specfile..." +cat scripts/rpm/freem.spec.in | sed "s/FREEM_VERSION/${RPM_RELEASE}/g" > scripts/rpm/freem.spec + +echo -n "${PGM}: running spectool..." +spectool -g -R scripts/rpm/freem.spec &>> "${LOGFILE}" +if [[ $? != 0 ]] +then + echo "[FAIL]" + exit 1 +else + echo "[OK]" +fi + +echo -n "${PGM}: building package..." +rpmbuild -ba scripts/rpm/freem.spec &>> "${LOGFILE}" +if [[ $? != 0 ]] +then + echo "[FAIL]" exit 1 else echo "[OK]"