Apply tizen-platform-config macros
[platform/upstream/fontconfig.git] / packaging / fontconfig.spec
1 %global freetype_version 2.5.0
2
3 Name:           fontconfig
4 Summary:        Font configuration and customization library
5 Version:        2.11.93
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 Source1001:     packaging/fontconfig.manifest
12 BuildRequires:  pkgconfig(freetype2) >= %{freetype_version}
13 BuildRequires:  gawk
14 BuildRequires:  expat-devel
15 BuildRequires:  perl
16 BuildRequires:  gperf
17 BuildRequires:  python
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
22
23 %description
24 Fontconfig is designed to locate fonts within the
25 system and select them according to requirements specified by
26 applications.
27
28 %package devel
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}
34 Requires:       pkg-config
35
36 %description devel
37 The fontconfig-devel package includes the header files,
38 and developer docs for the fontconfig package.
39
40 Install fontconfig-devel if you want to develop programs which
41 will use fontconfig.
42
43 %prep
44 %setup -q
45 cp %{SOURCE1001} .
46
47 %build
48 # We don't want to rebuild the docs, but we want to install the included ones.
49 export HASDOCBOOK=no
50
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 \
62     --disable-docs
63
64 make %{?jobs:-j%jobs}
65
66 #make check
67 %install
68 rm -rf %{buildroot}
69
70 %make_install
71
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}
78
79 # Remove unpackaged files. no need when configure --disable-static
80 #rm $RPM_BUILD_ROOT%{_libdir}/*.la
81 #rm $RPM_BUILD_ROOT%{_libdir}/*.a
82
83 %post
84 /sbin/ldconfig
85
86 umask 0022
87
88 mkdir -p %{TZ_SYS_VAR}/cache/fontconfig
89 # Remove stale caches
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
97 rm -rf %{TZ_USER_CACHE}/fontconfig
98 mkdir -p %{TZ_USER_CACHE}/fontconfig
99 chmod 755 %{TZ_USER_CACHE}
100 chown app:app %{TZ_USER_CACHE}
101 chsmack -t %{TZ_USER_CACHE}
102 chsmack -a System::Shared %{TZ_USER_CACHE}
103 chmod 755 %{TZ_USER_CACHE}/fontconfig
104 chown app:app %{TZ_USER_CACHE}/fontconfig
105 chsmack -t %{TZ_USER_CACHE}/fontconfig
106 chsmack -a System::Shared %{TZ_USER_CACHE}/fontconfig
107
108 # remove 49-sansserif.conf to fix bmc #9024
109 #rm -rf /usr/%{_sysconfdir}/fonts/conf.d/49-sansserif.conf
110
111 # Force regeneration of all fontconfig cache files
112 # The check for existance is needed on dual-arch installs (the second
113 #  copy of fontconfig might install the binary instead of the first)
114 # The HOME setting is to avoid problems if HOME hasn't been reset
115 if [ -x %{TZ_SYS_BIN}/fc-cache ] && %{TZ_SYS_BIN}/fc-cache --version 2>&1 | grep -q %{version} ; then
116 fc-cache -rf --system-only
117 fi
118
119 %postun -p /sbin/ldconfig
120
121 %files
122 %manifest fontconfig.manifest
123 %defattr(-,root,root,-)
124 %defattr(-, root, root)
125 %doc README AUTHORS COPYING
126 %{_libdir}/libfontconfig.so.*
127 %{TZ_SYS_BIN}/fc-*
128 %{TZ_SYS_RO_ETC}/fonts/*
129 %dir %{TZ_SYS_RO_ETC}/fonts/conf.avail
130 %dir %{TZ_SYS_RO_SHARE}/fonts
131 %doc %{TZ_SYS_RO_ETC}/fonts/conf.d/README
132 %config %{TZ_SYS_RO_ETC}/fonts/conf.avail/*.conf
133 %config(noreplace) %{TZ_SYS_RO_ETC}/fonts/conf.d/*.conf
134 %dir %{TZ_SYS_VAR}/cache/fontconfig
135 %{TZ_SYS_RO_SHARE}/license/%{name}
136
137 %files devel
138 %manifest fontconfig.manifest
139 %defattr(-,root,root,-)
140 %defattr(-, root, root)
141 %{_libdir}/libfontconfig.so
142 %{_libdir}/pkgconfig/*
143 %{_includedir}/fontconfig
144