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.

42 lines
1.2KB

  1. #!/bin/bash
  2. # Usage: gather_rpm_sources.sh <TDE_PACKAGE> <TDE_VERSION> <DESTINATION>
  3. # Example: gather_rpm_sources.sh tdebase 14.0.0 /tmp/tdebase
  4. PKGNAME="${1%/}"
  5. PKGNAME="${PKGNAME##*/}"
  6. TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
  7. TARGETDIR="${3:-/tmp/${PKGNAME}-${TDE_VERSION}}"
  8. DIST="$4"
  9. SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
  10. [ -z "${SPECFILE}" ] && exit 1
  11. SOURCES=$(get_source_files.sh ${PKGNAME} ${TDE_VERSION} ${DIST})
  12. TARBALL=$(get_latest_tarball_filename.sh ${PKGNAME} ${TDE_VERSION} || :)
  13. VERSION=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION} || :)
  14. case "${VERSION}" in *~pre*) PREVERSION="${VERSION#*~}";; esac
  15. DIST="$(rpmdist.sh --dist)"
  16. [ -z "${TMPPATH}" ] && TMPPATH="/dev/shm"
  17. BUILDDIR="${TMPPATH}/BUILD${DIST}.$(uname -i)"
  18. BUILDROOTDIR="${TMPPATH}/BUILDROOT${DIST}.$(uname -i)"
  19. LOGFILE="${TMPPATH}/log.${COMP##*/}"
  20. mkdir -p "${TARGETDIR}"
  21. rm -f "${TARGETDIR}/"*
  22. cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TARGETDIR}"
  23. ### Check for patches
  24. PATCHDIR="${HOME}/tde/patches/${TDE_VERSION}/$1"
  25. if [ -d "${PATCHDIR}" ]; then
  26. cat "${PATCHDIR}/"*".patch" >>"${TARGETDIR}/one.patch"
  27. sed -i "${TARGETDIR}/"*".spec" \
  28. -e "/^Source0:/ s/$/\nPatch389: one.patch/" \
  29. -e "/%setup/ s/$/\n%patch389 -p1/"
  30. fi
  31. exit $RET