Trinity Desktop Environment Packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.6KB

  1. #!/bin/bash
  2. WORKERS=$(getconf _NPROCESSORS_ONLN)
  3. TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
  4. LOCKFILE="/tmp/lock.${0##*/}"
  5. while [ -e "${LOCKFILE}" ]; do
  6. echo "Waiting for lock file '${LOCKFILE}' to vanish."
  7. sleep 3
  8. done
  9. ARCH="$(rpm -E %{_target_cpu})"
  10. RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})
  11. [ -d "${RPMDIR}/noarch" ] || mkdir -p "${RPMDIR}/noarch"
  12. [ -d "${RPMDIR}/${ARCH}" ] || mkdir -p "${RPMDIR}/${ARCH}"
  13. if [ -x /usr/sbin/urpmi ]; then
  14. REPOUPDATE='(cd ${RPMDIR}; genhdlist2 --clean --allow-empty noarch & genhdlist2 --clean --allow-empty ${ARCH} & wait; sudo urpmi.update rpmbuild.${ARCH} rpmbuild.noarch)'
  15. elif [ -x /usr/bin/dnf ]; then
  16. REPOUPDATE='(cd ${RPMDIR}; createrepo --workers=${WORKERS} ${ARCH} & createrepo --workers=${WORKERS} noarch & wait; sudo dnf --repo="rpmbuild*" clean expire-cache)'
  17. elif [ -x /usr/bin/zypper ]; then
  18. REPOUPDATE='(cd ${RPMDIR}; createrepo --workers=${WORKERS} ${ARCH} & createrepo --workers=${WORKERS} noarch & wait; sudo zypper refresh rpmbuild.${ARCH} rpmbuild.noarch)'
  19. elif [ -x /usr/bin/yum ]; then
  20. if [ "$(rpm -E %dist)" = ".el5" ]; then
  21. REPOUPDATE='(cd ${RPMDIR}; createrepo ${ARCH} & createrepo noarch & wait; sudo yum clean metadata --disablerepo="*" --enablerepo="rpmbuild*")'
  22. else
  23. REPOUPDATE='(cd ${RPMDIR}; createrepo --workers=${WORKERS} ${ARCH} & createrepo --workers=${WORKERS} noarch & wait; sudo yum clean metadata --disablerepo="*" --enablerepo="rpmbuild*")'
  24. fi
  25. elif [ -x /usr/bin/apt-get ]; then
  26. REPOUPDATE='(cd ${RPMDIR}; genpkglist $PWD noarch & genpkglist $PWD ${ARCH} & wait; genbasedir $PWD i586 x86_64 noarch; sudo apt-get update)'
  27. fi
  28. eval "${REPOUPDATE}; rm -f ${LOCKFILE}" || exit 1