From c625a292aecd1db4e36a0a9cc4b4efa1901f328e Mon Sep 17 00:00:00 2001 From: Rolf Leggewie Date: Tue, 29 Jan 2008 12:36:08 +0000 Subject: qte-fonts-common: consolidate all qpf fonts in a single directory --- packages/qpf-fonts/qte-fonts-common/.mtn2git_empty | 0 .../qpf-fonts/qte-fonts-common/update-qtfontdir | 74 +++++++ packages/qpf-fonts/qte-fonts-common_3.3.5.bb | 231 +++++++++++++++++++++ 3 files changed, 305 insertions(+) create mode 100644 packages/qpf-fonts/qte-fonts-common/.mtn2git_empty create mode 100755 packages/qpf-fonts/qte-fonts-common/update-qtfontdir create mode 100644 packages/qpf-fonts/qte-fonts-common_3.3.5.bb (limited to 'packages/qpf-fonts') diff --git a/packages/qpf-fonts/qte-fonts-common/.mtn2git_empty b/packages/qpf-fonts/qte-fonts-common/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/qpf-fonts/qte-fonts-common/update-qtfontdir b/packages/qpf-fonts/qte-fonts-common/update-qtfontdir new file mode 100755 index 0000000000..857dc6c0d5 --- /dev/null +++ b/packages/qpf-fonts/qte-fonts-common/update-qtfontdir @@ -0,0 +1,74 @@ +#!/bin/sh + +usage() +{ + echo "usage: $0 [font directory, defaults to \$QTDIR/lib/fonts]" + exit 1 +} + +setVar() +{ + eval "$1='$2'" +} + +getVar() +{ + eval "echo \$$1" +} + +handleQPF() +{ + base=`basename $1` + family=`echo $base|cut -d_ -f1` + pt=`echo $base|cut -d_ -f2` + weight=`echo $base|cut -d_ -f3|sed -e 's,i$,,'` + if (echo $base|cut -d_ -f3|grep -q 'i$'); then + italic="y" + else + italic="n" + fi + echo "$family $base.qpf QPF $italic $weight $pt u" +} + +if [ "$1" = "-f" ]; then + FORCE=1 + shift +else + FORCE=0 +fi + +if [ -z "$1" ]; then + if [ -n "$QTDIR" ]; then + fontdir=$QTDIR/lib/fonts + else + fontdir=/opt/QtPalmtop/lib/fonts + fi +else + fontdir=$1 +fi + +if ! [ -d $fontdir ]; then + echo Error: $fontdir not a directory + exit 1 +fi + +if [ -e $fontdir/fontdir ]; then + if find $fontdir -newer $fontdir/fontdir | grep -q "\(qpf\|ttf\)"; then + #echo "fontdir needs updating..." + : + elif [ "$FORCE" = "0" ]; then + #echo "fontdir already up to date - exiting" + exit 0 + fi + cat $fontdir/fontdir | grep -v '\.qpf' > $fontdir/fontdir.new +fi + +( + for file in `ls $fontdir/*.qpf 2>/dev/null |sed -e's,\.qpf$,,; s,_t[^_]*$,,;'|sort -u`; do + handleQPF $file + done +) >> $fontdir/fontdir.new + +mv $fontdir/fontdir.new $fontdir/fontdir + +exit 0 diff --git a/packages/qpf-fonts/qte-fonts-common_3.3.5.bb b/packages/qpf-fonts/qte-fonts-common_3.3.5.bb new file mode 100644 index 0000000000..02d0663c3e --- /dev/null +++ b/packages/qpf-fonts/qte-fonts-common_3.3.5.bb @@ -0,0 +1,231 @@ +DESCRIPTION= "Tools to update the Qt fontdir" +HOMEPAGE = "http://www.trolltech.com" +SECTION = "opie/base" +LICENSE = "GPL QPL" +RDEPENDS = "font-update-common" +RDEPENDS_qte-font-common = "" +PR = "r4" + +SRC_URI = "ftp://ftp.trolltech.com/pub/qt/source/qt-embedded-free-${PV}.tar.bz2 \ + file://update-qtfontdir" + +S = "${WORKDIR}/qt-embedded-free-${PV}" + +do_compile() { + : +} + +do_install() { + mkdir -p ${D}${sbindir} + install -m 755 ${WORKDIR}/update-qtfontdir ${D}${sbindir} + mkdir -p ${D}${palmtopdir}/lib/fonts + cp -pPR lib/fonts/* ${D}${palmtopdir}/lib/fonts + # Delete all other font formats, Qt/E would have a dead slow + # application start time if it had to use any other font format + # as *.qpf ... + find ${D}${palmtopdir}/lib/fonts \ + -name "*.bdf" \ + -o -name "*.ttf" \ + -o -name "*.pfa" \ + -o -name "*.pfb" | xargs rm +} + +PACKAGES = "qte-fonts-common" +FILES_${PN} = "${sbindir}" + +PACKAGES += "qte-font-fixed" +PROVIDES += "qte-font-fixed" +FILES_qte-font-fixed = "${palmtopdir}/lib/fonts/fixed*" +RDEPENDS_qte-font-fixed = "qte-fonts-common" +pkg_postinst_qte-font-fixed() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir +} +pkg_postrm_qte-font-fixed() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir -f +} + +PACKAGES += "qte-font-helvetica-small" +PROVIDES += "qte-font-helvetica-small" +FILES_qte-font-helvetica-small = "${palmtopdir}/lib/fonts/helvetica_80*.qpf \ + ${palmtopdir}/lib/fonts/helvetica_100*.qpf ${palmtopdir}/lib/fonts/helvetica_120*.qpf" +RDEPENDS_qte-font-helvetica-small = "qte-fonts-common" +pkg_postinst_qte-font-helvetica-small() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir +} +pkg_postrm_qte-font-helvetica-small() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir -f +} + +PACKAGES += "qte-font-helvetica-large" +PROVIDES += "qte-font-helvetica-large" +FILES_qte-font-helvetica-large = "${palmtopdir}/lib/fonts/helvetica_140*.qpf \ + ${palmtopdir}/lib/fonts/helvetica_180*.qpf ${palmtopdir}/lib/fonts/helvetica_240*.qpf" +RDEPENDS_qte-font-helvetica-large = "qte-fonts-common" +pkg_postinst_qte-font-helvetica-large() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir +} +pkg_postrm_qte-font-helvetica-large() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir -f +} + +PACKAGES += "qte-font-smoothtimes" +PROVIDES += "qte-font-smoothtimes" +FILES_qte-font-smoothtimes = "${palmtopdir}/lib/fonts/smoothtimes*" +RDEPENDS_qte-font-smoothtimes = "qte-fonts-common" +pkg_postinst_qte-font-smoothtimes() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir +} +pkg_postrm_qte-font-smoothtimes() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir -f +} + +PACKAGES += "qte-font-smallsmooth" +PROVIDES += "qte-font-smallsmooth" +FILES_qte-font-smallsmooth = "${palmtopdir}/lib/fonts/smallsmooth*" +RDEPENDS_qte-smallsmooth = "qte-fonts-common" +pkg_postinst_qte-font-smallsmooth() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir +} +pkg_postrm_qte-font-smallsmooth() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir -f +} + +PACKAGES += "qte-font-unicode" +PROVIDES += "qte-font-unicode" +FILES_qte-font-unicode = "${palmtopdir}/lib/fonts/unifont*.qpf" +RDEPENDS_qte-font-unicode = "qte-fonts-common" +pkg_postinst_qte-font-unicode() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir +} +pkg_postrm_qte-font-unicode() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir -f +} + +PACKAGES += "qte-font-micro" +PROVIDES += "qte-font-micro" +FILES_qte-font-micro = "${palmtopdir}/lib/fonts/micro*.qpf" +#RDEPENDS_qte-font-micro = "qte-fonts-common" +pkg_postinst_qte-font-micro() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir +} +pkg_postrm_qte-font-micro() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +set -e +. /etc/profile +${sbindir}/update-qtfontdir -f +} + +# Not in the QtE/3 tar file: +#PACKAGES += "qte-font-lcd" +#PROVIDES += "qte-font-lcd" +#RDEPENDS_qte-font-lcd = "qte-fonts-common" +#FILES_qte-font-lcd = "${palmtopdir}/lib/fonts/lcd*" +#pkg_postinst_qte-font-lcd () { +##!/bin/sh +#if [ -n "$D" ]; then exit 1; fi +#set -e +#. /etc/profile +#${sbindir}/update-qtfontdir +#} +#pkg_postrm_qte-font-lcd() { +##!/bin/sh +#if [ -n "$D" ]; then exit 1; fi +#set -e +#. /etc/profile +#${sbindir}/update-qtfontdir -f +#} + +# Not in the QtE/3 tar file: +#PACKAGES += "qte-font-japanese" +#PROVIDES += "qte-font-japanese" +#FILES_qte-font-japanese = "${palmtopdir}/lib/fonts/japanese*" +#RDEPENDS_qte-font-japanese = "qte-fonts-common" +#pkg_postinst_qte-font-japanese() { +##!/bin/sh +#if [ -n "$D" ]; then exit 1; fi +#set -e +#. /etc/profile +#${sbindir}/update-qtfontdir +#} +#pkg_postrm_qte-font-japanese() { +##!/bin/sh +#if [ -n "$D" ]; then exit 1; fi +#set -e +#. /etc/profile +#${sbindir}/update-qtfontdir -f +#} + +# Not in the QtE/3 tar file: +#PACKAGES += "qte-font-courier" +#PROVIDES += "qte-font-courier" +#FILES_qte-font-courier = "${palmtopdir}/lib/fonts/cour*" +#RDEPENDS_qte-font-courier = "qte-fonts-common" +#pkg_postinst_qte-font-courier() { +##!/bin/sh +#if [ -n "$D" ]; then exit 1; fi +#set -e +#. /etc/profile +#${sbindir}/update-qtfontdir +#} +#pkg_postrm_qte-font-courier() { +##!/bin/sh +#if [ -n "$D" ]; then exit 1; fi +#set -e +#. /etc/profile +#${sbindir}/update-qtfontdir -f +#} + +PACKAGE_ARCH = "all" -- cgit v1.2.3