summaryrefslogtreecommitdiffstats
path: root/redhat/build/build_rpm_package.sh
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/build/build_rpm_package.sh')
-rwxr-xr-xredhat/build/build_rpm_package.sh55
1 files changed, 11 insertions, 44 deletions
diff --git a/redhat/build/build_rpm_package.sh b/redhat/build/build_rpm_package.sh
index d36f44299..b61478d84 100755
--- a/redhat/build/build_rpm_package.sh
+++ b/redhat/build/build_rpm_package.sh
@@ -4,52 +4,22 @@
# Example: build_rpm_package.sh tdebase 14.0.0
-PKGNAME="${1##*/}"
+PKGNAME="${1%/}"
+PKGNAME="${PKGNAME##*/}"
TDE_VERSION="${2:-14.0.0}"
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
-SOURCES=$(get_source_files.sh ${PKGNAME} ${TDE_VERSION})
-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)"
-BUILDDIR="/dev/shm/BUILD${DIST}.$(uname -i)"
-BUILDROOTDIR="/dev/shm/BUILDROOT${DIST}.$(uname -i)"
-LOGFILE=/tmp/log.${COMP##*/}
+[ -z "${TMPPATH}" ] && TMPPATH="/dev/shm"
+BUILDDIR="${TMPPATH}/BUILD${DIST}.$(uname -i)"
+BUILDROOTDIR="${TMPPATH}/BUILDROOT${DIST}.$(uname -i)"
+LOGFILE="${TMPPATH}/log.${COMP##*/}"
-TEMPDIR="$(mktemp -d)"
-cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TEMPDIR}"
-
-# Check if there are local patches
-PATCHDIR="${SPECFILE%/*}/patches/${TDE_VERSION}"
-PATCHLIST="${PATCHDIR}/patches"
-if [ -r "${PATCHLIST}" ]; then
- while read l; do
- APPLY=""
- case "${l}" in
- ""|"#"*);;
- *"opensuse"*) [ -r /etc/SuSE-release ] && APPLY=1;;
- *) APPLY=1;;
- esac
-
- if [ "${APPLY}" ]; then
- if [ -r "${PATCHDIR}/${l}" ]; then
- echo "Applying patch '${l}'..."
- cat "${PATCHDIR}/${l}" >>"${TEMPDIR}/one.patch"
- else
- echo "ERROR: invalid patch '${l}' !!"
- exit 3
- fi
- fi
- done < "${PATCHLIST}"
-fi
-
-if [ -r "${TEMPDIR}/one.patch" ]; then
- sed -i "${TEMPDIR}/"*.spec \
- -e "/^Source0:/ s/$/\nPatch0: one.patch/" \
- -e "/%setup/ s/$/\n%patch0 -p1/"
-fi
+export TEMPDIR="$(mktemp -d)"
+gather_rpm_sources.sh "${PKGNAME}" "${TDE_VERSION}" "${TEMPDIR}"
[ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}"
@@ -61,6 +31,7 @@ rpmbuild -ba \
--define "_sourcedir ${TEMPDIR}" \
--define "_builddir ${BUILDDIR}" \
--define "_buildrootdir ${BUILDROOTDIR}" \
+ --define "_tmppath ${TMPPATH}" \
--define "_rpmdir ${RPMDIR}" \
--define "_srcrpmdir ${SRPMDIR}" \
--define '_build_create_debug 1' \
@@ -68,13 +39,9 @@ rpmbuild -ba \
--define "packager Francois\ Andriot\ <francois.andriot@free.fr>" \
--define "tde_version ${TDE_VERSION}" \
--define "tde_prefix /opt/trinity" \
- --define "preversion ${PREVERSION:-}" \
- --define "with_akode 1" \
- --define "with_jack 1" \
- --define "with_lame 1" \
- --define "with_mad 1" \
+ --define "prevers${PREVERSION:+ion} ${PREVERSION:-0}" \
+ --define "tde_patch 1" \
--define "with_mpeg 1" \
- --define "with_xscreensaver 1" \
"${TEMPDIR}/${SPECFILE##*/}"
RET=$?