diff --git a/tools/rpm/build-rpm-from-git.sh b/tools/rpm/build-rpm-from-git.sh
index 02106d8c3..c075b3f49 100755
--- a/tools/rpm/build-rpm-from-git.sh
+++ b/tools/rpm/build-rpm-from-git.sh
@@ -1,50 +1,56 @@
 #!/bin/sh
 # automated build script
 if ! which rpmbuild > /dev/null 2>&1
 then
     echo "Cannot build rpms without 'rpmbuild' installed"
     exit 1
 fi
 
 MYRPM_BUILD_DIR=$(rpmbuild --showrc 2>&1 | sed -n -e 's/^.*: _topdir[	 ]\+\(.*\)$/\1/p')
 echo Building RPMs in ${MYRPM_BUILD_DIR}
 
 for d in "${PWD}" "${PWD%/src}" "${PWD%/tools/rpm}" "$1"
 do \
     if test -d "${d}/.git"
     then
         LAMMPS_PATH="${d}"
         break
     fi
 done
 
 if test -z "${LAMMPS_PATH}"
 then
     echo "'${PWD}' is not a suitable working directory"
     exit 1
 fi
 
 for d in SPECS SOURCES RPMS SRPMS BUILD BUILDROOT
 do \
   dir="${MYRPM_BUILD_DIR}/${d}"
   test -d "${dir}" || mkdir -p "${dir}" || exit 2
 done
 
 for d in cache debug drpms repodata
 do \
   dir="${MYRPM_BUILD_DIR}/RPMS/${d}"
   test -d "${dir}" || mkdir -p "${dir}" || exit 2
 done
 
 pushd "${LAMMPS_PATH}"
 datestr=$(date +%Y%m%d)
 sed -e "/^Version/s/\(Version:[ 	]\+\)[0-9].*$/\1${datestr}/" tools/rpm/lammps.spec > ${MYRPM_BUILD_DIR}/SPECS/lammps.spec
 
 git archive -v --format=tar --prefix=lammps-current/ HEAD \
     README LICENSE doc/Manual.pdf doc/PDF src lib python  \
     examples/{README,dipole,peri,hugoniostat,colloid,crack,friction,msst,obstacle,body,sputter,pour,ELASTIC,neb,ellipse,flow,meam,min,indent,micelle,shear,srd,dreiding,eim,prd,rigid,COUPLE,peptide,melt,comb,tad,reax,USER/{awpmd,misc,phonon,cg-cmm}} \
     bench potentials tools/*.cpp tools/*.f \
     | gzip -9c - > "${MYRPM_BUILD_DIR}/SOURCES/lammps-current.tar.gz"
 popd
 
-rpmbuild --clean --rmsource --rmspec -ba "${MYRPM_BUILD_DIR}/SPECS/lammps.spec"
+# we use the source rpm on suse, since they do not have a "dist" tag.
+if grep -q -i suse /etc/issue && test $(uname -i) = i386
+then
+    rpmbuild --clean --rmsource --rmspec -ba "${MYRPM_BUILD_DIR}/SPECS/lammps.spec"
+else
+    rpmbuild --clean --rmsource --rmspec -bb "${MYRPM_BUILD_DIR}/SPECS/lammps.spec"
+fi
diff --git a/tools/rpm/sync-to-repo.sh b/tools/rpm/sync-to-repo.sh
index 94dd20d81..ce60c29cc 100755
--- a/tools/rpm/sync-to-repo.sh
+++ b/tools/rpm/sync-to-repo.sh
@@ -1,45 +1,45 @@
 #!/bin/sh
 # sync data from build directory to repository
 
 if ! which rpmbuild > /dev/null 2>&1
 then
     echo "Cannot build rpms without 'rpmbuild' installed"
     exit 1
 fi
 
 MYRPM_BUILD_DIR=$(rpmbuild --showrc 2>&1 | sed -n -e 's/^.*: _topdir[	 ]\+\(.*\)$/\1/p')
 
 if [ -n "${MYRPM_REPO_USER}" ] \
 && [ -n "${MYRPM_REPO_HOST}" ] \
 && [ -n "${MYRPM_REPO_DIR}" ]
 then
     pushd ${MYRPM_BUILD_DIR}/RPMS
     # move debuginfo rpms, if present
     for f in *-debuginfo-*.rpm
     do \
         test -f $f && mv -v $f debug/
     done
     createrepo -v --deltas --num-deltas 2 --max-delta-rpm-size 30000000 .
-    rsync -arpv debug repodata drpms *.rpm \
+    rsync -arpv --delete debug repodata drpms *.rpm \
         ${MYRPM_REPO_USER}@${MYRPM_REPO_HOST}:${MYRPM_REPO_DIR}/
     # we use the source rpm on suse, since they do not have a "dist" tag.
     if grep -q -i suse /etc/issue && test $(uname -i) = i386
     then
         cd ../SRPMS
         rsync -arpv *.rpm \
             ${MYRPM_REPO_USER}@${MYRPM_REPO_HOST}:${MYRPM_REPO_DIR}/../../../source/
     fi
-    ssh ${MYRPM_REPO_USER}@${MYRPM_REPO_HOST} "cd ${MYRPM_REPO_DIR}/../../../; ./mkindexhtml.sh"
+    ssh ${MYRPM_REPO_USER}@${MYRPM_REPO_HOST} "cd ${MYRPM_REPO_DIR}/../../../; ./mkhtmlindex.sh"
     popd
 else
     cat <<EOF
 
 Required environment variables to determine the target repository
 account, server and location are not fully configured.
 MYRPM_REPO_USER=${MYRPM_REPO_USER}
 MYRPM_REPO_HOST=${MYRPM_REPO_HOST}
 MYRPM_REPO_DIR=${MYRPM_REPO_DIR}
 
 EOF
     exit 1
 fi