diff options
author | François Andriot <albator78@libertysurf.fr> | 2018-11-27 21:34:48 +0100 |
---|---|---|
committer | François Andriot <albator78@libertysurf.fr> | 2018-11-27 21:34:48 +0100 |
commit | a615d19df88eb2e989316b480519161945dbc7dc (patch) | |
tree | 369970b98042998b86c11024598155e037b76fec /redhat/build/build_rpm_package.sh | |
parent | 76a93e0011ade1583a1ec672f33411dfd35454f3 (diff) | |
download | tde-packaging-a615d19df88eb2e989316b480519161945dbc7dc.tar.gz tde-packaging-a615d19df88eb2e989316b480519161945dbc7dc.zip |
RPM: merge redhat directory with master branch
Diffstat (limited to 'redhat/build/build_rpm_package.sh')
-rwxr-xr-x | redhat/build/build_rpm_package.sh | 55 |
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=$? |