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.

48 lines
1.3KB

  1. #!/bin/bash -x
  2. TDE_VERSION="${1:-${TDE_VERSION:-14.0.5}}"
  3. ARCH=$(rpm -E %_target_cpu)
  4. RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})
  5. [ -d "${RPMDIR}/noarch" ] || mkdir -p "${RPMDIR}/noarch"
  6. [ -d "${RPMDIR}/${ARCH}" ] || mkdir -p "${RPMDIR}/${ARCH}"
  7. # RHEL / CentOS / Fedora
  8. if [ -x /usr/bin/yum ]; then
  9. cat <<EOF >/tmp/rpmbuild-tde.repo
  10. [rpmbuild.${ARCH}]
  11. name=rpmbuild.${ARCH}
  12. baseurl=file://${RPMDIR}/${ARCH}
  13. enabled=1
  14. gpgcheck=0
  15. [rpmbuild.noarch]
  16. name=rpmbuild.noarch
  17. baseurl=file://${RPMDIR}/noarch
  18. enabled=1
  19. gpgcheck=0
  20. EOF
  21. sudo mv -f /tmp/rpmbuild-tde.repo /etc/yum.repos.d/
  22. fi
  23. # Mageia / Mandriva
  24. if [ -x "/usr/sbin/urpmi" ]; then
  25. sudo urpmi.removemedia -y "rpmbuild"
  26. sudo urpmi.addmedia "rpmbuild.${ARCH}" "${RPMDIR}/${ARCH}"
  27. sudo urpmi.addmedia "rpmbuild.noarch" "${RPMDIR}/noarch"
  28. fi
  29. # openSUSE
  30. if [ -x /usr/bin/zypper ]; then
  31. sudo rm -f "/etc/zypp/repos.d/rpmbuild"*
  32. sudo zypper ar -G "${RPMDIR}/${ARCH}" "rpmbuild.${ARCH}"
  33. sudo zypper ar -G "${RPMDIR}/noarch" "rpmbuild.noarch"
  34. fi
  35. # PCLOS
  36. if [ -x "/usr/bin/apt-get" ]; then
  37. [ ! -L "${RPMDIR}/RPMS.${ARCH}" ] && ln -sf "${ARCH}" "${RPMDIR}/RPMS.${ARCH}"
  38. [ ! -L "${RPMDIR}/RPMS.noarch" ] && ln -sf "noarch" "${RPMDIR}/RPMS.noarch"
  39. echo "rpm file:${RPMDIR%/*} ${RPMDIR##*/} ${ARCH} noarch" | sudo tee "/etc/apt/sources.list.d/rpmbuild.list"
  40. fi