summaryrefslogtreecommitdiffstats
path: root/redhat/build
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/build')
-rwxr-xr-xredhat/build/build_rpm_package.sh55
-rwxr-xr-xredhat/build/configure_repository.sh21
-rwxr-xr-xredhat/build/gather_rpm_sources.sh42
-rwxr-xr-xredhat/build/get_installed_package_version.sh4
-rwxr-xr-xredhat/build/get_latest_built_package_filename.sh11
-rwxr-xr-xredhat/build/get_latest_built_package_version.sh7
-rwxr-xr-xredhat/build/get_latest_tarball_filename.sh47
-rwxr-xr-xredhat/build/get_rpm_package_name.sh85
-rwxr-xr-xredhat/build/get_source_files.sh23
-rwxr-xr-xredhat/build/get_spec_version.sh3
-rwxr-xr-xredhat/build/get_specfile.sh30
-rwxr-xr-xredhat/build/install_rpm_package.sh2
-rwxr-xr-xredhat/build/is_latest_package_built.sh6
-rwxr-xr-xredhat/build/is_latest_package_installed.sh7
-rwxr-xr-xredhat/build/rpmdist.sh13
-rwxr-xr-xredhat/build/update_repository.sh8
16 files changed, 222 insertions, 142 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\ <[email protected]>" \
--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=$?
diff --git a/redhat/build/configure_repository.sh b/redhat/build/configure_repository.sh
index 18c91eb1a..d280319f0 100755
--- a/redhat/build/configure_repository.sh
+++ b/redhat/build/configure_repository.sh
@@ -4,6 +4,9 @@ TDE_VERSION=${1:-14.0.0}
ARCH=$(rpm -E %_target_cpu)
RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})
+[ -d "${RPMDIR}/noarch" ] || mkdir -p "${RPMDIR}/noarch"
+[ -d "${RPMDIR}/${ARCH}" ] || mkdir -p "${RPMDIR}/${ARCH}"
+
# RHEL / CentOS / Fedora
if [ -x /usr/bin/yum ]; then
cat <<EOF >/tmp/rpmbuild-tde.repo
@@ -23,14 +26,22 @@ EOF
fi
# Mageia / Mandriva
-if [ -x /usr/sbin/urpmi ]; then
+if [ -x "/usr/sbin/urpmi" ]; then
sudo urpmi.removemedia -y "rpmbuild"
- sudo urpmi.addmedia rpmbuild.${ARCH} ${RPMDIR}/${ARCH}
- sudo urpmi.addmedia rpmbuild.noarch ${RPMDIR}/noarch
+ sudo urpmi.addmedia "rpmbuild.${ARCH}" "${RPMDIR}/${ARCH}"
+ sudo urpmi.addmedia "rpmbuild.noarch" "${RPMDIR}/noarch"
fi
# openSUSE
if [ -x /usr/bin/zypper ]; then
- sudo zypper ar -G ${RPMDIR}/${ARCH} rpmbuild.${ARCH}
- sudo zypper ar -G ${RPMDIR}/noarch rpmbuild.noarch
+ sudo rm -f "/etc/zypp/repos.d/rpmbuild"*
+ sudo zypper ar -G "${RPMDIR}/${ARCH}" "rpmbuild.${ARCH}"
+ sudo zypper ar -G "${RPMDIR}/noarch" "rpmbuild.noarch"
+fi
+
+# PCLOS
+if [ -x "/usr/bin/apt-get" ]; then
+ [ ! -L "${RPMDIR}/RPMS.${ARCH}" ] && ln -sf "${ARCH}" "${RPMDIR}/RPMS.${ARCH}"
+ [ ! -L "${RPMDIR}/RPMS.noarch" ] && ln -sf "noarch" "${RPMDIR}/RPMS.noarch"
+ echo "rpm file:${RPMDIR%/*} ${RPMDIR##*/} ${ARCH} noarch" | sudo tee "/etc/apt/sources.list.d/rpmbuild.list"
fi
diff --git a/redhat/build/gather_rpm_sources.sh b/redhat/build/gather_rpm_sources.sh
new file mode 100755
index 000000000..98b67cbdc
--- /dev/null
+++ b/redhat/build/gather_rpm_sources.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# Usage: build_rpm_package.sh <TDE_PACKAGE> [TDE_VERSION]
+# Example: build_rpm_package.sh tdebase 14.0.0
+
+
+PKGNAME="${1%/}"
+PKGNAME="${PKGNAME##*/}"
+TDE_VERSION="${2:-14.0.5}"
+TARGETDIR="${3:-/tmp/${PKGNAME}-${TDE_VERSION}}"
+DIST="$4"
+
+SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
+[ -z "${SPECFILE}" ] && exit 1
+
+SOURCES=$(get_source_files.sh ${PKGNAME} ${TDE_VERSION} ${DIST})
+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)"
+[ -z "${TMPPATH}" ] && TMPPATH="/dev/shm"
+BUILDDIR="${TMPPATH}/BUILD${DIST}.$(uname -i)"
+BUILDROOTDIR="${TMPPATH}/BUILDROOT${DIST}.$(uname -i)"
+LOGFILE="${TMPPATH}/log.${COMP##*/}"
+
+mkdir -p "${TARGETDIR}"
+rm -f "${TARGETDIR}/"*
+
+cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TARGETDIR}"
+
+### Check for patches
+
+PATCHDIR="${SPECFILE%/*}/patches/${TDE_VERSION}"
+if [ -d "${PATCHDIR}" ]; then
+ cat "${PATCHDIR}/"*".patch" >>"${TARGETDIR}/one.patch"
+ sed -i "${TARGETDIR}/"*".spec" \
+ -e "/^Source0:/ s/$/\nPatch389: one.patch/" \
+ -e "/%setup/ s/$/\n%patch389 -p1/"
+fi
+
+exit $RET
diff --git a/redhat/build/get_installed_package_version.sh b/redhat/build/get_installed_package_version.sh
index 5a8e282b8..4df81b12b 100755
--- a/redhat/build/get_installed_package_version.sh
+++ b/redhat/build/get_installed_package_version.sh
@@ -13,8 +13,8 @@ if [ -z "${VERSION}" ] || [[ "${VERSION}" =~ "not installed" ]]; then
VERSION=$(LC_ALL=C rpm -q --qf "%{version}-%{release}" ${PKGNAME})
fi
-VERSION=${VERSION/-*_/\~}
-VERSION=${VERSION%-[0-9]}
+VERSION=${VERSION/-0_/\~}
+#VERSION=${VERSION%-[0-9]}
VERSION=${VERSION%.opt}
VERSION=${VERSION%.[a-z]*}
diff --git a/redhat/build/get_latest_built_package_filename.sh b/redhat/build/get_latest_built_package_filename.sh
index ccbb0acf0..a459ced19 100755
--- a/redhat/build/get_latest_built_package_filename.sh
+++ b/redhat/build/get_latest_built_package_filename.sh
@@ -9,17 +9,12 @@ RPMDIR_ARCH="${RPMDIR}/$(rpm -E %_target_cpu)"
RPMDIR_NOARCH="${RPMDIR}/noarch"
RPMDIRS="${RPMDIR_ARCH} ${RPMDIR_NOARCH}"
-case "${PKGNAME##*/}" in
- "tqt3") PKGNAME="libtqt3-mt";;
- "tqtinterface") PKGNAME="libtqt4";;
- "koffice") PKGNAME="koffice-suite";;
- "tde-i18n") PKGNAME="tde-i18n-French";;
-esac
+RPM_PKGNAME="$(get_rpm_package_name.sh ${PKGNAME})"
-RPM=$(find ${RPMDIRS} -name "trinity-${PKGNAME##*/}-[0-9]*.rpm" | sort -n | tail -n 1)
+RPM=$(find ${RPMDIRS} -name "trinity-${RPM_PKGNAME}-[0-9]*.rpm" | sort -n | tail -n 1)
if [ ! -r "${RPM}" ]; then
- RPM=$(find ${RPMDIRS} -name "${PKGNAME##*/}-[0-9]*.rpm" | sort -n | tail -n 1)
+ RPM=$(find ${RPMDIRS} -name "${RPM_PKGNAME}-[0-9]*.rpm" | sort -n | tail -n 1)
if [ ! -r "${RPM}" ]; then
echo "Error, cannot find any package for '${PKGNAME}' !"
exit 1
diff --git a/redhat/build/get_latest_built_package_version.sh b/redhat/build/get_latest_built_package_version.sh
index a361ff7b7..44d3896b6 100755
--- a/redhat/build/get_latest_built_package_version.sh
+++ b/redhat/build/get_latest_built_package_version.sh
@@ -10,9 +10,8 @@ RPM=$(get_latest_built_package_filename.sh "${PKGNAME}" ${TDE_VERSION})
[ ! -r "${RPM}" ] && echo "No package found for '${PKGNAME}' !" && exit 2
VERSION=$(rpm -qp --qf "%{version}-%{release}" "${RPM}")
-VERSION=${VERSION%.opt}
-VERSION=${VERSION%.[a-z]*}
-VERSION=${VERSION/-*_/\~}
-
+VERSION=${VERSION%.opt} # Remove '.opt' suffix
+VERSION=${VERSION%.[a-z]*} # Remove distro suffix (e.g. '.el6')
+VERSION=${VERSION/-*_0_/\~}
echo $VERSION
diff --git a/redhat/build/get_latest_tarball_filename.sh b/redhat/build/get_latest_tarball_filename.sh
index 3cdeb904d..7901d0915 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}" -follow -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}" -follow -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..2989aebef 100755
--- a/redhat/build/get_rpm_package_name.sh
+++ b/redhat/build/get_rpm_package_name.sh
@@ -20,11 +20,11 @@ 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="";;
# 3rd party dependencies
- "esound"|"fileshareset"|"hk_classes"|"python-qt3") PREFIX="";;
+ "cscope"|"dirmngr"|"esound"|"exempi"|"file"|"fileshareset"|"gmime"|"hk_classes"|"intltool"|"lcms"|"mp4v2"|"python-qt3"|"rdesktop"|"recode"|"rdiff-backup"|"sword"|"tar") PREFIX="";;
# Extra build stuff
- "autoconf"|"automake"|"cmake"|"gnuchess"|"htdig"|"imlib1"|"libconfig"|"libotr3"|"libtool"|"lilypond"|"m4"|"mftrace"|"pan"|"pcsc-perl"|"torsocks"|"wv2") PREFIX="";;
+ "autoconf"|"automake"|"cmake"|"gnuchess"|"htdig"|"imlib1"|"libconfig"|"libotr3"|"libr"|"libtool2"|"lilypond"|"m4"|"mftrace"|"pan"|"pcsc-perl"|"torsocks"|"wv2") PREFIX="";;
# Other
"curl") PREFIX="trinity-lib";;
# Default case: add prefix
@@ -40,23 +40,33 @@ 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";;
- "tqtinterface") PKGRUNTIME="${lib}tqt4";;
+ "avahi-tqt") PKGRUNTIME="${lib}avahi-tqt1";;
+ "dbus-tqt") PKGRUNTIME="${lib}dbus-tqt-1-0";;
+ "dbus-1-tqt") PKGRUNTIME="${lib}dbus-1-tqt0";;
+ "digikam") PKGRUNTIME="digikam-i18n";;
+ "esound") PKGRUNTIME="${lib}esd0";;
+ "imlib1") PKGRUNTIME="${lib}Imlib1";;
+ "knetworkmanager8") PKGRUNTIME="knetworkmanager";;
+ "koffice") PKGRUNTIME="koffice-suite";;
+ "lcms") PKGRUNTIME="${lib}lcms1";;
+ "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";;
+ "libr") PKGRUNTIME="${lib}r";;
+ "mp4v2") PKGRUNTIME="mp4v2";;
+ "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.
@@ -66,36 +76,43 @@ echo "${PREFIX}${PKGRUNTIME}"
if [ -n "${DEVEL}" ]; then
# Check if development package is required.
case "${PKGCATEGORY}" in
- # Applications do NOT have 'devel' package, except K3B.
- "applications") if [ "${PKGNAME}" != "k3b" ]; then exit 0; fi;;
+ # Applications do NOT have 'devel' package, except K3B, Koffice.
+ "applications") if [ "${PKGNAME}" != "k3b" ] && [ "${PKGNAME}" != "koffice" ]; then exit 0; fi;;
# Extras packages do NOT have 'devel' package, except Akode
"extras") if [ "${PKGNAME}" != "akode" ] && [ "${PKGNAME}" != "hk_classes" ]; then exit 0; fi;;
esac
-
+
# Some other packags NOT having development package
case "${PKGNAME}" in
- "hal-info"|"lilypond"|"mftrace"|"pcsc-perl"|"torsocks") exit 0;;
- "tqca-tls"|"tdeadmin"|"tdetoys"|"tde-i18n"*|"tdeaddons"|"tdeartwork"|"libtqt-perl") exit 0;;
+ "autoconf"|"automake"|"cmake"|"cscope"|"gnuchess"|"hal-info"|"lilypond"|"m4"|"mftrace"|"pcsc-perl"|"rdesktop"|"recode"|"rdiff-backup"|"torsocks") exit 0;;
+ "tqca-tls"|"tdeadmin"|"tdetoys"|"tde-i18n"*|"tdeaddons"|"tdeartwork"|"libtqt-perl"|"kipi-plugins") exit 0;;
esac
# 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="libesd-devel";;
+ "imlib1") PKGDEVEL="${lib}Imlib-devel";;
+ "koffice") PKGDEVEL="koffice-devel";;
+ "lcms") PKGDEVEL="liblcms-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";;
+ "libr") PKGDEVEL="${lib}r-devel";;
+ "mp4v2") PKGDEVEL="${lib}mp4v2-devel";;
+ "pan") PKGDEVEL="uulib-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 ${lib}tqt3-mt-sqlite3";;
# 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'
echo "${PREFIX}${PKGDEVEL}"
fi
-
diff --git a/redhat/build/get_source_files.sh b/redhat/build/get_source_files.sh
index b52c023e8..2e30edc9b 100755
--- a/redhat/build/get_source_files.sh
+++ b/redhat/build/get_source_files.sh
@@ -1,21 +1,36 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-14.0.0}"
+TDE_VERSION="${2:-14.0.5}"
+DIST="$3"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
SPECDIR="${SPECFILE%/*}"
+RPMPKGNAME="$(get_rpm_package_name.sh ${PKGNAME})"
[ ! -r "${SPECFILE}" ] && exit 2
while read var val; do
case "${var}" in
+ Version:*) VERSION="${val}";;
Source[0-9]*:|Source:|Patch[0-9]*:)
- FILE=$(rpm -E "${SPECDIR}/${val##*/}")
- if [ -r "${FILE}" ]; then
- echo "${FILE}"
+ FILE="${SPECDIR}/${val##*/}"
+ if [ "${DIST}" = "any" ] && [ "${var//%\{?dist\}/}" = "${var}" ]; then
+ FILES="${FILE//%\{?dist\}/.}"*
+ else
+ FILES="${FILE}"
fi
+
+ for FILE in $FILES; do
+ file=$(rpm --define "tde_pkg ${PKGNAME}" \
+ --define "tde_version ${TDE_VERSION}" \
+ --define "name ${RPMPKGNAME}" \
+ --define "version ${VERSION}" \
+ --define "dist ${DIST:-$(rpm -E %dist)}" \
+ -E "${FILE}")
+ [ -r "${file}" ] && echo "${file}"
+ done
;;
esac
done < "${SPECFILE}"
diff --git a/redhat/build/get_spec_version.sh b/redhat/build/get_spec_version.sh
index 82c61dcd8..fc3b1e085 100755
--- a/redhat/build/get_spec_version.sh
+++ b/redhat/build/get_spec_version.sh
@@ -12,7 +12,8 @@ SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
VERSION=$(sed -n "/^Version:/ s/Version:[ ]*//p" ${SPECFILE})
RELEASE=$(sed -n "/^Release:/ s/Release:[ ]*//p" ${SPECFILE})
VERSION=$(rpm -E "${VERSION}")
-RELEASE=$(rpm -E "${RELEASE}")
+VERSION=$(rpm --define "tde_version ${TDE_VERSION}" -E "${VERSION}")
+RELEASE=$(rpm --define "tde_version ${TDE_VERSION}" -E "${RELEASE}")
RELEASE=${RELEASE%$(rpmdist.sh --dist)}
echo ${VERSION}-${RELEASE}
diff --git a/redhat/build/get_specfile.sh b/redhat/build/get_specfile.sh
index 70ff8d144..b7336ffcc 100755
--- a/redhat/build/get_specfile.sh
+++ b/redhat/build/get_specfile.sh
@@ -6,25 +6,29 @@ 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
case "$(rpmdist.sh --dist)" in
- .oss*) DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/opensuse ;;
- .mga*|.mdk*|.pclos*) DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/mageia ;;
+ .oss*) DIST_PACKAGING_DIR="${TDE_PACKAGING_DIR}/opensuse" ;;
+ .mga*|.mdk*|.pclos*) DIST_PACKAGING_DIR="${TDE_PACKAGING_DIR}/mageia" ;;
esac
fi
-SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-${TDE_VERSION}.spec")
-if [ ! -r "${SPECFILE}" ]; then
- SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}.spec")
- if [ ! -r "${SPECFILE}" ]; then
- SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}.spec")
- if [ ! -r "${SPECFILE}" ]; then
- SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "trinity-${PKGNAME}.spec")
- fi
+for filename in \
+ "${PKGNAME}-${TDE_VERSION}.spec" \
+ "${PKGNAME}-14.0.0.spec" \
+ "${PKGNAME}.spec" \
+ "trinity-${PKGNAME}-${TDE_VERSION}.spec" \
+ "trinity-${PKGNAME}-14.0.0.spec" \
+ "trinity-${PKGNAME}.spec" \
+; do
+ SPECFILE="$(find "${DIST_PACKAGING_DIR}" -follow -name "${filename}")"
+ if [ -r "${SPECFILE}" ]; then
+ echo "${SPECFILE}"
+ exit 0
fi
-fi
+done
-echo ${SPECFILE}
+exit 1
diff --git a/redhat/build/install_rpm_package.sh b/redhat/build/install_rpm_package.sh
index 93e2b5036..5deece1bd 100755
--- a/redhat/build/install_rpm_package.sh
+++ b/redhat/build/install_rpm_package.sh
@@ -10,6 +10,8 @@ PKGNAME="${1}"
if [ -x /usr/sbin/urpmi ]; then
PKGINST='sudo urpmi --auto --no-verify-rpm'
+elif [ -x /usr/bin/dnf ]; then
+ PKGINST="sudo dnf install -y --refresh --nogpgcheck"
elif [ -x /usr/bin/zypper ]; then
PKGINST="sudo zypper install -y"
elif [ -x /usr/bin/yum ]; then
diff --git a/redhat/build/is_latest_package_built.sh b/redhat/build/is_latest_package_built.sh
index 5f9a442a7..2054957e4 100755
--- a/redhat/build/is_latest_package_built.sh
+++ b/redhat/build/is_latest_package_built.sh
@@ -10,13 +10,13 @@ RPM_PKGNAME="$(get_rpm_package_name.sh ${PKGNAME})"
# If package version contains a "~": it's a pre-release
if [ "${BUILT/\~/}" != "${BUILT}" ]; then
if [ "${BUILT#*\~}" = "${TARBALL#*\~}" ]; then
- echo "Latest package '${PKGNAME}' version '${BUILT}' is already built."
+ echo "Latest development package '${PKGNAME}' version '${BUILT}' is already built."
exit 0
fi
# Nominal case: no "~" caracter
else
- if [ "${TARBALL%-*}" = "${BUILT%-*}" ]; then
- echo "Latest package '${PKGNAME}' version '${BUILT}' is already built."
+ if [ "${TARBALL%-*}" = "${BUILT%-*}" ] || [[ "${BUILT}" =~ [0-9\.]*-${TARBALL}_[0-9]* ]]; then
+ echo "Latest stable package '${PKGNAME}' version '${BUILT}' is already built."
exit 0
fi
fi
diff --git a/redhat/build/is_latest_package_installed.sh b/redhat/build/is_latest_package_installed.sh
index 685fa7a05..7923eca50 100755
--- a/redhat/build/is_latest_package_installed.sh
+++ b/redhat/build/is_latest_package_installed.sh
@@ -8,8 +8,9 @@ TARBALL=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION})
SPEC=$(get_spec_version.sh ${PKGNAME} ${TDE_VERSION})
# Package containing "~" (e.g. R14 preversion tarballs):
-if [ "${INSTALLED/\~/}" != "${INSTALLED}" ]; then
- if [ "${INSTALLED#*\~}" = "${TARBALL#*\~}" ]; then
+if [ "${TARBALL/\~/}" != "${TARBALL}" ]; then
+ # Only compare the part after '~'
+ if [ "${INSTALLED##*_}" = "${TARBALL#*\~}" ] ||[ "${INSTALLED#*\~}" = "${TARBALL#*\~}" ]; then
echo "Latest package '${PKGNAME}' version '${TARBALL}' is already built and installed."
exit 0
fi
@@ -21,7 +22,7 @@ else
fi
# Other package (e.g. QT3)
- if [ "${INSTALLED}" = "${SPEC}" ]; then
+ if [ "${INSTALLED}" = "${SPEC}" ] || [ "${INSTALLED}$(rpm -E %dist)" = "${SPEC}" ]; then
echo "Latest package '${PKGNAME}' version '${INSTALLED}' is already built and installed."
exit 0
fi
diff --git a/redhat/build/rpmdist.sh b/redhat/build/rpmdist.sh
index 72ccbf453..f890bfb2e 100755
--- a/redhat/build/rpmdist.sh
+++ b/redhat/build/rpmdist.sh
@@ -7,7 +7,7 @@ DIST=""
if [ -r /etc/redhat-release ]; then
read a b c d e f g < /etc/redhat-release
-elif [ -r /etc/SuSE-release ]; then
+elif [ -r /etc/SuSE-release ] || [ -r /etc/SUSE-brand ] || grep -q "opensuse" "/etc/os-release"; then
a="opensuse"
fi
@@ -39,10 +39,19 @@ case $a in
Fedora*) FEDORA="${c}"; DIST=".fc${FEDORA}";;
# Opensuse
opensuse)
- DIST=".oss$((read l; read a b c; echo ${c//./}) </etc/SuSE-release)"
+ if [ -r "/etc/SuSE-release" ]; then
+ DIST=".oss$((read l; read a b c; echo ${c//./}) </etc/SuSE-release)"
+ elif [ -r "/etc/SUSE-brand" ]; then
+ DIST=".oss$((read a; read a b c; echo ${c//./}) </etc/SUSE-brand)"
+ elif grep -q "tumbleweed" "/etc/os-release"; then
+ DIST=".osstw"
+ else
+ DIST=".oss"
+ fi
;;
# PCLinuxOS
PCLinuxOS) PCLINUXOS="${c}"; DIST=".pclos${c}";;
+ #PCLinuxOS) PCLINUXOS="${c}"; DIST=".pclos";;
*) echo "distrib non reconnue !! $a";;
esac
diff --git a/redhat/build/update_repository.sh b/redhat/build/update_repository.sh
index 51b6dc7c6..fc1073bfa 100755
--- a/redhat/build/update_repository.sh
+++ b/redhat/build/update_repository.sh
@@ -17,16 +17,18 @@ RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})
if [ -x /usr/sbin/urpmi ]; then
REPOUPDATE='(cd ${RPMDIR}; genhdlist2 --clean --allow-empty noarch & genhdlist2 --clean --allow-empty ${ARCH} & wait; sudo urpmi.update rpmbuild.${ARCH} rpmbuild.noarch)'
+elif [ -x /usr/bin/dnf ]; then
+ REPOUPDATE='(cd ${RPMDIR}; createrepo --workers=${WORKERS} ${ARCH} & createrepo --workers=${WORKERS} noarch & wait; sudo dnf clean expire-cache --disablerepo="*" --enablerepo="rpmbuild*")'
elif [ -x /usr/bin/zypper ]; then
REPOUPDATE='(cd ${RPMDIR}; createrepo --workers=${WORKERS} ${ARCH} & createrepo --workers=${WORKERS} noarch & wait; sudo zypper refresh rpmbuild.${ARCH} rpmbuild.noarch)'
elif [ -x /usr/bin/yum ]; then
if [ "$(rpm -E %dist)" = ".el5" ]; then
- REPOUPDATE='(cd ${RPMDIR}; createrepo ${ARCH} & createrepo noarch & wait; sudo yum clean all --disablerepo="*" --enablerepo="rpmbuild*")'
+ REPOUPDATE='(cd ${RPMDIR}; createrepo ${ARCH} & createrepo noarch & wait; sudo yum clean metadata --disablerepo="*" --enablerepo="rpmbuild*")'
else
- REPOUPDATE='(cd ${RPMDIR}; createrepo --workers=${WORKERS} ${ARCH} & createrepo --workers=${WORKERS} noarch & wait; sudo yum clean all --disablerepo="*" --enablerepo="rpmbuild*")'
+ REPOUPDATE='(cd ${RPMDIR}; createrepo --workers=${WORKERS} ${ARCH} & createrepo --workers=${WORKERS} noarch & wait; sudo yum clean metadata --disablerepo="*" --enablerepo="rpmbuild*")'
fi
elif [ -x /usr/bin/apt-get ]; then
- REPOUPDATE='(cd ${RPMDIR}; genpkglist $PWD noarch & genpkglist $PWD ${ARCH} & wait; genbasedir $PWD ${ARCH} noarch; sudo apt-get update)'
+ REPOUPDATE='(cd ${RPMDIR}; genpkglist $PWD noarch & genpkglist $PWD ${ARCH} & wait; genbasedir $PWD i586 x86_64 noarch; sudo apt-get update)'
fi
eval "${REPOUPDATE}; rm -f ${LOCKFILE}" || exit 1