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