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.
39 lines
1.2 KiB
39 lines
1.2 KiB
#!/bin/bash
|
|
|
|
PKGNAME="${1##*/}"
|
|
TDE_VERSION="${2:-${TDE_VERSION:-14.0.12}}"
|
|
DIST="$3"
|
|
|
|
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
|
|
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
|
|
SPECDIR="${SPECFILE%/*}"
|
|
RPMPKGNAME="$(get_rpm_package_name.sh ${PKGNAME})"
|
|
[ ! -r "${SPECFILE}" ] && exit 2
|
|
|
|
while read var val; do
|
|
case "${var}" in
|
|
Version:*) VERSION="${val}";;
|
|
Source*:|Source:|Patch[0-9]*:)
|
|
FILE="${SPECDIR}/${val##*/}"
|
|
if [ "${DIST}" = "any" ] && [ "${var//%\{?dist\}/}" = "${var}" ]; then
|
|
FILES="${FILE//%\{?dist\}/.}"*
|
|
else
|
|
FILES="${FILE}"
|
|
fi
|
|
|
|
for FILE in $FILES; do
|
|
for name in ${RPMPKGNAME} ${PKGNAME} trinity-${PKGNAME}; do
|
|
file=$(rpm --define "tde_pkg ${PKGNAME}" \
|
|
--define "tde_version ${TDE_VERSION}" \
|
|
--define "name ${name}" \
|
|
--define "version ${VERSION}" \
|
|
--define "dist ${DIST:-$(rpm -E %dist)}" \
|
|
-E "${FILE}")
|
|
[ -r "${file}" ] && break
|
|
done
|
|
[ -r "${file}" ] && echo "${file}"
|
|
done
|
|
;;
|
|
esac
|
|
done < "${SPECFILE}"
|