summaryrefslogtreecommitdiffstats
path: root/redhat
diff options
context:
space:
mode:
authorFran├žois Andriot <albator78@libertysurf.fr>2018-06-02 14:24:39 +0200
committerFran├žois Andriot <albator78@libertysurf.fr>2018-06-19 20:11:02 +0200
commitce947350eb2ae4260a6476e302fb73ad244fe955 (patch)
treed4e90d6cc68b11d45d8c45d56134f0f0d7906d80 /redhat
parent15e02021e25b2c9a00d7eabaf6b2ffe5238c78b3 (diff)
downloadtde-packaging-ce947350eb2ae4260a6476e302fb73ad244fe955.tar.gz
tde-packaging-ce947350eb2ae4260a6476e302fb73ad244fe955.zip
RPM: update build scripts
Diffstat (limited to 'redhat')
-rw-r--r--redhat/Makefile.r142
-rwxr-xr-xredhat/build/build_rpm_package.sh16
-rwxr-xr-xredhat/build/gather_rpm_sources.sh39
-rwxr-xr-xredhat/build/get_latest_built_package_version.sh7
-rwxr-xr-xredhat/build/get_rpm_package_name.sh2
-rwxr-xr-xredhat/build/get_source_files.sh21
-rwxr-xr-xredhat/build/rpmdist.sh4
7 files changed, 66 insertions, 25 deletions
diff --git a/redhat/Makefile.r14 b/redhat/Makefile.r14
index 8460aaa55..81225cdae 100644
--- a/redhat/Makefile.r14
+++ b/redhat/Makefile.r14
@@ -324,7 +324,7 @@ endif
kipi-plugins: tqtinterface tdelibs tdepim libkdcraw libkexiv2 libkipi
$(call buildpkg,libraries/kipi-plugins)
-libkdcraw: tqtinterface
+libkdcraw: tqtinterface lcms
$(call buildpkg,libraries/libkdcraw)
libkexiv2: tqtinterface
diff --git a/redhat/build/build_rpm_package.sh b/redhat/build/build_rpm_package.sh
index 1588ff833..b61478d84 100755
--- a/redhat/build/build_rpm_package.sh
+++ b/redhat/build/build_rpm_package.sh
@@ -9,8 +9,6 @@ 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
@@ -20,18 +18,8 @@ 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 for patches
-
-PATCHDIR="${SPECFILE%/*}/patches/${TDE_VERSION}"
-if [ -d "${PATCHDIR}" ]; then
- cat "${PATCHDIR}/"*".patch" >>"${TEMPDIR}/one.patch"
- sed -i "${TEMPDIR}/"*".spec" \
- -e "/^Source0:/ s/$/\nPatch389: one.patch/" \
- -e "/%setup/ s/$/\n%patch389 -p1/"
-fi
+export TEMPDIR="$(mktemp -d)"
+gather_rpm_sources.sh "${PKGNAME}" "${TDE_VERSION}" "${TEMPDIR}"
[ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}"
diff --git a/redhat/build/gather_rpm_sources.sh b/redhat/build/gather_rpm_sources.sh
new file mode 100755
index 000000000..fb9499e4f
--- /dev/null
+++ b/redhat/build/gather_rpm_sources.sh
@@ -0,0 +1,39 @@
+#!/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.4}"
+TARGETDIR="${3:-/tmp/${PKGNAME}-${TDE_VERSION}}"
+DIST="$4"
+
+SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
+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}"
+
+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_latest_built_package_version.sh b/redhat/build/get_latest_built_package_version.sh
index ec7e63a8c..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/-*_0/\~}
-
+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_rpm_package_name.sh b/redhat/build/get_rpm_package_name.sh
index 222e0a2ea..5b7ee0b3b 100755
--- a/redhat/build/get_rpm_package_name.sh
+++ b/redhat/build/get_rpm_package_name.sh
@@ -50,6 +50,7 @@ case "${PKGNAME}" in
"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";;
@@ -97,6 +98,7 @@ if [ -n "${DEVEL}" ]; then
"esound") PKGDEVEL="esound-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";;
diff --git a/redhat/build/get_source_files.sh b/redhat/build/get_source_files.sh
index bec678217..668a5774c 100755
--- a/redhat/build/get_source_files.sh
+++ b/redhat/build/get_source_files.sh
@@ -1,7 +1,8 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-14.0.0}"
+TDE_VERSION="${2:-14.0.4}"
+DIST="$3"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
@@ -14,12 +15,22 @@ while read var val; do
case "${var}" in
Version:*) VERSION="${val}";;
Source[0-9]*:|Source:|Patch[0-9]*:)
- FILE=$(rpm --define "tde_pkg ${PKGNAME}" --define "tde_version ${TDE_VERSION}" --define "name ${RPMPKGNAME}" --define "version ${VERSION}" -E "${SPECDIR}/${val##*/}")
- if [ -r "${FILE}" ]; then
- echo "${FILE}"
+ FILE="${SPECDIR}/${val##*/}"
+ if [ "${DIST}" = "any" ] && [ "${var//%\{?dist\}/}" = "${var}" ]; then
+ FILES="${FILE//%\{?dist\}/.}"*
else
- echo "Warning: cannot find '${FILE}'" >&2
+ 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/rpmdist.sh b/redhat/build/rpmdist.sh
index 16d1468a4..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 ] || [ -r /etc/SUSE-brand ] || grep -qw "ID=opensuse" "/etc/os-release"; then
+elif [ -r /etc/SuSE-release ] || [ -r /etc/SUSE-brand ] || grep -q "opensuse" "/etc/os-release"; then
a="opensuse"
fi
@@ -43,6 +43,8 @@ case $a in
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