From b5363e86deb8a360cb8f374f39ebbc9f0ea54007 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Jan 27 2009 09:49:32 +0000 Subject: - 1.16-2 - Add fontconfig.prov and macros.fontconfig so that we can automatically generate font provides for packages at build time. This lets us do some cool things with PackageKit in the future. --- diff --git a/fontconfig.prov b/fontconfig.prov new file mode 100644 index 0000000..4846021 --- /dev/null +++ b/fontconfig.prov @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Script to install in: +# /usr/lib/rpm/redhat/find-provides.d +# +# Transform font files into RPM provides +# Requires fontconfig >= 2.6.90 +# +# Author: Behdad Esfahbod +# Based on other provides scripts from RPM +# + +grep '^/usr/share/fonts/' | +xargs fc-query --format '%{family}\n:lang=%{lang}\n' | +while read line; do + case $line in + :lang=*) + langs=${line#:lang=} + OLDIFS=$IFS + IFS='|' + for lang in $langs; do + echo :lang=$lang + done + IFS=$OLDIFS + ;; + *) + echo "$line" | tr 'A-Z_' 'a-z-' | tr -d -c 'a-z0-9-\n' + ;; + esac +done | +sed 's/\(.*\)/Font(\1)/' | +sort -u diff --git a/fontpackages.spec b/fontpackages.spec index 53a2057..1ab34c8 100644 --- a/fontpackages.spec +++ b/fontpackages.spec @@ -4,7 +4,7 @@ Name: fontpackages Version: 1.16 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Common directory and macro definitions used by font packages Group: Development/System @@ -13,6 +13,8 @@ Group: Development/System License: LGPLv3+ URL: http://fedoraproject.org/wiki/fontpackages/ Source0: http://fedorahosted.org/releases/f/o/%{name}/%{name}-%{version}.tar.bz2 +Source1: fontconfig.prov +Source2: macros.fontconfig BuildArch: noarch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -69,6 +71,8 @@ install -m 0755 -d %{buildroot}${_fontbasedir} \ install -m 0644 -p spec-templates/*.spec %{buildroot}%{spectemplatedir} install -m 0644 -p fontconfig-templates/* %{buildroot}%{ftcgtemplatedir} install -m 0644 -p macros/macros* %{buildroot}%{rpmmacrodir} +install -m 0755 -D -p %{SOURCE1} %{buildroot}%{_libdir}/rpm/fontconfig.prov +install -m 0755 -D -p %{SOURCE2} %{buildroot}%{_sysconfdir}/rpm/macros.fontconfig cat < %{name}-%{version}.files %defattr(0644,root,root,0755) @@ -85,6 +89,8 @@ rm -fr %{buildroot} %files filesystem -f %{name}-%{version}.files %defattr(0644,root,root,0755) %dir %{_datadir}/fontconfig +%{_libdir}/rpm/fontconfig.prov +%{_sysconfdir}/rpm/macros.fontconfig %files devel @@ -97,6 +103,12 @@ rm -fr %{buildroot} %changelog +* Tue Jan 27 2009 Richard Hughes +- 1.16-2 +- Add fontconfig.prov and macros.fontconfig so that we can automatically + generate font provides for packages at build time. + This lets us do some cool things with PackageKit in the future. + * Wed Jan 22 2009 Nicolas Mailhot - 1.16-1 diff --git a/macros.fontconfig b/macros.fontconfig new file mode 100644 index 0000000..6fd0431 --- /dev/null +++ b/macros.fontconfig @@ -0,0 +1 @@ +%__fontconfig_provides /usr/lib/rpm/fontconfig.prov