summaryrefslogtreecommitdiff
path: root/packaging/fontconfig.spec
blob: e34113a53d7335e2175a14ff4b397a21682ca26a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
%global freetype_version 2.1.4

Name:           fontconfig
Version:        2.10.91
Release:        0
License:        MIT
Summary:        Font configuration and customization library
Url:            http://fontconfig.org
Group:          Graphics/Font Management
Source:         %{name}-%{version}.tar.bz2
Source1001: 	fontconfig.manifest
BuildRequires:  expat-devel
BuildRequires:  gawk
BuildRequires:  perl
BuildRequires:  pkgconfig(freetype2) >= %{freetype_version}
Requires(pre): /usr/bin/fc-cache, /usr/bin/mkdir /usr/bin/rm, /usr/bin/grep

%description
Fontconfig is designed to locate fonts within the
system and select them according to requirements specified by
applications.

%package devel
Summary:        Font configuration and customization library
Group:          Development/Libraries
Requires:       %{name} = %{version}
Requires:       fontconfig = %{version}
Requires:       freetype-devel >= %{freetype_version}
Requires:       pkg-config

%description devel
The fontconfig-devel package includes the header files,
and developer docs for the fontconfig package.

Install fontconfig-devel if you want to develop programs which
will use fontconfig.

%prep
%setup -q
cp %{SOURCE1001} .

%build
# We don't want to rebuild the docs, but we want to install the included ones.
export HASDOCBOOK=no

%reconfigure --disable-static \
    --with-expat=/usr \
    --with-expat-include=%{_includedir} \
    --with-expat-lib=%{_libdir} \
    --with-freetype-config=%{_bindir}/freetype-config \
    --with-add-fonts=%{_datadir}/fonts,/usr/share/app_fonts,/usr/share/fallback_fonts \
    --with-cache-dir=/var/cache/fontconfig \
    --with-confdir=/etc/fonts \
    --with-templatedir=%{_sysconfdir}/fonts/conf.avail \
    --disable-docs

make %{?_smp_mflags}

%check
make check

%install

%make_install

mkdir -p %{buildroot}%{_datadir}/fonts

%post
/sbin/ldconfig

umask 0022

mkdir -p /var/cache/fontconfig
# Remove stale caches
rm -f /var/cache/fontconfig/????????????????????????????????.cache-2
rm -f /var/cache/fontconfig/stamp

if [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache --version 2>&1 | grep -q %{version} ; then
HOME=/root /usr/bin/fc-cache -f
fi

%postun -p /sbin/ldconfig

%files
%manifest %{name}.manifest
%license COPYING
%{_libdir}/libfontconfig.so.*
%{_bindir}/fc-*
%{_sysconfdir}/fonts/*
%dir %{_datadir}/fonts
%doc %{_sysconfdir}/fonts/conf.d/README
%config %{_sysconfdir}/fonts/conf.avail/*.conf
%config(noreplace) %{_sysconfdir}/fonts/conf.d/*.conf
%dir %{_localstatedir}/cache/fontconfig
/usr/share/xml/fontconfig/fonts.dtd

%files devel
%manifest %{name}.manifest
%{_libdir}/libfontconfig.so
%{_libdir}/pkgconfig/*
%{_includedir}/fontconfig