1 %global freetype_version 2.5.0
4 Summary: Font configuration and customization library
7 Group: Graphics & UI Framework/Fonts
9 URL: http://fontconfig.org
10 Source0: http://fontconfig.org/release/fontconfig-%{version}.tar.gz
11 Source1001: packaging/fontconfig.manifest
12 BuildRequires: pkgconfig(freetype2) >= %{freetype_version}
14 BuildRequires: expat-devel
18 BuildRequires: pkgconfig(libtzplatform-config)
19 Requires(pre): %{TZ_SYS_BIN}/fc-cache, %{TZ_SYS_BIN}/mkdir %{TZ_SYS_BIN}/rm, %{TZ_SYS_BIN}/grep, %{TZ_SYS_BIN}/chsmack
20 Requires(post): /sbin/ldconfig
21 Requires(postun): /sbin/ldconfig
24 Fontconfig is designed to locate fonts within the
25 system and select them according to requirements specified by
29 Summary: Font configuration and customization library
30 Group: Graphics & UI Framework/Fonts
31 Requires: %{name} = %{version}
32 Requires: fontconfig = %{version}
33 Requires: freetype-devel >= %{freetype_version}
37 The fontconfig-devel package includes the header files,
38 and developer docs for the fontconfig package.
40 Install fontconfig-devel if you want to develop programs which
48 # We don't want to rebuild the docs, but we want to install the included ones.
51 %reconfigure --disable-static \
52 --with-expat=%{_prefix} \
53 --with-expat-include=%{_includedir} \
54 --with-expat-lib=%{_libdir} \
55 --with-freetype-config=%{TZ_SYS_BIN}/freetype-config \
56 --with-add-fonts=%{TZ_SYS_RO_SHARE}/fonts,%{TZ_SYS_RO_SHARE}/app_fonts,%{TZ_SYS_RO_SHARE}/fallback_fonts \
57 --with-cache-dir=%{TZ_SYS_VAR}/cache/fontconfig \
58 --with-baseconfigdir=%{TZ_SYS_RO_ETC}/fonts \
59 --with-configdir=%{TZ_SYS_RO_ETC}/fonts/conf.d \
60 --with-templatedir=%{TZ_SYS_RO_ETC}/fonts/conf.avail \
61 --with-xmldir=%{TZ_SYS_RO_ETC}/fonts \
72 # All font packages depend on this package, so we create
73 # and own /usr/share/fonts
74 mydir=$RPM_BUILD_ROOT%{TZ_SYS_RO_SHARE}/fonts
75 mkdir -p $RPM_BUILD_ROOT%{TZ_SYS_RO_SHARE}/fonts
76 mkdir -p %{buildroot}%{TZ_SYS_RO_SHARE}/license
77 cat COPYING > %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}
79 # Remove unpackaged files. no need when configure --disable-static
80 #rm $RPM_BUILD_ROOT%{_libdir}/*.la
81 #rm $RPM_BUILD_ROOT%{_libdir}/*.a
88 mkdir -p %{TZ_SYS_VAR}/cache/fontconfig
90 rm -f %{TZ_SYS_VAR}/cache/fontconfig/*
91 mkdir -p %{TZ_SYS_VAR}/cache/fontconfig
92 mkdir -p %{TZ_SYS_RO_SHARE}/fonts
93 mkdir -p %{TZ_SYS_RO_SHARE}/fallback_fonts
94 mkdir -p %{TZ_SYS_RO_SHARE}/app_fonts
95 chsmack -t %{TZ_SYS_VAR}/cache/fontconfig
96 chsmack -a System::Shared %{TZ_SYS_VAR}/cache/fontconfig
98 # Skip making fontconfig cache folder for users. (/opt/home/app/.cache)
99 # The path will be changed according to a name of user.
100 #rm -rf %{TZ_USER_CACHE}/fontconfig
101 #mkdir -p %{TZ_USER_CACHE}/fontconfig
102 #chmod 755 %{TZ_USER_CACHE}
103 #chown app:app %{TZ_USER_CACHE}
104 #chsmack -t %{TZ_USER_CACHE}
105 #chsmack -a System::Shared %{TZ_USER_CACHE}
106 #chmod 755 %{TZ_USER_CACHE}/fontconfig
107 #chown app:app %{TZ_USER_CACHE}/fontconfig
108 #chsmack -t %{TZ_USER_CACHE}/fontconfig
109 #chsmack -a System::Shared %{TZ_USER_CACHE}/fontconfig
111 # remove 49-sansserif.conf to fix bmc #9024
112 #rm -rf /usr/%{_sysconfdir}/fonts/conf.d/49-sansserif.conf
114 # Force regeneration of all fontconfig cache files
115 # The check for existance is needed on dual-arch installs (the second
116 # copy of fontconfig might install the binary instead of the first)
117 # The HOME setting is to avoid problems if HOME hasn't been reset
118 if [ -x %{TZ_SYS_BIN}/fc-cache ] && %{TZ_SYS_BIN}/fc-cache --version 2>&1 | grep -q %{version} ; then
119 fc-cache -rf --system-only
122 %postun -p /sbin/ldconfig
125 %manifest fontconfig.manifest
126 %defattr(-,root,root,-)
127 %defattr(-, root, root)
128 %doc README AUTHORS COPYING
129 %{_libdir}/libfontconfig.so.*
131 %{TZ_SYS_RO_ETC}/fonts/*
132 %dir %{TZ_SYS_RO_ETC}/fonts/conf.avail
133 %dir %{TZ_SYS_RO_SHARE}/fonts
134 %doc %{TZ_SYS_RO_ETC}/fonts/conf.d/README
135 %config %{TZ_SYS_RO_ETC}/fonts/conf.avail/*.conf
136 %config(noreplace) %{TZ_SYS_RO_ETC}/fonts/conf.d/*.conf
137 %dir %{TZ_SYS_VAR}/cache/fontconfig
138 %{TZ_SYS_RO_SHARE}/license/%{name}
141 %manifest fontconfig.manifest
142 %defattr(-,root,root,-)
143 %defattr(-, root, root)
144 %{_libdir}/libfontconfig.so
145 %{_libdir}/pkgconfig/*
146 %{_includedir}/fontconfig