add packaging
[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     --disable-docs
53
54 make %{?_smp_mflags}
55
56 %check
57 make check
58
59 %install
60
61 %make_install
62
63 mkdir -p %{buildroot}%{_datadir}/fonts
64
65 %post
66 /sbin/ldconfig
67
68 umask 0022
69
70 mkdir -p /var/cache/fontconfig
71 # Remove stale caches
72 rm -f /var/cache/fontconfig/????????????????????????????????.cache-2
73 rm -f /var/cache/fontconfig/stamp
74
75 if [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache --version 2>&1 | grep -q %{version} ; then
76 HOME=/root /usr/bin/fc-cache -f
77 fi
78
79 %postun -p /sbin/ldconfig
80
81 %files
82 %doc COPYING
83 %{_libdir}/libfontconfig.so.*
84 %{_bindir}/fc-*
85 %{_sysconfdir}/fonts/*
86 %dir %{_sysconfdir}/fonts/conf.avail
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
93 %files devel
94 %{_libdir}/libfontconfig.so
95 %{_libdir}/pkgconfig/*
96 %{_includedir}/fontconfig
97