diff options
author | François Andriot <albator78@libertysurf.fr> | 2018-06-02 14:24:39 +0200 |
---|---|---|
committer | François Andriot <albator78@libertysurf.fr> | 2018-06-19 20:11:02 +0200 |
commit | ce947350eb2ae4260a6476e302fb73ad244fe955 (patch) | |
tree | d4e90d6cc68b11d45d8c45d56134f0f0d7906d80 /redhat/build/get_source_files.sh | |
parent | 15e02021e25b2c9a00d7eabaf6b2ffe5238c78b3 (diff) | |
download | tde-packaging-ce947350eb2ae4260a6476e302fb73ad244fe955.tar.gz tde-packaging-ce947350eb2ae4260a6476e302fb73ad244fe955.zip |
RPM: update build scripts
Diffstat (limited to 'redhat/build/get_source_files.sh')
-rwxr-xr-x | redhat/build/get_source_files.sh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/redhat/build/get_source_files.sh b/redhat/build/get_source_files.sh index bec678217..668a5774c 100755 --- a/redhat/build/get_source_files.sh +++ b/redhat/build/get_source_files.sh @@ -1,7 +1,8 @@ #!/bin/bash PKGNAME="${1##*/}" -TDE_VERSION="${2:-14.0.0}" +TDE_VERSION="${2:-14.0.4}" +DIST="$3" [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1 SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION}) @@ -14,12 +15,22 @@ 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}" + FILE="${SPECDIR}/${val##*/}" + if [ "${DIST}" = "any" ] && [ "${var//%\{?dist\}/}" = "${var}" ]; then + FILES="${FILE//%\{?dist\}/.}"* else - echo "Warning: cannot find '${FILE}'" >&2 + FILES="${FILE}" fi + + for FILE in $FILES; do + file=$(rpm --define "tde_pkg ${PKGNAME}" \ + --define "tde_version ${TDE_VERSION}" \ + --define "name ${RPMPKGNAME}" \ + --define "version ${VERSION}" \ + --define "dist ${DIST:-$(rpm -E %dist)}" \ + -E "${FILE}") + [ -r "${file}" ] && echo "${file}" + done ;; esac done < "${SPECFILE}" |