diff options
Diffstat (limited to 'redhat/build')
-rwxr-xr-x | redhat/build/build_rpm_package.sh | 14 | ||||
-rwxr-xr-x | redhat/build/get_installed_package_version.sh | 2 | ||||
-rwxr-xr-x | redhat/build/get_latest_tarball_filename.sh | 47 | ||||
-rwxr-xr-x | redhat/build/get_rpm_package_name.sh | 59 | ||||
-rwxr-xr-x | redhat/build/get_source_files.sh | 5 | ||||
-rwxr-xr-x | redhat/build/get_specfile.sh | 2 |
6 files changed, 83 insertions, 46 deletions
diff --git a/redhat/build/build_rpm_package.sh b/redhat/build/build_rpm_package.sh index d36f44299..77a547b18 100755 --- a/redhat/build/build_rpm_package.sh +++ b/redhat/build/build_rpm_package.sh @@ -21,9 +21,18 @@ LOGFILE=/tmp/log.${COMP##*/} TEMPDIR="$(mktemp -d)" cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TEMPDIR}" -# Check if there are local 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}" -PATCHLIST="${PATCHDIR}/patches" +PATCHLIST="${PATCHDIR}/patches.list" if [ -r "${PATCHLIST}" ]; then while read l; do APPLY="" @@ -69,6 +78,7 @@ rpmbuild -ba \ --define "tde_version ${TDE_VERSION}" \ --define "tde_prefix /opt/trinity" \ --define "preversion ${PREVERSION:-}" \ + --define "tde_patch 1" \ --define "with_akode 1" \ --define "with_jack 1" \ --define "with_lame 1" \ diff --git a/redhat/build/get_installed_package_version.sh b/redhat/build/get_installed_package_version.sh index 5a8e282b8..ae2e726c1 100755 --- a/redhat/build/get_installed_package_version.sh +++ b/redhat/build/get_installed_package_version.sh @@ -14,7 +14,7 @@ if [ -z "${VERSION}" ] || [[ "${VERSION}" =~ "not installed" ]]; then fi VERSION=${VERSION/-*_/\~} -VERSION=${VERSION%-[0-9]} +#VERSION=${VERSION%-[0-9]} VERSION=${VERSION%.opt} VERSION=${VERSION%.[a-z]*} diff --git a/redhat/build/get_latest_tarball_filename.sh b/redhat/build/get_latest_tarball_filename.sh index 3cdeb904d..0e1d6ebdc 100755 --- a/redhat/build/get_latest_tarball_filename.sh +++ b/redhat/build/get_latest_tarball_filename.sh @@ -6,22 +6,37 @@ TDE_VERSION="${2:-14.0.0}" [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1 [ -d "${TARBALLS_DIR}" ] || TARBALLS_DIR=~/tde/tde-tarballs/${TDE_VERSION}/ [ -d "${TDE_PACKAGING_DIR}" ] || TDE_PACKAGING_DIR=~/tde/tde-packaging -[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${PACKAGING_DIR}/redhat/ +[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/redhat/ + +EXTRA_DIR="$(cd ${TARBALLS_DIR}/../extras/; pwd)" + +RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 + +RET=$(find "${TARBALLS_DIR}" "${EXTRA_DIR}" -name "${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-[0-9]*.tar.gz" | sort -n | tail -n 1) -if [ -z "${RET}" ]; then - RET=$(find "${TARBALLS_DIR}/../extras/" -name "${PKGNAME}[-_][0-9]*.tar.*" | sort -n | tail -n 1) -fi -if [ ! -r "${RET}" ]; then - # Retry without 'trinity-*', and allow any TAR extension. - RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -n | tail -n 1) - if [ ! -r "${RET}" ]; then - # Retry by removing numbers in package name, e.g "imlib1" => "imlib" - RET=$(find "${DIST_PACKAGING_DIR}" -name "$(tr -d "[0-9]" <<< ${PKGNAME})-[0-9]*.tar*" | sort -n | tail -n 1) - fi -fi - -[ -z "${RET}" ] && exit 2 - -echo "${RET}" +[ -r "${RET}" ] && echo "${RET}" && exit 0 + +RET=$(find "${EXTRA_DIR}" -name "${PKGNAME}[-_][0-9]*.tar.*" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 + +# Now look in the 'tde-packaging' directory +RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 + +# Retry without 'trinity-*', and allow any TAR extension. +RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 + +# Retry without 'trinity-*', and allow any TAR extension. +RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 + +# Retry by removing numbers in package name, e.g "imlib1" => "imlib" +RET=$(find "${DIST_PACKAGING_DIR}" -name "$(tr -d "[0-9]" <<< ${PKGNAME})-[0-9]*.tar*" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 + + exit 0 diff --git a/redhat/build/get_rpm_package_name.sh b/redhat/build/get_rpm_package_name.sh index 520da9e6a..2c891fdba 100755 --- a/redhat/build/get_rpm_package_name.sh +++ b/redhat/build/get_rpm_package_name.sh @@ -20,7 +20,9 @@ case "${PKGNAME}" in # In case prefix is already there, don't add it again. "trinity-"*) PREFIX="";; # Most TDE dependencies have no prefix - "avahi-tqt"|"dbus-tqt"|"dbus-1-tqt"|"libart-lgpl"|"libcarddav"|"libcaldav"|"python-tqt"|"sip4-tqt"|"qt3"|"tqscintilla"|"tqt3"|"tqtinterface"|"tqca"|"tqca-tls") PREFIX="";; + "avahi-tqt"|"dbus-tqt"|"dbus-1-tqt"|"libart-lgpl"|"libcaldav"|"libcarddav"|"python-tqt"|"sip4-tqt"|"qt3"|"tqscintilla"|"tqt3"|"tqtinterface"|"tqca"|"tqca-tls") PREFIX="";; + # Most TDE libraries have no prefix + #"libkdcraw") PREFIX="";; # 3rd party dependencies "esound"|"fileshareset"|"hk_classes"|"python-qt3") PREFIX="";; # Extra build stuff @@ -40,23 +42,27 @@ fi case "${PKGNAME}" in # Some packages have different runtime name than source package. - "avahi-tqt") PKGRUNTIME="${lib}avahi-tqt1";; - "dbus-tqt") PKGRUNTIME="${lib}dbus-tqt-1-0";; - "dbus-1-tqt") PKGRUNTIME="${lib}dbus-1-tqt0";; - "esound") PKGRUNTIME="esound-libs";; - "koffice") PKGRUNTIME="koffice-suite";; - "libart-lgpl") PKGRUNTIME="${lib}art_lgpl_2-2";; - "libcaldav") PKGRUNTIME="${lib}caldav0";; - "libcarddav") PKGRUNTIME="${lib}carddav0";; - "tqscintilla") PKGRUNTIME="${lib}tqscintilla7";; - "tqca") PKGRUNTIME="${lib}tqca1";; - "tqca-tls") PKGRUNTIME="${lib}tqt3-mt-tqca-tls";; - "tqt3") PKGRUNTIME="${lib}tqt3-mt";; + "avahi-tqt") PKGRUNTIME="${lib}avahi-tqt1";; + "dbus-tqt") PKGRUNTIME="${lib}dbus-tqt-1-0";; + "dbus-1-tqt") PKGRUNTIME="${lib}dbus-1-tqt0";; + "esound") PKGRUNTIME="esound-libs";; + "koffice") PKGRUNTIME="koffice-suite";; + "libart-lgpl") PKGRUNTIME="${lib}art_lgpl_2-2";; + "libcaldav") PKGRUNTIME="${lib}caldav0";; + "libcarddav") PKGRUNTIME="${lib}carddav0";; + "libkdcraw") PKGRUNTIME="${lib}kdcraw4";; + "libkexiv2") PKGRUNTIME="${lib}kexiv2-5";; + "libkipi") PKGRUNTIME="${lib}kipi0";; + "tqscintilla") PKGRUNTIME="${lib}tqscintilla7";; + "tqca") PKGRUNTIME="${lib}tqca1";; + "tqca-tls") PKGRUNTIME="${lib}tqt3-mt-tqca-tls";; + "tqt3") PKGRUNTIME="${lib}tqt3-mt";; "tqtinterface") PKGRUNTIME="${lib}tqt4";; # Language package: install only French language package - "k3b-i18n"|"koffice-i18n"|"tde-i18n") PKGRUNTIME="${PKGNAME}-French";; + "k3b-i18n"|"koffice-i18n"|"tde-i18n") + PKGRUNTIME="${PKGNAME}-French";; # Default case: runtime package has same name as source package - *) PKGRUNTIME="${PKGNAME}";; + *) PKGRUNTIME="${PKGNAME}";; esac # Finally, display the runtime package name. @@ -80,19 +86,22 @@ if [ -n "${DEVEL}" ]; then # Some package have specific development package. case "${PKGNAME}" in - "avahi-tqt") PKGDEVEL="libavahi-tqt-devel";; - "dbus-tqt") PKGDEVEL="libdbus-tqt-1-devel";; - "dbus-1-tqt") PKGDEVEL="libdbus-1-tqt-devel";; - "esound") PKGDEVEL="esound-devel";; - "pan") PKGDEVEL="uulib-devel";; + "avahi-tqt") PKGDEVEL="libavahi-tqt-devel";; + "dbus-tqt") PKGDEVEL="libdbus-tqt-1-devel";; + "dbus-1-tqt") PKGDEVEL="libdbus-1-tqt-devel";; + "esound") PKGDEVEL="esound-devel";; + "pan") PKGDEVEL="uulib-devel";; "libart-lgpl") PKGDEVEL="libart_lgpl-devel";; - "libcaldav") PKGDEVEL="${lib}caldav-devel";; - "libcarddav") PKGDEVEL="${lib}carddav-devel";; - "tqca") PKGDEVEL="${lib}tqca-devel";; + "libcaldav") PKGDEVEL="${lib}caldav-devel";; + "libcarddav") PKGDEVEL="${lib}carddav-devel";; + "libkdcraw") PKGDEVEL="${lib}kdcraw-devel";; + "libkexiv2") PKGDEVEL="${lib}kexiv2-devel";; + "libkipi") PKGDEVEL="${lib}kipi-devel";; + "tqca") PKGDEVEL="${lib}tqca-devel";; "tqscintilla") PKGDEVEL="${lib}tqscintilla-devel";; - "tqt3") PKGDEVEL="tqt3-dev-tools tqt3-apps-devel tqt3-compat-headers";; + "tqt3") PKGDEVEL="tqt3-dev-tools tqt3-apps-devel tqt3-compat-headers";; # Default case: development package has same name as runtime package, plus '-devel' suffix. - *) PKGDEVEL="${PKGRUNTIME}-devel";; + *) PKGDEVEL="${PKGRUNTIME}-devel";; esac # Finally, other packages do have a '-devel' diff --git a/redhat/build/get_source_files.sh b/redhat/build/get_source_files.sh index b52c023e8..03a3598a0 100755 --- a/redhat/build/get_source_files.sh +++ b/redhat/build/get_source_files.sh @@ -11,10 +11,13 @@ SPECDIR="${SPECFILE%/*}" while read var val; do case "${var}" in + Version:*) VERSION="${val}";; Source[0-9]*:|Source:|Patch[0-9]*:) - FILE=$(rpm -E "${SPECDIR}/${val##*/}") + FILE=$(rpm --define "tde_pkg ${PKGNAME}" --define "tde_version ${TDE_VERSION}" --define "name ${PKGNAME}" --define "version ${VERSION}" -E "${SPECDIR}/${val##*/}") if [ -r "${FILE}" ]; then echo "${FILE}" + else + echo "Warning: cannot find '${FILE}'" >&2 fi ;; esac diff --git a/redhat/build/get_specfile.sh b/redhat/build/get_specfile.sh index 70ff8d144..54094064b 100755 --- a/redhat/build/get_specfile.sh +++ b/redhat/build/get_specfile.sh @@ -6,7 +6,7 @@ TDE_VERSION="${2:-14.0.0}" [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1 [ -d "${TDE_PACKAGING_DIR}" ] || TDE_PACKAGING_DIR=~/tde/tde-packaging -[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${PACKAGING_DIR}/redhat +[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/redhat # Special case for QT3 if [ "${PKGNAME}" = "qt3" ]; then |