diff options
Diffstat (limited to 'redhat/build')
-rwxr-xr-x | redhat/build/build_rpm_package.sh | 29 | ||||
-rwxr-xr-x | redhat/build/get_rpm_package_name.sh | 59 |
2 files changed, 69 insertions, 19 deletions
diff --git a/redhat/build/build_rpm_package.sh b/redhat/build/build_rpm_package.sh index cd8bb1662..f30a4246b 100755 --- a/redhat/build/build_rpm_package.sh +++ b/redhat/build/build_rpm_package.sh @@ -21,6 +21,29 @@ LOGFILE=/tmp/log.${COMP##*/} TEMPDIR="$(mktemp -d)" cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TEMPDIR}" +# Check if there are patches +PATCHDIR="${SPECFILE%/*}/patches/${TDE_VERSION}" +PATCHLIST="${PATCHDIR}/patches" +if [ -r "${PATCHLIST}" ]; then + while read l; do + case "${l}" in + ""|"#"*);; + *) + if [ -r "${PATCHDIR}/${l}" ]; then + echo "Applying patch '${l}'..." + cat "${PATCHDIR}/${l}" >>"${TEMPDIR}/one.patch" + fi + ;; + esac + done < "${PATCHLIST}" +fi + +if [ -r "${TEMPDIR}/one.patch" ]; then + sed -i "${TEMPDIR}/"*.spec \ + -e "/^Source0:/ s/$/\nPatch0: one.patch/" \ + -e "/%setup/ s/$/\n%patch0 -p1/" +fi + # Determines if we are running an i386 or x86_64 distro if [ "$(rpm -q --qf '%{arch}\n' kernel | tail -n 1)" = "i686" ]; then ARGS="${ARGS} --target=i686" @@ -39,11 +62,13 @@ rpmbuild -ba \ --define "_rpmdir ${RPMDIR}" \ --define "_srcrpmdir ${SRPMDIR}" \ --define '_build_create_debug 1' \ + --define "vendor Trinity\ Desktop" \ + --define "packager Francois\ Andriot\ <[email protected]>" \ --define "tde_version ${TDE_VERSION}" \ --define "tde_prefix /opt/trinity" \ - --define "preversion ${PREVERSION}" \ + --define "preversion ${PREVERSION:-\\\"\\\"}" \ ${ARGS} \ - "${SPECFILE}" + "${TEMPDIR}/${SPECFILE##*/}" RET=$? # Removes BUILDDIR if build succeeded diff --git a/redhat/build/get_rpm_package_name.sh b/redhat/build/get_rpm_package_name.sh index 2d9309738..c6221420d 100755 --- a/redhat/build/get_rpm_package_name.sh +++ b/redhat/build/get_rpm_package_name.sh @@ -14,40 +14,65 @@ PKGNAME="${1##*/}" DEVEL="$2" # Some RPM packages have different name than the source tarball. -# Language package: install only French language package -case "${PKGNAME}" in - "k3b-i18n"|"koffice-i18n"|"tde-i18n") PKGNAME="${PKGNAME}-French";; - "koffice") PKGNAME="${PKGNAME}-suite";; - "tqt3") PKGNAME="libtqt3-mt";; - "tqtinterface") PKGNAME="libtqt4";; - "avahi-tqt") PKGNAME="libavahi-tqt";; - "dbus-tqt") PKGNAME="libdbus-tqt-1";; - "dbus-1-tqt") PKGNAME="libdbus-1-tqt";; -esac -# Use the Trinity Prefix, or not. +# Some runtime packages are prefixed with 'trinity-', some are not. case "${PKGNAME}" in - "trinity-"*|"qt3"|"python-qt3"|"esound"|"lib"*) PREFIX="";; + "trinity-"*|"qt3"|"tqt3"|"tqtinterface"|"python-qt3"|"esound"|"avahi-tqt"|"dbus-tqt"|"dbus-1-tqt"|"libart-lgpl"|"fileshareset") PREFIX="";; "autoconf"|"automake"|"cmake"|"gnuchess"|"htdig"|"imlib1"|"libotr3"|"libtool"|"lilypond"|"m4"|"mftrace"|"pcsc-perl"|"torsocks"|"wv2") PREFIX="";; "curl") PREFIX="trinity-lib";; *) PREFIX="trinity-";; esac -echo "${PREFIX}${PKGNAME}" +# Runtime packages +lib=$(rpm -E %_lib) +case "${PKGNAME}" in + # Some packages have different runtime name than source package. + "avahi-tqt") PKGRUNTIME="${lib}avahi-tqt1";; + "dbus-tqt") PKGRUNTIME="${lib}dbus-tqt-1-0";; + "dbus-1-tqt") PKGRUNTIME="${lib}dbus-1-tqt0";; + "esound") PKGRUNTIME="esound-libs";; + "koffice") PKGRUNTIME="trinity-koffice-suite";; + "libart-lgpl") PKGRUNTIME="${lib}art_lgpl_2-2";; + "tqt3") PKGRUNTIME="${lib}tqt3-mt";; + "tqtinterface") PKGRUNTIME="${lib}tqt4";; + # Language package: install only French language package + "k3b-i18n"|"koffice-i18n"|"tde-i18n") PKGRUNTIME="${PKGNAME}-French";; + # Default case: runtime package has same name as source package + *) PKGRUNTIME="${PKGNAME}";; +esac + +# Finally, display the runtime package name. +echo "${PREFIX}${PKGRUNTIME}" +# Development package. if [ -n "${DEVEL}" ]; then # Check if development package is required. - # Applications do NOT have development packages, except K3B case "${PKGCATEGORY}" in + # Applications do NOT have 'devel' package, except K3B. "applications") if [ "${PKGNAME}" != "k3b" ]; then exit 0; fi;; + # Extras packages do NOT have 'devel' package, except Akode "extras") if [ "${PKGNAME}" != "akode" ]; then exit 0; fi;; esac - # Other packags NOT having development package + + # Some other packags NOT having development package case "${PKGNAME}" in "hal-info"|"lilypond"|"mftrace"|"pcsc-perl"|"torsocks") exit 0;; "tqca-tls"|"tdeadmin"|"tdetoys"|"tde-i18n"*|"tdeaddons"|"tdeartwork"|"libtqt-perl") exit 0;; esac - - echo "${PREFIX}${PKGNAME}-devel" + + # Some package have specific development package. + case "${PKGNAME}" in + "avahi-tqt") PKGDEVEL="libavahi-tqt-devel";; + "dbus-tqt") PKGDEVEL="libdbus-tqt-1-devel";; + "dbus-1-tqt") PKGDEVEL="libdbus-1-tqt-devel";; + "esound") PKGDEVEL="esound-devel";; + "libart-lgpl") PKGDEVEL="libart_lgpl-devel";; + "tqt3") PKGDEVEL="tqt3-dev-tools tqt3-apps-devel";; + # Default case: development package has same name as runtime package, plus '-devel' suffix. + *) PKGDEVEL="${PKGRUNTIME}-devel";; + esac + + # Finally, other packages do have a '-devel' + echo "${PREFIX}${PKGDEVEL}" fi |