RPM: update build scripts

pull/3/head
François Andriot 7 years ago
parent 15e02021e2
commit ce947350eb

@ -324,7 +324,7 @@ endif
kipi-plugins: tqtinterface tdelibs tdepim libkdcraw libkexiv2 libkipi kipi-plugins: tqtinterface tdelibs tdepim libkdcraw libkexiv2 libkipi
$(call buildpkg,libraries/kipi-plugins) $(call buildpkg,libraries/kipi-plugins)
libkdcraw: tqtinterface libkdcraw: tqtinterface lcms
$(call buildpkg,libraries/libkdcraw) $(call buildpkg,libraries/libkdcraw)
libkexiv2: tqtinterface libkexiv2: tqtinterface

@ -9,8 +9,6 @@ PKGNAME="${PKGNAME##*/}"
TDE_VERSION="${2:-14.0.0}" TDE_VERSION="${2:-14.0.0}"
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION}) 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} || :) VERSION=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION} || :)
case "${VERSION}" in *~pre*) PREVERSION="${VERSION#*~}";; esac case "${VERSION}" in *~pre*) PREVERSION="${VERSION#*~}";; esac
@ -20,18 +18,8 @@ BUILDDIR="${TMPPATH}/BUILD${DIST}.$(uname -i)"
BUILDROOTDIR="${TMPPATH}/BUILDROOT${DIST}.$(uname -i)" BUILDROOTDIR="${TMPPATH}/BUILDROOT${DIST}.$(uname -i)"
LOGFILE="${TMPPATH}/log.${COMP##*/}" LOGFILE="${TMPPATH}/log.${COMP##*/}"
TEMPDIR="$(mktemp -d)" export TEMPDIR="$(mktemp -d)"
cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TEMPDIR}" gather_rpm_sources.sh "${PKGNAME}" "${TDE_VERSION}" "${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
[ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}" [ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}"

@ -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

@ -10,9 +10,8 @@ RPM=$(get_latest_built_package_filename.sh "${PKGNAME}" ${TDE_VERSION})
[ ! -r "${RPM}" ] && echo "No package found for '${PKGNAME}' !" && exit 2 [ ! -r "${RPM}" ] && echo "No package found for '${PKGNAME}' !" && exit 2
VERSION=$(rpm -qp --qf "%{version}-%{release}" "${RPM}") VERSION=$(rpm -qp --qf "%{version}-%{release}" "${RPM}")
VERSION=${VERSION%.opt} VERSION=${VERSION%.opt} # Remove '.opt' suffix
VERSION=${VERSION%.[a-z]*} VERSION=${VERSION%.[a-z]*} # Remove distro suffix (e.g. '.el6')
VERSION=${VERSION/-*_0/\~} VERSION=${VERSION/-*_0_/\~}
echo $VERSION echo $VERSION

@ -50,6 +50,7 @@ case "${PKGNAME}" in
"imlib1") PKGRUNTIME="${lib}Imlib1";; "imlib1") PKGRUNTIME="${lib}Imlib1";;
"knetworkmanager8") PKGRUNTIME="knetworkmanager";; "knetworkmanager8") PKGRUNTIME="knetworkmanager";;
"koffice") PKGRUNTIME="koffice-suite";; "koffice") PKGRUNTIME="koffice-suite";;
"lcms") PKGRUNTIME="${lib}lcms1";;
"libart-lgpl") PKGRUNTIME="${lib}art_lgpl_2-2";; "libart-lgpl") PKGRUNTIME="${lib}art_lgpl_2-2";;
"libcaldav") PKGRUNTIME="${lib}caldav0";; "libcaldav") PKGRUNTIME="${lib}caldav0";;
"libcarddav") PKGRUNTIME="${lib}carddav0";; "libcarddav") PKGRUNTIME="${lib}carddav0";;
@ -97,6 +98,7 @@ if [ -n "${DEVEL}" ]; then
"esound") PKGDEVEL="esound-devel";; "esound") PKGDEVEL="esound-devel";;
"imlib1") PKGDEVEL="${lib}Imlib-devel";; "imlib1") PKGDEVEL="${lib}Imlib-devel";;
"koffice") PKGDEVEL="koffice-devel";; "koffice") PKGDEVEL="koffice-devel";;
"lcms") PKGDEVEL="liblcms-devel";;
"libart-lgpl") PKGDEVEL="libart_lgpl-devel";; "libart-lgpl") PKGDEVEL="libart_lgpl-devel";;
"libcaldav") PKGDEVEL="${lib}caldav-devel";; "libcaldav") PKGDEVEL="${lib}caldav-devel";;
"libcarddav") PKGDEVEL="${lib}carddav-devel";; "libcarddav") PKGDEVEL="${lib}carddav-devel";;

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
PKGNAME="${1##*/}" 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 [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION}) SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
@ -14,12 +15,22 @@ while read var val; do
case "${var}" in case "${var}" in
Version:*) VERSION="${val}";; Version:*) VERSION="${val}";;
Source[0-9]*:|Source:|Patch[0-9]*:) 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##*/}") FILE="${SPECDIR}/${val##*/}"
if [ -r "${FILE}" ]; then if [ "${DIST}" = "any" ] && [ "${var//%\{?dist\}/}" = "${var}" ]; then
echo "${FILE}" FILES="${FILE//%\{?dist\}/.}"*
else else
echo "Warning: cannot find '${FILE}'" >&2 FILES="${FILE}"
fi 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 esac
done < "${SPECFILE}" done < "${SPECFILE}"

@ -7,7 +7,7 @@ DIST=""
if [ -r /etc/redhat-release ]; then if [ -r /etc/redhat-release ]; then
read a b c d e f g < /etc/redhat-release 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" a="opensuse"
fi fi
@ -43,6 +43,8 @@ case $a in
DIST=".oss$((read l; read a b c; echo ${c//./}) </etc/SuSE-release)" DIST=".oss$((read l; read a b c; echo ${c//./}) </etc/SuSE-release)"
elif [ -r "/etc/SUSE-brand" ]; then elif [ -r "/etc/SUSE-brand" ]; then
DIST=".oss$((read a; read a b c; echo ${c//./}) </etc/SUSE-brand)" DIST=".oss$((read a; read a b c; echo ${c//./}) </etc/SUSE-brand)"
elif grep -q "tumbleweed" "/etc/os-release"; then
DIST=".osstw"
else else
DIST=".oss" DIST=".oss"
fi fi

Loading…
Cancel
Save