]> git.pld-linux.org Git - packages/fontpostinst.git/commitdiff
- added mkfontscale->ttmkfdir fallback for X <= 4.2.x
authorJakub Bogusz <qboosh@pld-linux.org>
Thu, 15 May 2003 19:55:13 +0000 (19:55 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- save some files instead of removing (in case they weren't autogenerated)
- created spec (it's separate, not in any XFree86* package - it can
  regenerate ghostscript Fontmaps without any XFree86 part)

Changed files:
    fontpostinst -> 1.2
    fontpostinst.spec -> 1.1

fontpostinst
fontpostinst.spec [new file with mode: 0644]

index 6c40ac3bfdc4d97c4352669b8b2931dc64d1107e..a1cf8e05bbc7198f1d8bf8079cf31417f94ce5d0 100644 (file)
@@ -15,8 +15,11 @@ MKFONTSCALE="$MKFONTSCALEBIN"
 
 MKTTFFONTSCALEBIN="$MKFONTSCALEBIN"
 MKTTFFONTSCALE="$MKTTFFONTSCALEBIN"
-#MKTTFFONTSCALEBIN="/usr/bin/ttmkfdir"
-#MKTTFFONTSCALE="$MKFONTSCALEBIN -e /usr/share/fonts/encodings/encodings.dir"
+if [ ! -x "$MKFONTSCALEBIN" -a -f /usr/bin/ttmkfdir ]; then
+       # fallback for X <= 4.2.x
+       MKTTFFONTSCALEBIN="/usr/bin/ttmkfdir"
+       MKTTFFONTSCALE="$MKFONTSCALEBIN -e /usr/share/fonts/encodings/encodings.dir"
+fi
 
 FCCACHEBIN="/usr/X11R6/bin/fc-cache"
 if [ ! -x $FCCACHEBIN -a -x /usr/X11R6/bin/xftcache ]; then
@@ -50,8 +53,8 @@ umask 022
 cd "$FDIR"
 if [ "`echo fonts.alias.*`" != 'fonts.alias.*' ]; then
        cat fonts.alias.* | LC_ALL=C sort -u > fonts.alias
-else
-       rm -f fonts.alias
+elif [ -f fonts.alias ]; then
+       mv -f fonts.alias fonts.alias-save
 fi
 case "$FTYPE" in
     OTF|TTF)
@@ -79,8 +82,8 @@ case "$FTYPE" in
                if [ -x $MKFONTSCALEBIN ]; then
                        $MKFONTSCALE
                fi
-       else
-               rm -f fonts.scale
+       elif [ -f fonts.scale ]; then
+               mv -f fonts.scale fonts.scale-save
        fi
        if [ -x $MKFONTDIRBIN ]; then
                $MKFONTDIR
@@ -92,8 +95,8 @@ case "$FTYPE" in
        fi
        if "`echo Fontmap.*`" != 'Fontmap.*' ]; then
                cat Fontmap.* > Fontmap
-       else
-               rm -f Fontmap
+       elif [ -f Fontmap ]; then
+               mv -f Fontmap Fontmap-save
        fi
        if [ -x $GNOMEFONTINSTBIN ]; then
                $GNOMEFONTINST
diff --git a/fontpostinst.spec b/fontpostinst.spec
new file mode 100644 (file)
index 0000000..aed159d
--- /dev/null
@@ -0,0 +1,38 @@
+Summary:       Font post (un)installation script
+Summary(pl):   Skrypt po(de)instalacyjny dla fontów
+Name:          fontpostinst
+Version:       0.1
+Release:       1
+License:       Free
+Group:         Applications/System
+Source0:       %{name}
+Requires:      fileutils
+Requires:      textutils
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Script to be called after each fonts installation or uninstallation.
+It supports regeneration of XFree86 fonts.alias, fonts.scale,
+fonts.dir files, gnome-font catalogs, ghostscript Fontmaps and
+fontconfig/xft cache.
+
+%description -l pl
+Skrypt do wywo³ywania po ka¿dym instalowaniu lub odinstalowaniu
+fontów. Potrafi regenerowaæ pliki fonts.alias, fonts.scale i fonts.dir
+XFree86, katalogi gnome-font, pliki Fontmap ghostscripta oraz cache
+fontconfig/xft.
+
+%prep
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_bindir}
+
+install %{SOURCE0} $RPM_BUILD_ROOT%{_bindir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/*
This page took 0.091357 seconds and 4 git commands to generate.