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/gather_rpm_sources.sh

43 lines
1.2 KiB

#!/bin/bash
# Usage: build_rpm_package.sh <TDE_PACKAGE> [TDE_VERSION]
# Example: build_rpm_package.sh tdebase 14.0.0
PKGNAME="${1%/}"
PKGNAME="${PKGNAME##*/}"
TDE_VERSION="${2:-14.0.5}"
TARGETDIR="${3:-/tmp/${PKGNAME}-${TDE_VERSION}}"
DIST="$4"
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
[ -z "${SPECFILE}" ] && exit 1
SOURCES=$(get_source_files.sh ${PKGNAME} ${TDE_VERSION} ${DIST})
TARBALL=$(get_latest_tarball_filename.sh ${PKGNAME} ${TDE_VERSION} || :)
VERSION=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION} || :)
case "${VERSION}" in *~pre*) PREVERSION="${VERSION#*~}";; esac
DIST="$(rpmdist.sh --dist)"
[ -z "${TMPPATH}" ] && TMPPATH="/dev/shm"
BUILDDIR="${TMPPATH}/BUILD${DIST}.$(uname -i)"
BUILDROOTDIR="${TMPPATH}/BUILDROOT${DIST}.$(uname -i)"
LOGFILE="${TMPPATH}/log.${COMP##*/}"
mkdir -p "${TARGETDIR}"
rm -f "${TARGETDIR}/"*
cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TARGETDIR}"
### Check for patches
PATCHDIR="${SPECFILE%/*}/patches/${TDE_VERSION}"
if [ -d "${PATCHDIR}" ]; then
cat "${PATCHDIR}/"*".patch" >>"${TARGETDIR}/one.patch"
sed -i "${TARGETDIR}/"*".spec" \
-e "/^Source0:/ s/$/\nPatch389: one.patch/" \
-e "/%setup/ s/$/\n%patch389 -p1/"
fi
exit $RET