]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
xorg-x11-font-utils: Add xorg-x11-fonts-update-dirs.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 11 Oct 2011 17:25:58 +0000 (19:25 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Tue, 11 Oct 2011 17:25:58 +0000 (19:25 +0200)
Fixes #259

xorg-x11-font-utils/xorg-x11-font-utils.nm
xorg-x11-font-utils/xorg-x11-fonts-update-dirs [new file with mode: 0644]

index df9c317ab6cf23a1446cca8772b5de3d23c9a974..8bf368f33e5057762b84a129cb5ddcb7c0982de0 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = xorg-x11-font-utils
 version    = 7.4
-release    = 2
+release    = 3
 
 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
 groups     = X/Fonts
@@ -66,6 +66,10 @@ build
                                make install DESTDIR=%{BUILDROOT}
                        fi
                done
+
+               # Install xorg-x11-fonts-update-dirs
+               install -m 0744 %{DIR_SOURCE}/xorg-x11-fonts-update-dirs %{BUILDROOT}/usr/bin/
+               sed -i "s:@DATADIR@:/usr/share:" %{BUILDROOT}/usr/bin/xorg-x11-fonts-update-dirs
        end
 end
 
diff --git a/xorg-x11-font-utils/xorg-x11-fonts-update-dirs b/xorg-x11-font-utils/xorg-x11-fonts-update-dirs
new file mode 100644 (file)
index 0000000..536bfe8
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+# This script is used by the xorg-x11-fonts package in the %post stage for
+# some fonts to generate the right encodings.
+
+fontdir=""
+encodingsdir="@DATADIR@/X11/fonts/encodings"
+
+# some fonts need to skip mkfontscale, set to "yes" to skip
+skip_fontscale=""
+# some fonts need to run ttmkfdir, set to "yes" to run
+need_ttmkfdir=""
+
+if [ $# -lt 1 ]; then
+    echo "Need at least one parameter for font dir."
+    exit 1
+fi
+
+while [ $# != 0 ]; do
+    case $1 in
+        --skip-fontscale)
+        skip_fontscale="yes"
+        ;;
+        --need-ttmkfdir)
+        need_ttmkfdir="yes"
+        ;;
+        --encodingsdir)
+        shift
+        encodingsdir="$1"
+        ;;
+        *)
+        fontdir="$1"
+
+        if [ $# != 1 ]; then
+            echo "Too many parameters."
+            exit 1
+        fi
+        ;;
+    esac
+    shift
+done
+
+if [ "$skip_fontscale" != "yes" ]; then
+    mkfontscale $fontdir
+fi
+if [ "$need_ttmkfdir" = "yes" ]; then
+    ttmkfdir $fontdir
+fi
+
+mkfontdir $fontdir
+fc-cache $fontdir
+
+if ! [ -z "$encodingsdir" ]; then
+    [ -d "$encodingsdir" ] || mkdir -p "$encodingsdir"
+    oldpwd=$(pwd)
+    cd "$encodingsdir"
+    mkfontscale -n -e "$encodingsdir" -e "$encodingsdir/large"
+    cd ${oldpwd}
+fi
+
+