summaryrefslogtreecommitdiffstats
path: root/redhat/build
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2024-06-13 08:37:13 +0200
committerFrançois Andriot <albator78@libertysurf.fr>2024-06-13 08:38:31 +0200
commitac47c91c6c011631186592695e4251a3bb97dcca (patch)
treed91e4e98d96b4b2618d9fb3b879c28b67fc63a8f /redhat/build
parent1488354ed514d043f0c15ddbe8b9aa7c0b43f46c (diff)
downloadtde-packaging-ac47c91c6c011631186592695e4251a3bb97dcca.tar.gz
tde-packaging-ac47c91c6c011631186592695e4251a3bb97dcca.zip
RPM: synchronize redhat directory with r14.1.x branch
Signed-off-by: François Andriot <albator78@libertysurf.fr>
Diffstat (limited to 'redhat/build')
-rwxr-xr-xredhat/build/build_rpm_package.sh21
-rwxr-xr-xredhat/build/configure_repository.sh4
-rwxr-xr-xredhat/build/gather_rpm_sources.sh7
-rwxr-xr-xredhat/build/get_installed_package_version.sh2
-rwxr-xr-xredhat/build/get_latest_built_package_filename.sh2
-rwxr-xr-xredhat/build/get_latest_built_package_version.sh2
-rwxr-xr-xredhat/build/get_latest_tarball_filename.sh2
-rwxr-xr-xredhat/build/get_latest_tarball_version.sh4
-rwxr-xr-xredhat/build/get_source_files.sh4
-rwxr-xr-xredhat/build/get_spec_version.sh2
-rwxr-xr-xredhat/build/get_specfile.sh2
-rwxr-xr-xredhat/build/install_requires.sh3
-rwxr-xr-xredhat/build/is_latest_package_built.sh2
-rwxr-xr-xredhat/build/is_latest_package_installed.sh5
-rwxr-xr-xredhat/build/rpmdist.sh21
-rwxr-xr-xredhat/build/update_repository.sh22
16 files changed, 68 insertions, 37 deletions
diff --git a/redhat/build/build_rpm_package.sh b/redhat/build/build_rpm_package.sh
index 3e4699cd6..895f791e5 100755
--- a/redhat/build/build_rpm_package.sh
+++ b/redhat/build/build_rpm_package.sh
@@ -1,26 +1,35 @@
#!/bin/bash -ex
# Usage: build_rpm_package.sh <TDE_PACKAGE> [TDE_VERSION]
-# Example: build_rpm_package.sh tdebase 14.1.0
+# Example: build_rpm_package.sh tdebase 14.1.2
PKGNAME="${1%/}"
PKGNAME="${PKGNAME##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
PATH="$(cd $(dirname $0); pwd):${PATH}"
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
VERSION=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION} || :)
case "${VERSION}" in *~pre*) PREVERSION="${VERSION#*~}";; esac
+ARCH="$(uname -i)"
+if [ "${ARCH}" = "unknown" ]; then
+ ARCH="$(uname -m)"
+fi
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##*/}"
+BUILDDIR="${TMPPATH}/BUILD${DIST}.${ARCH}"
+BUILDROOTDIR="${TMPPATH}/BUILDROOT${DIST}.${ARCH}"
+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}"
@@ -43,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 cc9a33e54..a2e6698ad 100755
--- a/redhat/build/configure_repository.sh
+++ b/redhat/build/configure_repository.sh
@@ -1,6 +1,6 @@
#!/bin/bash -x
-TDE_VERSION="${1:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${1:-${TDE_VERSION:-14.1.2}}"
ARCH=$(rpm -E %_target_cpu)
RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})
@@ -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 df6cadc9d..d1ecdb3b0 100755
--- a/redhat/build/gather_rpm_sources.sh
+++ b/redhat/build/gather_rpm_sources.sh
@@ -1,13 +1,13 @@
#!/bin/bash
# Usage: gather_rpm_sources.sh <TDE_PACKAGE> <TDE_VERSION> <DESTINATION>
-# Example: gather_rpm_sources.sh tdebase 14.1.0 /tmp/tdebase
+# Example: gather_rpm_sources.sh tdebase 14.1.2 /tmp/tdebase
PKGNAME="${1%/}"
PKGNAME="${PKGNAME##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+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_installed_package_version.sh b/redhat/build/get_installed_package_version.sh
index b89f9bb7f..bbb18b0cd 100755
--- a/redhat/build/get_installed_package_version.sh
+++ b/redhat/build/get_installed_package_version.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Sample package name: trinity-tdelibs-14.1.0-0_pre727+6be06b3d.mga3.opt
+# Sample package name: trinity-tdelibs-14.1.2-0_pre727+6be06b3d.mga3.opt
PKGNAME="${1##*/}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
diff --git a/redhat/build/get_latest_built_package_filename.sh b/redhat/build/get_latest_built_package_filename.sh
index 3f7dca3b1..51c46e476 100755
--- a/redhat/build/get_latest_built_package_filename.sh
+++ b/redhat/build/get_latest_built_package_filename.sh
@@ -2,7 +2,7 @@
PKGNAME="$1"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
RPMDIR="$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})"
RPMDIR_ARCH="${RPMDIR}/$(rpm -E %_target_cpu)"
diff --git a/redhat/build/get_latest_built_package_version.sh b/redhat/build/get_latest_built_package_version.sh
index 62954bd01..1f3cebbfe 100755
--- a/redhat/build/get_latest_built_package_version.sh
+++ b/redhat/build/get_latest_built_package_version.sh
@@ -1,7 +1,7 @@
#!/bin/bash
PKGNAME="$1"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
diff --git a/redhat/build/get_latest_tarball_filename.sh b/redhat/build/get_latest_tarball_filename.sh
index e2558d585..66429b0d7 100755
--- a/redhat/build/get_latest_tarball_filename.sh
+++ b/redhat/build/get_latest_tarball_filename.sh
@@ -1,7 +1,7 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
[ -d "${TARBALLS_DIR}" ] || TARBALLS_DIR=~/tde/tarballs/${TDE_VERSION}/
diff --git a/redhat/build/get_latest_tarball_version.sh b/redhat/build/get_latest_tarball_version.sh
index 36090ef86..a2c89cfb8 100755
--- a/redhat/build/get_latest_tarball_version.sh
+++ b/redhat/build/get_latest_tarball_version.sh
@@ -1,7 +1,7 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
@@ -12,7 +12,9 @@ TARBALL=$(get_latest_tarball_filename.sh "${PKGNAME}" ${TDE_VERSION})
VERSION=${TARBALL##*/}
VERSION=${VERSION#trinity-}
VERSION=${VERSION#${PKGNAME}-}
+VERSION=${VERSION#${PKGNAME}_}
VERSION=${VERSION#*-}
VERSION=${VERSION%.tar.gz}
VERSION=${VERSION%.tar.bz2}
+VERSION=${VERSION%.orig}
echo "$VERSION"
diff --git a/redhat/build/get_source_files.sh b/redhat/build/get_source_files.sh
index 529aa49ed..3f42de99d 100755
--- a/redhat/build/get_source_files.sh
+++ b/redhat/build/get_source_files.sh
@@ -1,7 +1,7 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
DIST="$3"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
@@ -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/get_spec_version.sh b/redhat/build/get_spec_version.sh
index 529b11593..a1ba33449 100755
--- a/redhat/build/get_spec_version.sh
+++ b/redhat/build/get_spec_version.sh
@@ -1,7 +1,7 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
diff --git a/redhat/build/get_specfile.sh b/redhat/build/get_specfile.sh
index ce8042e31..e32d7c00f 100755
--- a/redhat/build/get_specfile.sh
+++ b/redhat/build/get_specfile.sh
@@ -1,7 +1,7 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
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_built.sh b/redhat/build/is_latest_package_built.sh
index 336a83cc3..70432b442 100755
--- a/redhat/build/is_latest_package_built.sh
+++ b/redhat/build/is_latest_package_built.sh
@@ -1,7 +1,7 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
BUILT="$(get_latest_built_package_version.sh ${PKGNAME} ${TDE_VERSION})"
TARBALL="$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION})"
diff --git a/redhat/build/is_latest_package_installed.sh b/redhat/build/is_latest_package_installed.sh
index fe2d948b9..997b1f99d 100755
--- a/redhat/build/is_latest_package_installed.sh
+++ b/redhat/build/is_latest_package_installed.sh
@@ -1,11 +1,12 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+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 c00078f1e..5a8a13eb4 100755
--- a/redhat/build/update_repository.sh
+++ b/redhat/build/update_repository.sh
@@ -1,7 +1,7 @@
#!/bin/bash
WORKERS=$(getconf _NPROCESSORS_ONLN)
-TDE_VERSION="${2:-${TDE_VERSION:-14.1.0}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.1.2}}"
LOCKFILE="/tmp/lock.${0##*/}"
while [ -e "${LOCKFILE}" ]; do
@@ -11,24 +11,32 @@ done
ARCH="$(rpm -E %{_target_cpu})"
RPMDIR=$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})
+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='(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 [ "$(rpm -E %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 $PWD i586 x86_64 noarch; sudo apt-get update)'
+ REPOUPDATE='(cd ${RPMDIR}; genpkglist $PWD noarch & genpkglist $PWD ${ARCH} & wait; genbasedir --topdir=$PWD i586 x86_64 noarch; sudo apt-get update)'
fi
eval "${REPOUPDATE}; rm -f ${LOCKFILE}" || exit 1