RPM packaging: update build script

pull/3/head
François Andriot 8 years ago
parent 2d66eb30a9
commit 2150671c5f

@ -4,7 +4,8 @@
# Example: build_rpm_package.sh tdebase 14.0.0 # Example: build_rpm_package.sh tdebase 14.0.0
PKGNAME="${1##*/}" PKGNAME="${1%/}"
PKGNAME="${PKGNAME##*/}"
TDE_VERSION="${2:-14.0.0}" TDE_VERSION="${2:-14.0.0}"
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION}) SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
@ -23,50 +24,14 @@ cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TEMPDIR}"
### Check for patches ### 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}" PATCHDIR="${SPECFILE%/*}/patches/${TDE_VERSION}"
PATCHLIST="${PATCHDIR}/patches.list" if [ -d "${PATCHDIR}" ]; then
if [ -r "${PATCHLIST}" ]; then cat "${PATCHDIR}/"*".patch" >>"${TEMPDIR}/one.patch"
while read l; do sed -i "${TEMPDIR}/"*".spec" \
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/$/\nPatch389: one.patch/" \ -e "/^Source0:/ s/$/\nPatch389: one.patch/" \
-e "/%setup/ s/$/\n%patch389 -p1/" -e "/%setup/ s/$/\n%patch389 -p1/"
fi 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}" [ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}"
RPMDIR="$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})" RPMDIR="$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})"

Loading…
Cancel
Save