diff options
Diffstat (limited to 'redhat/build')
-rwxr-xr-x | redhat/build/build_rpm_package.sh | 2 | ||||
-rwxr-xr-x | redhat/build/configure_repository.sh | 12 | ||||
-rwxr-xr-x | redhat/build/get_installed_package_version.sh | 2 | ||||
-rwxr-xr-x | redhat/build/get_latest_tarball_version.sh | 2 | ||||
-rwxr-xr-x | redhat/build/get_rpm_package_name.sh | 2 | ||||
-rwxr-xr-x | redhat/build/install_requires.sh | 14 | ||||
-rwxr-xr-x | redhat/build/is_latest_package_built.sh | 1 | ||||
-rwxr-xr-x | redhat/build/update_repository.sh | 16 |
8 files changed, 41 insertions, 10 deletions
diff --git a/redhat/build/build_rpm_package.sh b/redhat/build/build_rpm_package.sh index 5d9a7d6cd..d55075ffa 100755 --- a/redhat/build/build_rpm_package.sh +++ b/redhat/build/build_rpm_package.sh @@ -29,6 +29,7 @@ fi [ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}" RPMDIR="$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})" +SRPMDIR="$(rpm -E %{_srcrpmdir}.tde-${TDE_VERSION})" rpmbuild -ba \ --define "_specdir ${TEMPDIR}" \ @@ -36,6 +37,7 @@ rpmbuild -ba \ --define "_builddir ${BUILDDIR}" \ --define "_buildrootdir ${BUILDROOTDIR}" \ --define "_rpmdir ${RPMDIR}" \ + --define "_srcrpmdir ${SRPMDIR}" \ --define "tde_version ${TDE_VERSION}" \ --define "tde_prefix /opt/trinity" \ --define "preversion ${PREVERSION}" \ diff --git a/redhat/build/configure_repository.sh b/redhat/build/configure_repository.sh index 2456b1a6a..22ddaf4f7 100755 --- a/redhat/build/configure_repository.sh +++ b/redhat/build/configure_repository.sh @@ -1,9 +1,10 @@ -#!/bin/bash +#!/bin/bash -x TDE_VERSION=${1:-14.0.0} -ARCH=$(uname -i) +ARCH=$(rpm -E %_target_cpu) RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION}) +# RHEL / CentOS / Fedora if [ -x /usr/bin/yum ]; then cat <<EOF >/tmp/rpmbuild-tde.repo [rpmbuild.${ARCH}] @@ -20,3 +21,10 @@ gpgcheck=0 EOF sudo mv -f /tmp/rpmbuild-tde.repo /etc/yum.repos.d/ fi + +# Mageia / Mandriva +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 +fi diff --git a/redhat/build/get_installed_package_version.sh b/redhat/build/get_installed_package_version.sh index 62dbb1ff0..c7c5540cb 100755 --- a/redhat/build/get_installed_package_version.sh +++ b/redhat/build/get_installed_package_version.sh @@ -7,7 +7,7 @@ PKGNAME="${1##*/}" # Language package: install only French language package case ${PKGNAME} in - "k3b-i18n"|"koffice-i18n"|"tde-i18n") PKGNAME="${PKGNAME}-French";; + "k3b-i18n"|"koffice-i18n"|"tde-i18n") PKGNAME="trinity-${PKGNAME}-French";; "koffice") PKGNAME="${PKGNAME}-suite";; "trinity-"*) PKGNAME="${PKGNAME#trinity-}";; "qt3") [ -r /etc/mandriva-release ] && PKGNAME="qt3-common";; diff --git a/redhat/build/get_latest_tarball_version.sh b/redhat/build/get_latest_tarball_version.sh index b12d63cdd..6c41f0afa 100755 --- a/redhat/build/get_latest_tarball_version.sh +++ b/redhat/build/get_latest_tarball_version.sh @@ -7,7 +7,7 @@ TDE_VERSION="${2:-14.0.0}" TARBALL=$(get_latest_tarball_filename.sh "${PKGNAME}" ${TDE_VERSION}) -[ ! -r "${TARBALL}" ] && echo "No tarball found for '${PKGNAME}' !" && exit 2 +[ ! -r "${TARBALL}" ] && exit 2 VERSION=${TARBALL##*/} VERSION=${VERSION#trinity-} diff --git a/redhat/build/get_rpm_package_name.sh b/redhat/build/get_rpm_package_name.sh index 14a32f2d7..712732911 100755 --- a/redhat/build/get_rpm_package_name.sh +++ b/redhat/build/get_rpm_package_name.sh @@ -31,7 +31,7 @@ echo "${PREFIX}${PKGNAME}" if [ -n "${DEVEL}" ]; then # Check if development package is required. - # Applications do NOT have development packages + # Applications do NOT have development packages, except K3B case "${PKGCATEGORY}" in "applications") if [ "${PKGNAME}" != "k3b" ]; then exit 0; fi;; esac diff --git a/redhat/build/install_requires.sh b/redhat/build/install_requires.sh new file mode 100755 index 000000000..9c901ac50 --- /dev/null +++ b/redhat/build/install_requires.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +PKGFILE="packages$(rpm -E %dist)" + +# Under Mageia/Mandriva, do not forget to enable "Tainted" and "Nonfree" repositories ! +if [ -x /usr/sbin/urpmi ]; then + if [ "$(uname -i)" = "x86_64" ]; then + PKGS="$(<${PKGFILE})" + else + PKGS="$(sed -e "s|lib64|lib|" ${PKGFILE} | sort -u)" + fi + + sudo urpmi ${PKGS} 2>&1 +fi diff --git a/redhat/build/is_latest_package_built.sh b/redhat/build/is_latest_package_built.sh index 1950aa9d3..5f9a442a7 100755 --- a/redhat/build/is_latest_package_built.sh +++ b/redhat/build/is_latest_package_built.sh @@ -5,6 +5,7 @@ TDE_VERSION="${2:-14.0.0}" BUILT=$(get_latest_built_package_version.sh ${PKGNAME} ${TDE_VERSION}) TARBALL=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION}) +RPM_PKGNAME="$(get_rpm_package_name.sh ${PKGNAME})" # If package version contains a "~": it's a pre-release if [ "${BUILT/\~/}" != "${BUILT}" ]; then diff --git a/redhat/build/update_repository.sh b/redhat/build/update_repository.sh index c651fc3f5..1f2216152 100755 --- a/redhat/build/update_repository.sh +++ b/redhat/build/update_repository.sh @@ -9,14 +9,20 @@ while [ -e "${LOCKFILE}" ]; do sleep 3 done +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}" + if [ -x /usr/sbin/urpmi ]; then - REPOUPDATE='(cd $(rpm -E %{_rpmdir}.tde-${TDE_VERSION}); genhdlist2 --clean --allow-empty noarch; genhdlist2 --clean --allow-empty $(uname -i); sudo urpmi.update rpmbuild.$(uname -i) rpmbuild.noarch)' + 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/zypper ]; then - REPOUPDATE='(cd $(rpm -E %{_rpmdir}.tde-${TDE_VERSION}); createrepo --workers=${WORKERS} $(uname -i); createrepo --workers=${WORKERS} noarch; sudo zypper refresh rpmbuild.$(uname -i) rpmbuild.noarch)' + 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 - REPOUPDATE='(cd $(rpm -E %{_rpmdir}.tde-${TDE_VERSION}); createrepo $(uname -i); createrepo noarch; sudo yum clean all --disablerepo="*" --enablerepo="rpmbuild*")' + REPOUPDATE='(cd ${RPMDIR}; createrepo ${ARCH} & createrepo noarch & wait; sudo yum clean all --disablerepo="*" --enablerepo="rpmbuild*")' elif [ -x /usr/bin/apt-get ]; then - REPOUPDATE='(cd $(rpm -E %{_rpmdir}.tde-${TDE_VERSION}); genpkglist $PWD noarch; genpkglist $PWD i586; genpkglist $PWD x86_64; genbasedir $PWD i586 x86_64 noarch; sudo apt-get update)' + REPOUPDATE='(cd ${RPMDIR}; genpkglist $PWD noarch & genpkglist $PWD ${ARCH} & wait; genbasedir $PWD ${ARCH} noarch; sudo apt-get update)' fi -eval "${REPOUPDATE}; rm -f ${LOCKFILE}"|| exit 1 +eval "${REPOUPDATE}; rm -f ${LOCKFILE}" || exit 1 |