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.

37 lines
1.0KB

  1. #!/bin/bash
  2. PKGNAME="${1##*/}"
  3. TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
  4. DIST="$3"
  5. [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
  6. SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
  7. SPECDIR="${SPECFILE%/*}"
  8. RPMPKGNAME="$(get_rpm_package_name.sh ${PKGNAME})"
  9. [ ! -r "${SPECFILE}" ] && exit 2
  10. while read var val; do
  11. case "${var}" in
  12. Version:*) VERSION="${val}";;
  13. Source[0-9]*:|Source:|Patch[0-9]*:)
  14. FILE="${SPECDIR}/${val##*/}"
  15. if [ "${DIST}" = "any" ] && [ "${var//%\{?dist\}/}" = "${var}" ]; then
  16. FILES="${FILE//%\{?dist\}/.}"*
  17. else
  18. FILES="${FILE}"
  19. fi
  20. for FILE in $FILES; do
  21. file=$(rpm --define "tde_pkg ${PKGNAME}" \
  22. --define "tde_version ${TDE_VERSION}" \
  23. --define "name ${RPMPKGNAME}" \
  24. --define "version ${VERSION}" \
  25. --define "dist ${DIST:-$(rpm -E %dist)}" \
  26. -E "${FILE}")
  27. [ -r "${file}" ] && echo "${file}"
  28. done
  29. ;;
  30. esac
  31. done < "${SPECFILE}"