7882a99263cfd59d36ce040385e68660f2a54f87
[framework/graphics/fontconfig.git] / packaging / fontconfig.spec
1 #sbs-git:slp/pkgs/f/fontconfig fontconfig 2.6.0 70f07428c05d43eef8009f4dfbe28723b040e865
2 %global freetype_version 2.1.4
3
4 Name:       fontconfig
5 Summary:    Font configuration and customization library
6 Version:    2.9.0
7 Release:    2
8 Group:      System/Libraries
9 License:    MIT
10 URL:        http://fontconfig.org
11 Source0:    http://fontconfig.org/release/fontconfig-%{version}.tar.gz
12 Requires(pre): /usr/bin/fc-cache, /bin/mkdir /bin/rm, /bin/grep
13 Requires(post): /sbin/ldconfig
14 Requires(postun): /sbin/ldconfig
15 BuildRequires:  pkgconfig(freetype2) >= %{freetype_version}
16 BuildRequires:  gawk
17 BuildRequires:  expat-devel
18 BuildRequires:  perl
19
20 %description
21 Fontconfig is designed to locate fonts within the
22 system and select them according to requirements specified by
23 applications.
24
25 %package devel
26 Summary:    Font configuration and customization library
27 Group:      Development/Libraries
28 Requires:   %{name} = %{version}-%{release}
29 Requires:   fontconfig = %{version}-%{release}
30 Requires:   freetype-devel >= %{freetype_version}
31 Requires:   pkgconfig
32
33 %description devel
34 The fontconfig-devel package includes the header files,
35 and developer docs for the fontconfig package.
36
37 Install fontconfig-devel if you want to develop programs which
38 will use fontconfig.
39
40 %prep
41 %setup -q -n %{name}-%{version}
42
43 %build
44 # We don't want to rebuild the docs, but we want to install the included ones.
45 export HASDOCBOOK=no
46
47 %reconfigure --disable-static \
48     --with-expat=/usr \
49     --with-expat-include=%{_includedir} \
50     --with-expat-lib=%{_libdir} \
51     --with-freetype-config=%{_bindir}/freetype-config \
52     --with-add-fonts=/opt/share/fonts,/usr/share/app_fonts,/usr/share/fallback_fonts \
53     --with-cache-dir=/var/cache/fontconfig \
54     --with-confdir=/usr/etc/fonts \
55     --disable-docs
56
57 make %{?jobs:-j%jobs}
58
59 make check
60 %install
61 rm -rf %{buildroot}
62
63 %make_install
64
65 #install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
66 #install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.avail
67 #install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.avail
68 #ln -s ../conf.avail/25-unhint-nonlatin.conf $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
69 #ln -s ../conf.avail/10-autohint.conf $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
70 #ln -s ../conf.avail/10-antialias.conf $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
71 #ln -s ../conf.avail/10-hinted.conf $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
72
73 # move installed doc files back to build directory to package themm
74 # in the right place
75 #mv $RPM_BUILD_ROOT%{_docdir}/fontconfig/* .
76 #rmdir $RPM_BUILD_ROOT%{_docdir}/fontconfig/
77
78 # All font packages depend on this package, so we create
79 # and own /usr/share/fonts
80 mkdir -p $RPM_BUILD_ROOT%{_datadir}/fonts
81
82 # Remove unpackaged files. no need when configure --disable-static
83 #rm $RPM_BUILD_ROOT%{_libdir}/*.la
84 #rm $RPM_BUILD_ROOT%{_libdir}/*.a
85
86 %post
87 /sbin/ldconfig
88
89 umask 0022
90
91 mkdir -p /var/cache/fontconfig
92 # Remove stale caches
93 rm -f /var/cache/fontconfig/????????????????????????????????.cache-2
94 rm -f /var/cache/fontconfig/stamp
95
96 # remove 49-sansserif.conf to fix bmc #9024
97 #rm -rf /usr/%{_sysconfdir}/fonts/conf.d/49-sansserif.conf
98
99 # Force regeneration of all fontconfig cache files
100 # The check for existance is needed on dual-arch installs (the second
101 #  copy of fontconfig might install the binary instead of the first)
102 # The HOME setting is to avoid problems if HOME hasn't been reset
103 if [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache --version 2>&1 | grep -q %{version} ; then
104 HOME=/root /usr/bin/fc-cache -f
105 fi
106
107 %postun -p /sbin/ldconfig
108
109 %files
110 %defattr(-,root,root,-)
111 %defattr(-, root, root)
112 %doc README AUTHORS COPYING
113 %{_libdir}/libfontconfig.so.*
114 %{_bindir}/fc-*
115 /usr/%{_sysconfdir}/fonts/*
116 %dir /usr/%{_sysconfdir}/fonts/conf.avail
117 %dir %{_datadir}/fonts
118 %doc /usr/%{_sysconfdir}/fonts/conf.d/README
119 %config /usr/%{_sysconfdir}/fonts/conf.avail/*.conf
120 %config(noreplace) /usr/%{_sysconfdir}/fonts/conf.d/*.conf
121 %dir /var/cache/fontconfig
122
123 %files devel
124 %defattr(-,root,root,-)
125 %defattr(-, root, root)
126 %{_libdir}/libfontconfig.so
127 %{_libdir}/pkgconfig/*
128 %{_includedir}/fontconfig
129