summaryrefslogtreecommitdiffstats
path: root/redhat/build
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/build')
-rwxr-xr-xredhat/build/build_rpm_package.sh45
1 files changed, 5 insertions, 40 deletions
diff --git a/redhat/build/build_rpm_package.sh b/redhat/build/build_rpm_package.sh
index 77a506207..127b3a070 100755
--- a/redhat/build/build_rpm_package.sh
+++ b/redhat/build/build_rpm_package.sh
@@ -4,7 +4,8 @@
# 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})
@@ -23,50 +24,14 @@ cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TEMPDIR}"
### Check for patches
-# 1. Check if there is a big, monolithic patch
-PATCHDIR="${SPECFILE%/*}/patches"
-BIGPATCH="${PATCHDIR}/${PKGNAME}-${TDE_VERSION}.patch"
-if [ -r "${BIGPATCH}" ]; then
- cp -f "${BIGPATCH}" "${TEMPDIR}/one.patch"
-fi
-
-# 2. Check if there are small, local patches
PATCHDIR="${SPECFILE%/*}/patches/${TDE_VERSION}"
-PATCHLIST="${PATCHDIR}/patches.list"
-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 \
+if [ -d "${PATCHDIR}" ]; then
+ cat "${PATCHDIR}/"*".patch" >>"${TEMPDIR}/one.patch"
+ sed -i "${TEMPDIR}/"*".spec" \
-e "/^Source0:/ s/$/\nPatch389: one.patch/" \
-e "/%setup/ s/$/\n%patch389 -p1/"
fi
-# 3. PCLinuxOS hack ...
-if [ -r "/etc/pclinuxos-release" ]; then
- sed -i "${TEMPDIR}/${SPECFILE##*/}" \
- -e "/admin\/Makefile.common/ s|^|touch config.h.in;|" \
- || exit 1
-fi
-
[ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}"
RPMDIR="$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})"