summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_specfile.sh
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2014-01-24 20:46:50 +0100
committerFrançois Andriot <albator78@libertysurf.fr>2014-01-24 20:46:50 +0100
commit43429e67cfc03fdf5065e90c197753ec5f15aa19 (patch)
tree3f85e6c48280c03682aa2aa92fca68fd9aa60634 /redhat/build/get_specfile.sh
parentdf55195d132cbe6af516c6f1883315f26abd7f4a (diff)
downloadtde-packaging-43429e67cfc03fdf5065e90c197753ec5f15aa19.tar.gz
tde-packaging-43429e67cfc03fdf5065e90c197753ec5f15aa19.zip
RPM Packaging: update build scripts
Diffstat (limited to 'redhat/build/get_specfile.sh')
-rwxr-xr-xredhat/build/get_specfile.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/redhat/build/get_specfile.sh b/redhat/build/get_specfile.sh
new file mode 100755
index 000000000..d60748604
--- /dev/null
+++ b/redhat/build/get_specfile.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+PKGNAME="${1##*/}"
+TDE_VERSION="${2:-14.0.0}"
+
+[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
+
+[ -d "${TDE_SPECDIR}" ] || TDE_SPECDIR=~/tde/tde-packaging/redhat
+
+# Special case for QT3
+if [ "${PKGNAME}" = "qt3" ]; then
+ case "$(rpmdist.sh --dist)" in
+ .oss*) TDE_SPECDIR=~/tde/tde-packaging/opensuse ;;
+ .mga*|.mdk*|.pclos*) TDE_SPECDIR=~/tde/tde-packaging/mageia ;;
+ esac
+fi
+
+SPECFILE=$(find "${TDE_SPECDIR}" -name "${PKGNAME}-${TDE_VERSION}.spec")
+if [ ! -r "${SPECFILE}" ]; then
+ SPECFILE=$(find "${TDE_SPECDIR}" -name "${PKGNAME}.spec")
+ if [ ! -r "${SPECFILE}" ]; then
+ SPECFILE=$(find "${TDE_SPECDIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}.spec")
+ if [ ! -r "${SPECFILE}" ]; then
+ SPECFILE=$(find "${TDE_SPECDIR}" -name "trinity-${PKGNAME}.spec")
+ fi
+ fi
+fi
+
+echo ${SPECFILE}