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