Update spec file
[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 Requires(pre):  /usr/bin/fc-cache, /usr/bin/mkdir /usr/bin/rm, /usr/bin/grep, /usr/bin/chsmack
19 Requires(post): /sbin/ldconfig
20 Requires(postun): /sbin/ldconfig
21
22 %description
23 Fontconfig is designed to locate fonts within the
24 system and select them according to requirements specified by
25 applications.
26
27 %package devel
28 Summary:        Font configuration and customization library
29 Group:          Graphics & UI Framework/Fonts
30 Requires:       %{name} = %{version}
31 Requires:       fontconfig = %{version}
32 Requires:       freetype-devel >= %{freetype_version}
33 Requires:       pkg-config
34
35 %description devel
36 The fontconfig-devel package includes the header files,
37 and developer docs for the fontconfig package.
38
39 Install fontconfig-devel if you want to develop programs which
40 will use fontconfig.
41
42 %prep
43 %setup -q
44 cp %{SOURCE1001} .
45
46 %build
47 # We don't want to rebuild the docs, but we want to install the included ones.
48 export HASDOCBOOK=no
49
50 %reconfigure --disable-static \
51     --with-expat=/usr \
52     --with-expat-include=%{_includedir} \
53     --with-expat-lib=%{_libdir} \
54     --with-freetype-config=%{_bindir}/freetype-config \
55     --with-add-fonts=/opt/share/fonts,/usr/share/app_fonts,/usr/share/fallback_fonts \
56     --with-cache-dir=/var/cache/fontconfig \
57         --with-baseconfigdir=/usr/etc/fonts \
58     --with-configdir=/usr/etc/fonts/conf.d \
59     --with-templatedir=/usr/etc/fonts/conf.avail \
60         --with-xmldir=/usr/etc/fonts \
61     --disable-docs
62
63 make %{?jobs:-j%jobs}
64
65 #make check
66 %install
67 rm -rf %{buildroot}
68
69 %make_install
70
71 # All font packages depend on this package, so we create
72 # and own /usr/share/fonts
73 mydir=$RPM_BUILD_ROOT%{_datadir}/fonts
74 mkdir -p $RPM_BUILD_ROOT%{_datadir}/fonts
75 mkdir -p %{buildroot}/usr/share/license
76 cat COPYING > %{buildroot}/usr/share/license/%{name}
77
78 # Remove unpackaged files. no need when configure --disable-static
79 #rm $RPM_BUILD_ROOT%{_libdir}/*.la
80 #rm $RPM_BUILD_ROOT%{_libdir}/*.a
81
82 %post
83 /sbin/ldconfig
84
85 umask 0022
86
87 mkdir -p /var/cache/fontconfig
88 # Remove stale caches
89 rm -f /var/cache/fontconfig/*
90 mkdir -p /opt/var/cache/fontconfig
91 mkdir -p /usr/share/fonts
92 mkdir -p /usr/share/fallback_fonts
93 mkdir -p /usr/share/app_fonts
94 chsmack -t /opt/var/cache/fontconfig
95 chsmack -a System::Shared /opt/var/cache/fontconfig
96 rm -rf /opt/home/app/.cache/fontconfig
97 mkdir -p /opt/home/app/.cache/fontconfig
98 chmod 755 /opt/home/app/.cache
99 chown app:app /opt/home/app/.cache
100 chsmack -t /opt/home/app/.cache
101 chsmack -a System::Shared /opt/home/app/.cache
102 chmod 755 /opt/home/app/.cache/fontconfig
103 chown app:app /opt/home/app/.cache/fontconfig
104 chsmack -t /opt/home/app/.cache/fontconfig
105 chsmack -a System::Shared /opt/home/app/.cache/fontconfig
106
107 # remove 49-sansserif.conf to fix bmc #9024
108 #rm -rf /usr/%{_sysconfdir}/fonts/conf.d/49-sansserif.conf
109
110 # Force regeneration of all fontconfig cache files
111 # The check for existance is needed on dual-arch installs (the second
112 #  copy of fontconfig might install the binary instead of the first)
113 # The HOME setting is to avoid problems if HOME hasn't been reset
114 if [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache --version 2>&1 | grep -q %{version} ; then
115 fc-cache -rf --system-only
116 fi
117
118 %postun -p /sbin/ldconfig
119
120 %files
121 %manifest fontconfig.manifest
122 %defattr(-,root,root,-)
123 %defattr(-, root, root)
124 %doc README AUTHORS COPYING
125 %{_libdir}/libfontconfig.so.*
126 %{_bindir}/fc-*
127 /usr/%{_sysconfdir}/fonts/*
128 %dir /usr/%{_sysconfdir}/fonts/conf.avail
129 %dir %{_datadir}/fonts
130 %doc /usr/%{_sysconfdir}/fonts/conf.d/README
131 %config /usr/%{_sysconfdir}/fonts/conf.avail/*.conf
132 %config(noreplace) /usr/%{_sysconfdir}/fonts/conf.d/*.conf
133 %dir /var/cache/fontconfig
134 /usr/share/license/%{name}
135
136 %files devel
137 %manifest fontconfig.manifest
138 %defattr(-,root,root,-)
139 %defattr(-, root, root)
140 %{_libdir}/libfontconfig.so
141 %{_libdir}/pkgconfig/*
142 %{_includedir}/fontconfig
143