Diff for /freem/scripts/fmd-pkg-rpm between versions 1.1 and 1.3

version 1.1, 2025/04/07 05:19:36 version 1.3, 2025/04/07 13:02:51
Line 25 Line 25
 #   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.  #   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
 #  #
 #   $Log$  #   $Log$
   #   Revision 1.3  2025/04/07 13:02:51  snw
   #   Initial working version of fmd-pkg-rpm
   #
   #   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  #   Revision 1.1  2025/04/07 05:19:36  snw
 #   Initial work on moving rpm packaging to fmd  #   Initial work on moving rpm packaging to fmd
 #  #
Line 51  mkdir -p "${TMPDIR}" Line 57  mkdir -p "${TMPDIR}"
 LOGFILE="${TMPDIR}/pkgbuild.log"  LOGFILE="${TMPDIR}/pkgbuild.log"
 echo "${PGM}:  logging to ${LOGFILE}"  echo "${PGM}:  logging to ${LOGFILE}"
   
   RPM_RELEASE=$(echo "${_fmd_freem_version}" | sed "s/-/~/g")
   
 if [[ ! -f Makefile ]]  if [[ ! -f Makefile ]]
 then  then
     echo -n "${PGM}:  running autogen.sh..."      echo -n "${PGM}:  running autogen.sh..."
Line 73  then Line 81  then
     fi      fi
   
 fi  fi
       
   ORIG_TARBALL="freem-${_fmd_freem_version}.tar.gz"
   ORIG_DIR="freem-${_fmd_freem_version}/"
   NEW_DIR="freem-${RPM_RELEASE}/"
   NEW_TARBALL="freem-${RPM_RELEASE}.tar.gz"
   
 echo -n "${PGM}:  running 'make dist' to prepare source tarball..."  echo -n "${PGM}:  running 'make dist' to prepare source tarball..."
 make dist &>> "${LOGFILE}"  make dist &>> "${LOGFILE}"
Line 85  else Line 97  else
     echo "[OK]"      echo "[OK]"
 fi  fi
   
   echo -n "${PGM}:  cleaning up..."
   rm -rf "${OLD_DIR}" "${NEW_DIR}" "${NEW_TARBALL}" &>> /dev/null
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   echo -n "${PGM}:  decompressing source tarball..."
   tar xzf "${ORIG_TARBALL}"
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   echo -n "${PGM}:  renaming ${ORIG_DIR} -> ${NEW_DIR}..."
   mv "${ORIG_DIR}" "${NEW_DIR}" &>> /dev/null
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   echo -n "${PGM}:  generating ${NEW_TARBALL}..."
   tar cf "${NEW_TARBALL}" "${NEW_DIR}" &>> /dev/null
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   
 echo -n "${PGM}:  uploading source tarball..."  echo -n "${PGM}:  uploading source tarball..."
 scp freem*.tar.gz jpw@freem.coherent-logic.com://var/www/freem.coherent-logic.com/downloads/ &>> "${LOGFILE}"  scp "${NEW_TARBALL}" jpw@freem.coherent-logic.com://var/www/freem.coherent-logic.com/downloads/ &>> "${LOGFILE}"
 if [[ $? != 0 ]]  if [[ $? != 0 ]]
 then  then
     echo "[FAIL]"      echo "[FAIL]"
Line 94  then Line 147  then
 else  else
     echo "[OK]"      echo "[OK]"
 fi  fi
   
   echo "${PGM}:  performing substitutions on specfile..."
   cat scripts/rpm/freem.spec.in | sed "s/FREEM_VERSION/${RPM_RELEASE}/g" > scripts/rpm/freem.spec
   
   RPMROOT="${HOME}/rpmbuild"
   echo -n "${PGM}:  removing ${RPMROOT}..."
   rm -rf "${RPMROOT}" &>> "${LOGFILE}"
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   echo -n "${PGM}:  preparing directory structure..."
   rpmdev-setuptree &>> "${LOGFILE}"
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   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]"
   fi
   
   echo -n "${PGM}:  cleaning up..."
   rm -rf "${OLD_DIR}" "${NEW_DIR}" "${NEW_TARBALL}" &>> /dev/null
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   echo -n "${PGM}:  copying rpm packages..."
   cp ${RPMROOT}/RPMS/${_fmd_arch}/*.rpm . &>> "${LOGFILE}"
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   echo -n "${PGM}:  copying source rpm packages..."
   cp ${RPMROOT}/SRPMS/*.rpm . &>> "${LOGFILE}"
   if [[ $? != 0 ]]
   then
       echo "[FAIL]"
       exit 1
   else
       echo "[OK]"
   fi
   
   RPM_BUILT=$(ls -1 *.rpm)
   
   BLDLST=""
   for PKGFILE in ${RPM_BUILT}
   do
       if [[ "${BLDLST}" == "" ]]
       then
           BLDLST="${PKGFILE}"
       else
           BLDLST="${BLDLST} ${PKGFILE}"
       fi
   done
   
   echo "${PGM}:  built ${BLDLST}"
   

Removed from v.1.1  
changed lines
  Added in v.1.3


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