fontconfig: upgrade to 2.13.0
[platform/upstream/fontconfig.git] / packaging / fontconfig.spec
1 %global freetype_version 2.9.0
2
3 Name:           fontconfig
4 Summary:        Font configuration and customization library
5 Version:        2.13.0
6 Release:        1
7 Group:          Graphics & UI Framework/Fonts
8 License:        MIT
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}
14 BuildRequires:  gawk
15 BuildRequires:  expat-devel
16 BuildRequires:  perl
17 BuildRequires:  gperf
18 BuildRequires:  python
19 BuildRequires:  systemd-devel
20 BuildRequires:  gettext-tools
21 BuildRequires:  libuuid-devel
22 BuildRequires:  pkgconfig(libtzplatform-config)
23 Requires(pre):  %{TZ_SYS_BIN}/fc-cache, %{TZ_SYS_BIN}/mkdir %{TZ_SYS_BIN}/rm, %{TZ_SYS_BIN}/grep, %{TZ_SYS_BIN}/chsmack
24 Requires(post): /sbin/ldconfig
25 Requires(postun): /sbin/ldconfig
26
27 %define upgrade_script_path /usr/share/upgrade/scripts
28
29 %description
30 Fontconfig is designed to locate fonts within the
31 system and select them according to requirements specified by
32 applications.
33
34 %package devel
35 Summary:        Font configuration and customization library
36 Group:          Graphics & UI Framework/Fonts
37 Requires:       %{name} = %{version}
38 Requires:       fontconfig = %{version}
39 Requires:       freetype-devel >= %{freetype_version}
40 Requires:       pkg-config
41
42 %description devel
43 The fontconfig-devel package includes the header files,
44 and developer docs for the fontconfig package.
45
46 Install fontconfig-devel if you want to develop programs which
47 will use fontconfig.
48
49 %prep
50 %setup -q
51 cp %{SOURCE1001} .
52
53 %build
54 # We don't want to rebuild the docs, but we want to install the included ones.
55 export HASDOCBOOK=no
56
57 %reconfigure --disable-static \
58     --with-expat=%{_prefix} \
59     --with-expat-include=%{_includedir} \
60     --with-expat-lib=%{_libdir} \
61     --with-freetype-config=%{TZ_SYS_BIN}/freetype-config \
62     --with-add-fonts=%{TZ_SYS_RO_SHARE}/fonts,%{TZ_SYS_RO_SHARE}/app_fonts,%{TZ_SYS_RO_SHARE}/fallback_fonts,%{TZ_SYS_SHARE}/fonts \
63     --with-cache-dir=%{TZ_SYS_VAR}/cache/fontconfig \
64     --with-baseconfigdir=%{TZ_SYS_RO_ETC}/fonts \
65     --with-configdir=%{TZ_SYS_RO_ETC}/fonts/conf.d \
66     --with-templatedir=%{TZ_SYS_RO_ETC}/fonts/conf.avail \
67     --with-xmldir=%{TZ_SYS_RO_ETC}/fonts \
68     --disable-docs
69
70 make %{?jobs:-j%jobs}
71
72 #make check
73 %install
74 rm -rf %{buildroot}
75 mkdir -p %{buildroot}%{upgrade_script_path}
76 cp -f scripts/500.fontconfig.sh %{buildroot}%{upgrade_script_path}
77
78 %make_install
79
80 mkdir -p %{buildroot}%{_tmpfilesdir}
81 install -m 0644 %SOURCE100 %{buildroot}%{_tmpfilesdir}/fontconfig.conf
82
83 # All font packages depend on this package, so we create
84 # and own /usr/share/fonts
85 mydir=$RPM_BUILD_ROOT%{TZ_SYS_RO_SHARE}/fonts
86 mkdir -p $RPM_BUILD_ROOT%{TZ_SYS_RO_SHARE}/fonts
87
88 # Remove unpackaged files. no need when configure --disable-static
89 #rm $RPM_BUILD_ROOT%{_libdir}/*.la
90 #rm $RPM_BUILD_ROOT%{_libdir}/*.a
91
92 %post
93 /sbin/ldconfig
94
95 umask 0022
96
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
100
101 mkdir -p %{TZ_SYS_VAR}/cache/fontconfig
102 chown root:root %{TZ_SYS_VAR}/cache/fontconfig
103 chmod 755 %{TZ_SYS_VAR}/cache/fontconfig
104 chsmack -t %{TZ_SYS_VAR}/cache/fontconfig
105 chsmack -a User::App::Shared %{TZ_SYS_VAR}/cache/fontconfig
106
107 # Skip making fontconfig cache folder for users. (/opt/home/app/.cache)
108 # The path will be changed according to a name of user.
109 #rm -rf %{TZ_USER_CACHE}/fontconfig
110 #mkdir -p %{TZ_USER_CACHE}/fontconfig
111 #chmod 755 %{TZ_USER_CACHE}
112 #chown app:app %{TZ_USER_CACHE}
113 #chsmack -t %{TZ_USER_CACHE}
114 #chsmack -a System::Shared %{TZ_USER_CACHE}
115 #chmod 755 %{TZ_USER_CACHE}/fontconfig
116 #chown app:app %{TZ_USER_CACHE}/fontconfig
117 #chsmack -t %{TZ_USER_CACHE}/fontconfig
118 #chsmack -a System::Shared %{TZ_USER_CACHE}/fontconfig
119
120 # remove 49-sansserif.conf to fix bmc #9024
121 #rm -rf /usr/%{_sysconfdir}/fonts/conf.d/49-sansserif.conf
122
123 # Force regeneration of all fontconfig cache files
124 # The check for existance is needed on dual-arch installs (the second
125 #  copy of fontconfig might install the binary instead of the first)
126 # The HOME setting is to avoid problems if HOME hasn't been reset
127 #if [ -x %{TZ_SYS_BIN}/fc-cache ] && %{TZ_SYS_BIN}/fc-cache --version 2>&1 | grep -q %{version} ; then
128 #fc-cache -rf --system-only
129 #fi
130
131 %postun -p /sbin/ldconfig
132
133 %files
134 %manifest fontconfig.manifest
135 %defattr(-,root,root,-)
136 %defattr(-, root, root)
137 %doc README AUTHORS COPYING
138 %{_libdir}/libfontconfig.so.*
139 %{TZ_SYS_BIN}/fc-*
140 %{TZ_SYS_RO_ETC}/fonts/*
141 %dir %{TZ_SYS_RO_ETC}/fonts/conf.avail
142 %dir %{TZ_SYS_RO_SHARE}/fonts
143 %{TZ_SYS_RO_SHARE}/gettext/its/fontconfig*
144 %{TZ_SYS_RO_SHARE}/locale/*/*/fontconfig*
145 %doc %{TZ_SYS_RO_ETC}/fonts/conf.d/README
146 %config %{TZ_SYS_RO_ETC}/fonts/conf.avail/*.conf
147 %config(noreplace) %{TZ_SYS_RO_ETC}/fonts/conf.d/*.conf
148 %{_tmpfilesdir}/fontconfig.conf
149 %{upgrade_script_path}/500.fontconfig.sh
150 %license COPYING
151
152 %files devel
153 %manifest fontconfig.manifest
154 %defattr(-,root,root,-)
155 %defattr(-, root, root)
156 %{_libdir}/libfontconfig.so
157 %{_libdir}/pkgconfig/*
158 %{_includedir}/fontconfig
159