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 Source100: fontconfig.conf
12 Source1001: fontconfig.manifest
13 BuildRequires: pkgconfig(freetype2) >= %{freetype_version}
15 BuildRequires: expat-devel
19 BuildRequires: systemd-devel
20 BuildRequires: pkgconfig(libtzplatform-config)
21 Requires(pre): %{TZ_SYS_BIN}/fc-cache, %{TZ_SYS_BIN}/mkdir %{TZ_SYS_BIN}/rm, %{TZ_SYS_BIN}/grep, %{TZ_SYS_BIN}/chsmack
22 Requires(post): /sbin/ldconfig
23 Requires(postun): /sbin/ldconfig
25 %define upgrade_script_path /usr/share/upgrade/scripts
28 Fontconfig is designed to locate fonts within the
29 system and select them according to requirements specified by
33 Summary: Font configuration and customization library
34 Group: Graphics & UI Framework/Fonts
35 Requires: %{name} = %{version}
36 Requires: fontconfig = %{version}
37 Requires: freetype-devel >= %{freetype_version}
41 The fontconfig-devel package includes the header files,
42 and developer docs for the fontconfig package.
44 Install fontconfig-devel if you want to develop programs which
52 # We don't want to rebuild the docs, but we want to install the included ones.
55 %reconfigure --disable-static \
56 --with-expat=%{_prefix} \
57 --with-expat-include=%{_includedir} \
58 --with-expat-lib=%{_libdir} \
59 --with-freetype-config=%{TZ_SYS_BIN}/freetype-config \
60 --with-add-fonts=%{TZ_SYS_RO_SHARE}/fonts,%{TZ_SYS_RO_SHARE}/app_fonts,%{TZ_SYS_RO_SHARE}/fallback_fonts,%{TZ_SYS_SHARE}/fonts \
61 --with-cache-dir=%{TZ_SYS_VAR}/cache/fontconfig \
62 --with-baseconfigdir=%{TZ_SYS_RO_ETC}/fonts \
63 --with-configdir=%{TZ_SYS_RO_ETC}/fonts/conf.d \
64 --with-templatedir=%{TZ_SYS_RO_ETC}/fonts/conf.avail \
65 --with-xmldir=%{TZ_SYS_RO_ETC}/fonts \
73 mkdir -p %{buildroot}%{upgrade_script_path}
74 cp -f scripts/fontconfig_upgrade.sh %{buildroot}%{upgrade_script_path}
78 mkdir -p %{buildroot}%{_tmpfilesdir}
79 install -m 0644 %SOURCE100 %{buildroot}%{_tmpfilesdir}/fontconfig.conf
81 # All font packages depend on this package, so we create
82 # and own /usr/share/fonts
83 mydir=$RPM_BUILD_ROOT%{TZ_SYS_RO_SHARE}/fonts
84 mkdir -p $RPM_BUILD_ROOT%{TZ_SYS_RO_SHARE}/fonts
85 mkdir -p %{buildroot}%{TZ_SYS_RO_SHARE}/license
86 cat COPYING > %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}
88 # Remove unpackaged files. no need when configure --disable-static
89 #rm $RPM_BUILD_ROOT%{_libdir}/*.la
90 #rm $RPM_BUILD_ROOT%{_libdir}/*.a
97 mkdir -p %{TZ_SYS_RO_SHARE}/fonts
98 mkdir -p %{TZ_SYS_RO_SHARE}/fallback_fonts
99 mkdir -p %{TZ_SYS_RO_SHARE}/app_fonts
101 # Skip making fontconfig cache folder for users. (/opt/home/app/.cache)
102 # The path will be changed according to a name of user.
103 #rm -rf %{TZ_USER_CACHE}/fontconfig
104 #mkdir -p %{TZ_USER_CACHE}/fontconfig
105 #chmod 755 %{TZ_USER_CACHE}
106 #chown app:app %{TZ_USER_CACHE}
107 #chsmack -t %{TZ_USER_CACHE}
108 #chsmack -a System::Shared %{TZ_USER_CACHE}
109 #chmod 755 %{TZ_USER_CACHE}/fontconfig
110 #chown app:app %{TZ_USER_CACHE}/fontconfig
111 #chsmack -t %{TZ_USER_CACHE}/fontconfig
112 #chsmack -a System::Shared %{TZ_USER_CACHE}/fontconfig
114 # remove 49-sansserif.conf to fix bmc #9024
115 #rm -rf /usr/%{_sysconfdir}/fonts/conf.d/49-sansserif.conf
117 # Force regeneration of all fontconfig cache files
118 # The check for existance is needed on dual-arch installs (the second
119 # copy of fontconfig might install the binary instead of the first)
120 # The HOME setting is to avoid problems if HOME hasn't been reset
121 if [ -x %{TZ_SYS_BIN}/fc-cache ] && %{TZ_SYS_BIN}/fc-cache --version 2>&1 | grep -q %{version} ; then
122 fc-cache -rf --system-only
125 %postun -p /sbin/ldconfig
128 %manifest fontconfig.manifest
129 %defattr(-,root,root,-)
130 %defattr(-, root, root)
131 %doc README AUTHORS COPYING
132 %{_libdir}/libfontconfig.so.*
134 %{TZ_SYS_RO_ETC}/fonts/*
135 %dir %{TZ_SYS_RO_ETC}/fonts/conf.avail
136 %dir %{TZ_SYS_RO_SHARE}/fonts
137 %doc %{TZ_SYS_RO_ETC}/fonts/conf.d/README
138 %config %{TZ_SYS_RO_ETC}/fonts/conf.avail/*.conf
139 %config(noreplace) %{TZ_SYS_RO_ETC}/fonts/conf.d/*.conf
140 %{TZ_SYS_RO_SHARE}/license/%{name}
141 %{_tmpfilesdir}/fontconfig.conf
142 %{upgrade_script_path}/fontconfig_upgrade.sh
145 %manifest fontconfig.manifest
146 %defattr(-,root,root,-)
147 %defattr(-, root, root)
148 %{_libdir}/libfontconfig.so
149 %{_libdir}/pkgconfig/*
150 %{_includedir}/fontconfig