summaryrefslogtreecommitdiffstats
path: root/redhat/build/gather_rpm_sources.sh
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2018-06-02 14:24:39 +0200
committerFrançois Andriot <albator78@libertysurf.fr>2018-06-19 20:11:02 +0200
commitce947350eb2ae4260a6476e302fb73ad244fe955 (patch)
treed4e90d6cc68b11d45d8c45d56134f0f0d7906d80 /redhat/build/gather_rpm_sources.sh
parent15e02021e25b2c9a00d7eabaf6b2ffe5238c78b3 (diff)
downloadtde-packaging-ce947350eb2ae4260a6476e302fb73ad244fe955.tar.gz
tde-packaging-ce947350eb2ae4260a6476e302fb73ad244fe955.zip
RPM: update build scripts
Diffstat (limited to 'redhat/build/gather_rpm_sources.sh')
-rwxr-xr-xredhat/build/gather_rpm_sources.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/redhat/build/gather_rpm_sources.sh b/redhat/build/gather_rpm_sources.sh
new file mode 100755
index 000000000..fb9499e4f
--- /dev/null
+++ b/redhat/build/gather_rpm_sources.sh
@@ -0,0 +1,39 @@
+#!/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.4}"
+TARGETDIR="${3:-/tmp/${PKGNAME}-${TDE_VERSION}}"
+DIST="$4"
+
+SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
+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}"
+
+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