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.
tde-packaging/redhat/build/get_specfile.sh

31 lines
980 B

#!/bin/bash
PKGNAME="${1##*/}"
TDE_VERSION="${2:-14.0.0}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
[ -d "${TDE_PACKAGING_DIR}" ] || TDE_PACKAGING_DIR=~/tde/tde-packaging
[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/redhat
# Special case for QT3
if [ "${PKGNAME}" = "qt3" ]; then
case "$(rpmdist.sh --dist)" in
.oss*) DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/opensuse ;;
.mga*|.mdk*|.pclos*) DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/mageia ;;
esac
fi
SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-${TDE_VERSION}.spec")
if [ ! -r "${SPECFILE}" ]; then
SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}.spec")
if [ ! -r "${SPECFILE}" ]; then
SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}.spec")
if [ ! -r "${SPECFILE}" ]; then
SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "trinity-${PKGNAME}.spec")
fi
fi
fi
echo ${SPECFILE}