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

version 1.2, 2025/04/07 05:39:23 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  #   Revision 1.2  2025/04/07 05:39:23  snw
 #   Further work on fmd rpm porting  #   Further work on fmd rpm porting
 #  #
Line 78  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 90  else Line 97  else
     echo "[OK]"      echo "[OK]"
 fi  fi
   
 ORIG_TARBALL="freem-${_fmd_freem_version.tar.gz}"  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..."  echo -n "${PGM}:  decompressing source tarball..."
 tar xzf "${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 ]]  if [[ $? != 0 ]]
 then  then
     echo "[FAIL]"      echo "[FAIL]"
Line 104  fi Line 139  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 116  fi Line 151  fi
 echo "${PGM}:  performing substitutions on specfile..."  echo "${PGM}:  performing substitutions on specfile..."
 cat scripts/rpm/freem.spec.in | sed "s/FREEM_VERSION/${RPM_RELEASE}/g" > scripts/rpm/freem.spec  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..."  echo -n "${PGM}:  running spectool..."
 spectool -g -R scripts/rpm/freem.spec &>> "${LOGFILE}"  spectool -g -R scripts/rpm/freem.spec &>> "${LOGFILE}"
 if [[ $? != 0 ]]  if [[ $? != 0 ]]
Line 135  then Line 191  then
 else  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}:  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.2  
changed lines
  Added in v.1.3


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