diff options
author | François Andriot <[email protected]> | 2018-11-27 21:34:48 +0100 |
---|---|---|
committer | François Andriot <[email protected]> | 2018-11-27 21:34:48 +0100 |
commit | a615d19df88eb2e989316b480519161945dbc7dc (patch) | |
tree | 369970b98042998b86c11024598155e037b76fec /redhat/build/get_source_files.sh | |
parent | 76a93e0011ade1583a1ec672f33411dfd35454f3 (diff) | |
download | tde-packaging-a615d19df88eb2e989316b480519161945dbc7dc.tar.gz tde-packaging-a615d19df88eb2e989316b480519161945dbc7dc.zip |
RPM: merge redhat directory with master branch
Diffstat (limited to 'redhat/build/get_source_files.sh')
-rwxr-xr-x | redhat/build/get_source_files.sh | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/redhat/build/get_source_files.sh b/redhat/build/get_source_files.sh index b52c023e8..2e30edc9b 100755 --- a/redhat/build/get_source_files.sh +++ b/redhat/build/get_source_files.sh @@ -1,21 +1,36 @@ #!/bin/bash PKGNAME="${1##*/}" -TDE_VERSION="${2:-14.0.0}" +TDE_VERSION="${2:-14.0.5}" +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[0-9]*:|Source:|Patch[0-9]*:) - FILE=$(rpm -E "${SPECDIR}/${val##*/}") - if [ -r "${FILE}" ]; then - echo "${FILE}" + FILE="${SPECDIR}/${val##*/}" + if [ "${DIST}" = "any" ] && [ "${var//%\{?dist\}/}" = "${var}" ]; then + FILES="${FILE//%\{?dist\}/.}"* + else + 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}" |