diff options
author | François Andriot <albator78@libertysurf.fr> | 2016-10-05 20:06:56 +0200 |
---|---|---|
committer | François Andriot <albator78@libertysurf.fr> | 2016-10-05 20:06:56 +0200 |
commit | 2150671c5fe249c41dc0b4a79744acb72e73a7fe (patch) | |
tree | 0a288c6ca233596b0083e3882e5f3c2749824340 /redhat/build | |
parent | 2d66eb30a910962d066120071681deeecc52d835 (diff) | |
download | tde-packaging-2150671c5fe249c41dc0b4a79744acb72e73a7fe.tar.gz tde-packaging-2150671c5fe249c41dc0b4a79744acb72e73a7fe.zip |
RPM packaging: update build script
Diffstat (limited to 'redhat/build')
-rwxr-xr-x | redhat/build/build_rpm_package.sh | 45 |
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})" |