-#!/bin/sh
-set -o errexit
+#!/bin/bash
-# First argument of this script is the package name.
+source ../functions/main
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
+X11_FONTS_DIR="/usr/share/fonts/X11"
-install -v -d -m755 /usr/share/fonts
-ln -svfT ${XORG_PREFIX}/lib/X11/fonts/OTF /usr/share/fonts/X11-OTF
-ln -svfT ${XORG_PREFIX}/lib/X11/fonts/TTF /usr/share/fonts/X11-TTF
+if ! grep -q "${X11_FONTS_DIR}" /etc/fonts/local.conf; then
+ # Adding X fonts directory to local configuration file
+ sed -i -e "s!\(</fontconfig>\)! <dir>${X11_FONTS_DIR}</dir>\n\1!" \
+ /etc/fonts/local.conf
+fi
+
+# Updating cache database.
+fc-cache -f
exit $?