blob: bec6782174574dee2b89745c1613dd202fc95d24 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/bin/bash
PKGNAME="${1##*/}"
TDE_VERSION="${2:-14.0.0}"
[ -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[0-9]*:|Source:|Patch[0-9]*:)
FILE=$(rpm --define "tde_pkg ${PKGNAME}" --define "tde_version ${TDE_VERSION}" --define "name ${RPMPKGNAME}" --define "version ${VERSION}" -E "${SPECDIR}/${val##*/}")
if [ -r "${FILE}" ]; then
echo "${FILE}"
else
echo "Warning: cannot find '${FILE}'" >&2
fi
;;
esac
done < "${SPECFILE}"
|