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.

57 lines
1.7KB

  1. #!/bin/bash -ex
  2. # Usage: build_rpm_package.sh <TDE_PACKAGE> [TDE_VERSION]
  3. # Example: build_rpm_package.sh tdebase 14.0.0
  4. PKGNAME="${1%/}"
  5. PKGNAME="${PKGNAME##*/}"
  6. TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
  7. PATH="$(cd $(dirname $0); pwd):${PATH}"
  8. SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
  9. VERSION=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION} || :)
  10. case "${VERSION}" in *~pre*) PREVERSION="${VERSION#*~}";; esac
  11. DIST="$(rpmdist.sh --dist)"
  12. [ -z "${TMPPATH}" ] && TMPPATH="/dev/shm"
  13. BUILDDIR="${TMPPATH}/BUILD${DIST}.$(uname -i)"
  14. BUILDROOTDIR="${TMPPATH}/BUILDROOT${DIST}.$(uname -i)"
  15. LOGFILE="${TMPPATH}/log.${COMP##*/}"
  16. export TEMPDIR="$(mktemp -d)"
  17. gather_rpm_sources.sh "${PKGNAME}" "${TDE_VERSION}" "${TEMPDIR}"
  18. [ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}"
  19. RPMDIR="$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})"
  20. SRPMDIR="$(rpm -E %{_srcrpmdir}.tde-${TDE_VERSION})"
  21. rpmbuild -ba \
  22. --define "_specdir ${TEMPDIR}" \
  23. --define "_sourcedir ${TEMPDIR}" \
  24. --define "_builddir ${BUILDDIR}" \
  25. --define "_buildrootdir ${BUILDROOTDIR}" \
  26. --define "_tmppath ${TMPPATH}" \
  27. --define "_rpmdir ${RPMDIR}" \
  28. --define "_srcrpmdir ${SRPMDIR}" \
  29. --define '_build_create_debug 1' \
  30. --define "vendor Trinity\ Desktop" \
  31. --define "packager Francois\ Andriot\ <francois.andriot@free.fr>" \
  32. --define "tde_version ${TDE_VERSION}" \
  33. --define "tde_prefix /opt/trinity" \
  34. --define "prevers${PREVERSION:+ion} ${PREVERSION:-0}" \
  35. --define "tde_patch 1" \
  36. --define "with_mpeg 1" \
  37. "${TEMPDIR}/${SPECFILE##*/}"
  38. RET=$?
  39. # Removes BUILDDIR if build succeeded
  40. if [ ${RET} -eq 0 ]; then
  41. rm -rf "${BUILDDIR}/"*${PKGNAME}-${VERSION}*
  42. fi
  43. rm -rf "${TEMPDIR}"
  44. exit $RET