diff options
Diffstat (limited to 'redhat/build')
-rwxr-xr-x | redhat/build/build_rpm_package.sh | 7 | ||||
-rwxr-xr-x | redhat/build/configure_repository.sh | 2 | ||||
-rwxr-xr-x | redhat/build/gather_rpm_sources.sh | 3 | ||||
-rwxr-xr-x | redhat/build/get_source_files.sh | 2 | ||||
-rwxr-xr-x | redhat/build/install_requires.sh | 3 | ||||
-rwxr-xr-x | redhat/build/is_latest_package_installed.sh | 3 | ||||
-rwxr-xr-x | redhat/build/rpmdist.sh | 21 | ||||
-rwxr-xr-x | redhat/build/update_repository.sh | 20 |
8 files changed, 42 insertions, 19 deletions
diff --git a/redhat/build/build_rpm_package.sh b/redhat/build/build_rpm_package.sh index c8ee6208a..895f791e5 100755 --- a/redhat/build/build_rpm_package.sh +++ b/redhat/build/build_rpm_package.sh @@ -25,6 +25,11 @@ LOGFILE="${TMPPATH}/log.${PKGNAME##*/}" export TEMPDIR="$(mktemp -d)" gather_rpm_sources.sh "${PKGNAME}" "${TDE_VERSION}" "${TEMPDIR}" +specfile="${TEMPDIR}/${SPECFILE##*/}" + +if [ "${DIST}" = ".omv2490" ]; then + sed -i "${specfile}" -e "s|^%patch|%patch |" +fi [ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}" @@ -47,7 +52,7 @@ rpmbuild -ba \ --define "prevers${PREVERSION:+ion} ${PREVERSION:-0}" \ --define "tde_patch 1" \ --define "with_mpeg 1" \ - "${TEMPDIR}/${SPECFILE##*/}" + "${specfile}" RET=$? # Removes BUILDDIR if build succeeded diff --git a/redhat/build/configure_repository.sh b/redhat/build/configure_repository.sh index 212609363..a2e6698ad 100755 --- a/redhat/build/configure_repository.sh +++ b/redhat/build/configure_repository.sh @@ -8,7 +8,7 @@ RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION}) [ -d "${RPMDIR}/${ARCH}" ] || mkdir -p "${RPMDIR}/${ARCH}" # RHEL / CentOS / Fedora -if [ -x /usr/bin/yum ]; then +if [ -x "/usr/bin/dnf" ] || [ -x "/usr/bin/yum" ]; then cat <<EOF >/tmp/rpmbuild-tde.repo [rpmbuild.${ARCH}] name=rpmbuild.${ARCH} diff --git a/redhat/build/gather_rpm_sources.sh b/redhat/build/gather_rpm_sources.sh index b7bbf1306..d1ecdb3b0 100755 --- a/redhat/build/gather_rpm_sources.sh +++ b/redhat/build/gather_rpm_sources.sh @@ -7,7 +7,7 @@ PKGNAME="${1%/}" PKGNAME="${PKGNAME##*/}" TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}" TARGETDIR="${3:-/tmp/${PKGNAME}-${TDE_VERSION}}" -DIST="$4" +DIST="$(rpmdist.sh --dist)" SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION}) [ -z "${SPECFILE}" ] && exit 1 @@ -17,7 +17,6 @@ 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)" diff --git a/redhat/build/get_source_files.sh b/redhat/build/get_source_files.sh index 5bb0a7e31..3f42de99d 100755 --- a/redhat/build/get_source_files.sh +++ b/redhat/build/get_source_files.sh @@ -31,7 +31,7 @@ while read var val; do --define "tde_version ${TDE_VERSION}" \ --define "name ${name}" \ --define "version ${VERSION}" \ - --define "dist ${DIST:-$(rpm -E %dist)}" \ + --define "dist ${DIST:-$(rpmdist.sh --dist)}" \ -E "${FILE}") [ -r "${file}" ] && break done diff --git a/redhat/build/install_requires.sh b/redhat/build/install_requires.sh index 9c901ac50..5a947539d 100755 --- a/redhat/build/install_requires.sh +++ b/redhat/build/install_requires.sh @@ -1,6 +1,7 @@ #!/bin/bash -PKGFILE="packages$(rpm -E %dist)" +DIST="$(rpmdist.sh --dist)" +PKGFILE="packages${DIST}" # Under Mageia/Mandriva, do not forget to enable "Tainted" and "Nonfree" repositories ! if [ -x /usr/sbin/urpmi ]; then diff --git a/redhat/build/is_latest_package_installed.sh b/redhat/build/is_latest_package_installed.sh index c8b310868..997b1f99d 100755 --- a/redhat/build/is_latest_package_installed.sh +++ b/redhat/build/is_latest_package_installed.sh @@ -6,6 +6,7 @@ TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}" INSTALLED=$(get_installed_package_version.sh ${PKGNAME} ${TDE_VERSION}) TARBALL=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION}) SPEC=$(get_spec_version.sh ${PKGNAME} ${TDE_VERSION}) +DIST="$(rpmdist.sh --dist)" # Package containing "~" (e.g. R14 preversion tarballs): if [ "${TARBALL/\~/}" != "${TARBALL}" ]; then @@ -22,7 +23,7 @@ else fi # Other package (e.g. QT3) - if [ "${INSTALLED}" = "${SPEC}" ] || [ "${INSTALLED}$(rpm -E %dist)" = "${SPEC}" ]; then + if [ "${INSTALLED}" = "${SPEC}" ] || [ "${INSTALLED}${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 7f06af83e..d7be81993 100755 --- a/redhat/build/rpmdist.sh +++ b/redhat/build/rpmdist.sh @@ -5,7 +5,9 @@ RHEL=0 MGA=0 DIST="" -if [ -r /etc/redhat-release ]; then +if [ -r /etc/openmandriva-release ]; then + a="openmandriva" +elif [ -r /etc/redhat-release ]; then read a b c d e f g < /etc/redhat-release elif [ -r /etc/SuSE-release ] || [ -r /etc/SUSE-brand ] || grep -q "opensuse" "/etc/os-release"; then a="opensuse" @@ -14,13 +16,13 @@ fi case $a in # Mageia release 1 (Official) for x86_64 Mageia*) - DIST=".mga${c}" -# MDKVERSION="201002" + DIST=".mga${c}" + #MDKVERSION="201002" ;; # Mandriva Linux release 2011.0 (Official) for x86_64 Mandriva*) - DIST=".mdv${d}" - MDKVERSION="201100" + DIST=".mdv${d}" + MDKVERSION="201100" ;; # CentOS release 5.7 (Final) # CentOS Linux release 6.0 (Final) @@ -49,6 +51,15 @@ case $a in DIST=".oss" fi ;; + # openmandriva + openmandriva) + . /etc/os-release + if [ "${VERSION_ID}" = "5.0" ]; then + DIST=".omv5000" # 5.0 (Rock) + else + DIST=".omv2490" # Cooker + fi + ;; # PCLinuxOS PCLinuxOS) PCLINUXOS="${c}"; DIST=".pclos${c}";; #PCLinuxOS) PCLINUXOS="${c}"; DIST=".pclos";; diff --git a/redhat/build/update_repository.sh b/redhat/build/update_repository.sh index d00ef2b3b..5a8a13eb4 100755 --- a/redhat/build/update_repository.sh +++ b/redhat/build/update_repository.sh @@ -11,23 +11,29 @@ done ARCH="$(rpm -E %{_target_cpu})" RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION}) -dist="$(rpm -E %dist)" +DIST="$(rpmdist.sh --dist)" [ -d "${RPMDIR}/noarch" ] || mkdir -p "${RPMDIR}/noarch" [ -d "${RPMDIR}/${ARCH}" ] || mkdir -p "${RPMDIR}/${ARCH}" +if [ -x "/usr/bin/createrepo_c" ]; then + createrepo="/usr/bin/createrepo_c" +else + createrepo="/usr/bin/createrepo" +fi + 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 --repo="rpmbuild*" clean expire-cache)' + REPOUPDATE='(cd ${RPMDIR}; ${createrepo} --workers=${WORKERS} ${ARCH} & ${createrepo} --workers=${WORKERS} noarch & wait; sudo dnf --repo="rpmbuild*" clean expire-cache)' 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)' - #REPOUPDATE='(rsync -av ${RPMDIR}/ /tmp/rpm${dist}/ && cd /tmp/rpm${dist}; umask 0000; createrepo --workers=${WORKERS} ${ARCH} & createrepo --workers=${WORKERS} noarch & wait; rsync -av /tmp/rpm${dist}/ ${RPMDIR}/; sudo zypper refresh rpmbuild.${ARCH} rpmbuild.noarch)' + REPOUPDATE='(cd ${RPMDIR}; ${createrepo} --workers=${WORKERS} ${ARCH} & ${createrepo} --workers=${WORKERS} noarch & wait; sudo zypper refresh rpmbuild.${ARCH} rpmbuild.noarch)' + #REPOUPDATE='(rsync -av ${RPMDIR}/ /tmp/rpm${DIST}/ && cd /tmp/rpm${DIST}; umask 0000; ${createrepo} --workers=${WORKERS} ${ARCH} & ${createrepo} --workers=${WORKERS} noarch & wait; rsync -av /tmp/rpm${DIST}/ ${RPMDIR}/; sudo zypper refresh rpmbuild.${ARCH} rpmbuild.noarch)' elif [ -x /usr/bin/yum ]; then - if [ "${dist}" = ".el5" ]; then - REPOUPDATE='(cd ${RPMDIR}; createrepo ${ARCH} & createrepo noarch & wait; sudo yum clean metadata --disablerepo="*" --enablerepo="rpmbuild*")' + if [ "${DIST}" = ".el5" ]; then + 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 metadata --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 --topdir=$PWD i586 x86_64 noarch; sudo apt-get update)' |