b42df40072d7081566fb09ccf9b27ca30cfa713b
[platform/upstream/fontconfig.git] / packaging / fontconfig.spec
1 %global freetype_version 2.1.4
2
3 Name:           fontconfig
4 Version:        2.10.0
5 Release:        2
6 License:        MIT
7 Summary:        Font configuration and customization library
8 Url:            http://fontconfig.org
9 Group:          System/Libraries
10 Source:         %{name}-%{version}.tar.bz2
11 BuildRequires:  expat-devel
12 BuildRequires:  gawk
13 BuildRequires:  perl
14 BuildRequires:  pkgconfig(freetype2) >= %{freetype_version}
15 Requires(pre): /usr/bin/fc-cache, /usr/bin/mkdir /usr/bin/rm, /usr/bin/grep
16
17 %description
18 Fontconfig is designed to locate fonts within the
19 system and select them according to requirements specified by
20 applications.
21
22 %package devel
23 Summary:        Font configuration and customization library
24 Group:          Development/Libraries
25 Requires:       %{name} = %{version}
26 Requires:       fontconfig = %{version}
27 Requires:       freetype-devel >= %{freetype_version}
28 Requires:       pkg-config
29
30 %description devel
31 The fontconfig-devel package includes the header files,
32 and developer docs for the fontconfig package.
33
34 Install fontconfig-devel if you want to develop programs which
35 will use fontconfig.
36
37 %prep
38 %setup -q
39
40 %build
41 # We don't want to rebuild the docs, but we want to install the included ones.
42 export HASDOCBOOK=no
43
44 %reconfigure --disable-static \
45     --with-expat=/usr \
46     --with-expat-include=%{_includedir} \
47     --with-expat-lib=%{_libdir} \
48     --with-freetype-config=%{_bindir}/freetype-config \
49     --with-add-fonts=%{_datadir}/fonts,/usr/share/app_fonts,/usr/share/fallback_fonts \
50     --with-cache-dir=/var/cache/fontconfig \
51     --with-confdir=/etc/fonts \
52     --with-templatedir=%{_sysconfdir}/fonts/conf.avail \
53     --disable-docs
54
55 make %{?_smp_mflags}
56
57 %check
58 make check
59
60 %install
61
62 %make_install
63
64 mkdir -p %{buildroot}%{_datadir}/fonts
65
66 %post
67 /sbin/ldconfig
68
69 umask 0022
70
71 mkdir -p /var/cache/fontconfig
72 # Remove stale caches
73 rm -f /var/cache/fontconfig/????????????????????????????????.cache-2
74 rm -f /var/cache/fontconfig/stamp
75
76 if [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache --version 2>&1 | grep -q %{version} ; then
77 HOME=/root /usr/bin/fc-cache -f
78 fi
79
80 %postun -p /sbin/ldconfig
81
82 %files
83 %doc COPYING
84 %{_libdir}/libfontconfig.so.*
85 %{_bindir}/fc-*
86 %{_sysconfdir}/fonts/*
87 %dir %{_datadir}/fonts
88 %doc %{_sysconfdir}/fonts/conf.d/README
89 %config %{_sysconfdir}/fonts/conf.avail/*.conf
90 %config(noreplace) %{_sysconfdir}/fonts/conf.d/*.conf
91 %dir %{_localstatedir}/cache/fontconfig
92 /usr/share/xml/fontconfig/fonts.dtd
93
94 %files devel
95 %{_libdir}/libfontconfig.so
96 %{_libdir}/pkgconfig/*
97 %{_includedir}/fontconfig
98