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
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)
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
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
--- /dev/null
+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}/*