|
Panu Matilainen |
0a87f6 |
#!/bin/bash
|
|
Panu Matilainen |
0a87f6 |
#
|
|
Panu Matilainen |
0a87f6 |
# Script to install in:
|
|
Panu Matilainen |
0a87f6 |
# /usr/lib/rpm/redhat/find-provides.d
|
|
Panu Matilainen |
0a87f6 |
#
|
|
Panu Matilainen |
0a87f6 |
# Transform font files into RPM provides
|
|
Panu Matilainen |
0a87f6 |
# Requires fontconfig >= 2.6.90
|
|
Panu Matilainen |
0a87f6 |
#
|
|
Panu Matilainen |
0a87f6 |
# Author: Behdad Esfahbod <behdad@redhat.com>
|
|
Panu Matilainen |
0a87f6 |
# Based on other provides scripts from RPM
|
|
Panu Matilainen |
0a87f6 |
#
|
|
Panu Matilainen |
0a87f6 |
|
|
Panu Matilainen |
0a87f6 |
fcquery=/usr/bin/fc-query
|
|
Panu Matilainen |
0a87f6 |
|
|
Panu Matilainen |
0a87f6 |
[ -x $fcquery ] || exit 0
|
|
Panu Matilainen |
0a87f6 |
|
|
Panu Matilainen |
0a87f6 |
# filter out anything outside main fontconfig path
|
|
Panu Matilainen |
0a87f6 |
grep /usr/share/fonts/ |
|
|
Panu Matilainen |
0a87f6 |
xargs $fcquery --format '%{family}\n:lang=%{lang}\n' 2> /dev/null |
|
|
Panu Matilainen |
0a87f6 |
while read line; do
|
|
Panu Matilainen |
0a87f6 |
case $line in
|
|
Panu Matilainen |
0a87f6 |
:lang=*)
|
|
Panu Matilainen |
0a87f6 |
langs=${line#:lang=}
|
|
Panu Matilainen |
0a87f6 |
OLDIFS=$IFS
|
|
Panu Matilainen |
0a87f6 |
IFS='|'
|
|
Panu Matilainen |
0a87f6 |
for lang in $langs; do
|
|
Panu Matilainen |
0a87f6 |
echo :lang=$lang
|
|
Panu Matilainen |
0a87f6 |
done
|
|
Panu Matilainen |
0a87f6 |
IFS=$OLDIFS
|
|
Panu Matilainen |
0a87f6 |
;;
|
|
Panu Matilainen |
0a87f6 |
*)
|
|
Panu Matilainen |
0a87f6 |
echo "$line" | tr 'A-Z_' 'a-z-' | tr -d -c 'a-z0-9-\n'
|
|
Panu Matilainen |
0a87f6 |
;;
|
|
Panu Matilainen |
0a87f6 |
esac
|
|
Panu Matilainen |
0a87f6 |
done |
|
|
Panu Matilainen |
0a87f6 |
sed 's/\(.*\)/Font(\1)/' |
|
|
Panu Matilainen |
0a87f6 |
sort -u
|