# This typically comes with X, so I generally only install it this
# way if I need it on a box that doesn't have X installed on it
# (like a server that uses mrtg/rrdtool with cairo)
# Install/update Python lxml
su -c "pip install -U lxml"
# Get it
cd
test -f installed/fontconfig-2.14.2.tar.xz &&
mv installed/fontconfig-2.14.2.tar.xz .
test ! -f fontconfig-2.14.2.tar.xz &&
wget https://www.freedesktop.org/software/fontconfig/release/\
fontconfig-2.14.2.tar.xz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "fontconfig-*" -exec rm -r {} \;
tar xJvf ~/fontconfig-2.14.2.tar.xz
cd fontconfig-2.14.2
test $UID = 0 && chown -R root:root .
# If you don't want documentation add --disable-docs
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --sysconfdir=/etc --prefix=/usr --libdir=/usr/lib64 \
--mandir=/usr/man --docdir=/usr/doc/fontconfig-2.14.2 --localstatedir=/var
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --sysconfdir=/etc --prefix=/usr --mandir=/usr/man \
--docdir=/usr/doc/fontconfig-2.14.2 --localstatedir=/var
# If you get an error about pdfjadetex, you may need to tell your shell
# where teTeX is:
# . /etc/profile.d/tetex.sh
# Build it
make
# Become root to install it
su
# If you are completely sure they are not in use, Remove old shared
# library files. If you run X or Apache+PHP, I wouldn't.
rm -f /usr/lib*/libfontconfig.*
# Install it
make install
ldconfig
# See the msttcorefonts HOWTO if you want to
# install some fonts. See /etc/fonts/fonts.conf for font directory
# locations, etc.
# 'make install' does this, but remember to run this to update the font
# indexes when you install/remove fonts in the future
fc-cache -f
# Run this to list available fonts
fc-list
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/fontconfig-*.tar.*
mv fontconfig-2.14.2.tar.xz installed/
# If you ever want to uninstall FontConfig, this should do it:
cd
su
test -d src/fontconfig-* && ( cd src/fontconfig-* ; make uninstall )
## This is a bit severe, may be used by others...
#test -d /etc/fonts && rm -r /etc/fonts
( cd /usr/bin ; rm -f fc-cache fc-cat fc-list fc-match )
test -d /usr/doc/fontconfig && rm -r /usr/doc/fontconfig
find /usr/doc -maxdepth 1 -type d -name "fontconfig-*" -exec rm -r {} \;
test -d /usr/include/fontconfig && rm -r /usr/include/fontconfig
( cd /usr/man/man1 ; fc-cache.1 fc-cat.1 fc-list.1 fc-match.1 )
test -d /usr/share/doc/fontconfig && rm -r /usr/share/doc/fontconfig
rm -f /usr/lib/libfontconfig.* /usr/lib64/libfontconfig.* \
/usr/lib/pkgconfig/fontconfig.pc /usr/lib64/pkgconfig/fontconfig.pc \
/usr/man/man3/Fc*.3 /usr/man/man5/fonts-conf.5
test -d /var/cache/fontconfig && rm -r /var/cache/fontconfig
exit
find ~/src -maxdepth 1 -type d -name "fontconfig-*" -exec rm -r {} \;
rm -f ~/installed/fontconfig-*.tar.*