build require which
[platform/upstream/cairo.git] / packaging / cairo.spec
1 %define build_xcb_backend 0
2 %define build_gl_backend 1
3 %define enable_wayland 1
4
5 Name:           cairo
6 Version:        1.12.4
7 Release:        0
8 License:        LGPL-2.1+ or MPL-1.1
9 Summary:        Vector Graphics Library with Cross-Device Output Support
10 Url:            http://cairographics.org/
11 Group:          System/Libraries
12 Source:         http://cairographics.org/releases/%{name}-%{version}.tar.xz
13 Source99:       baselibs.conf
14 BuildRequires:  gtk-doc
15 BuildRequires:  libtool
16 BuildRequires:  pkg-config
17 BuildRequires:  xz
18 BuildRequires:  pkgconfig(fontconfig)
19 BuildRequires:  pkgconfig(freetype2)
20 BuildRequires:  pkgconfig(gobject-2.0)
21 BuildRequires:  pkgconfig(libpng)
22 BuildRequires:  pkgconfig(pixman-1)
23 BuildRequires:  pkgconfig(x11)
24 BuildRequires:  which
25 %if %build_xcb_backend
26 BuildRequires:  pkgconfig(xcb)
27 BuildRequires:  pkgconfig(xcb-shm)
28 %endif
29 %if %build_gl_backend
30 BuildRequires:  mesa-devel
31 %if enable_wayland
32 BuildRequires:  pkgconfig(wayland-egl)
33 %endif
34 %endif
35 BuildRequires:  pkgconfig(xrender)
36 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
37
38 %description
39 Cairo is a vector graphics library with cross-device output support.
40 Currently supported output targets include the X Window System,
41 in-memory image buffers, and PostScript. Cairo is designed to produce
42 identical output on all output media while taking advantage of display
43 hardware acceleration when available.
44
45 %package -n libcairo
46 License:        LGPL-2.1+ or MPL-1.1
47 Summary:        Vector Graphics Library with Cross-Device Output Support
48 Group:          System/Libraries
49 Provides:       cairo = %{version}
50 Obsoletes:      cairo < %{version}
51
52 %description -n libcairo
53 Cairo is a vector graphics library with cross-device output support.
54 Currently supported output targets include the X Window System,
55 in-memory image buffers, and PostScript. Cairo is designed to produce
56 identical output on all output media while taking advantage of display
57 hardware acceleration when available.
58
59 %package -n libcairo-gobject
60 License:        LGPL-2.1+ or MPL-1.1
61 Summary:        Vector Graphics Library with Cross-Device Output Support
62 Group:          System/Libraries
63
64 %description -n libcairo-gobject
65 Cairo is a vector graphics library with cross-device output support.
66 Currently supported output targets include the X Window System,
67 in-memory image buffers, and PostScript. Cairo is designed to produce
68 identical output on all output media while taking advantage of display
69 hardware acceleration when available.
70
71 This library contains GType declarations for Cairo types. It is also
72 meant to support gobject-introspection binding creation.
73
74 %package -n libcairo-script-interpreter
75 License:        LGPL-2.1+ or MPL-1.1
76 Summary:        Vector Graphics Library with Cross-Device Output Support
77 Group:          System/Libraries
78
79 %description -n libcairo-script-interpreter
80 Cairo is a vector graphics library with cross-device output support.
81 Currently supported output targets include the X Window System,
82 in-memory image buffers, and PostScript. Cairo is designed to produce
83 identical output on all output media while taking advantage of display
84 hardware acceleration when available.
85
86 %package tools
87 License:        GPL-3.0+
88 Summary:        Vector Graphics Library with Cross-Device Output Support -- Utilities
89 Group:          Development/Libraries/X11
90 # We need an explicit requires since nothing links to the cairo library
91 Requires:       libcairo = %{version}
92
93 %description tools
94 Cairo is a vector graphics library with cross-device output support.
95 Currently supported output targets include the X Window System,
96 in-memory image buffers, and PostScript. Cairo is designed to produce
97 identical output on all output media while taking advantage of display
98 hardware acceleration when available.
99
100 This package contains various cairo utilities.
101
102 %package devel
103 License:        LGPL-2.1+ or MPL-1.1
104 Summary:        Development environment for cairo
105 Group:          Development/Libraries/X11
106 Requires:       libcairo = %{version}
107 Requires:       libcairo-gobject = %{version}
108 Requires:       libcairo-script-interpreter = %{version}
109
110 %description devel
111 This package contains all files necessary to build binaries using
112 cairo.
113
114 %prep
115 %setup -q
116
117 %build
118 # Needed by patch0
119 NOCONFIGURE=1 ./autogen.sh
120 %configure \
121     --with-pic \
122     --enable-fc \
123     --enable-ft \
124 %if %build_gl_backend
125     --enable-gl --enable-egl \
126 %endif
127     --enable-ps \
128     --enable-pdf \
129     --enable-script \
130     --enable-svg \
131     --enable-tee \
132 %if %build_xcb_backend
133     --enable-xcb \
134 %endif
135     --enable-xlib \
136     --disable-gtk-doc \
137     --disable-static
138 make %{?_smp_mflags} V=1
139
140 %install
141 %make_install
142
143 %post -n libcairo -p /sbin/ldconfig
144
145 %postun -n libcairo -p /sbin/ldconfig
146
147 %post -n libcairo-gobject -p /sbin/ldconfig
148
149 %postun -n libcairo-gobject -p /sbin/ldconfig
150
151 %post -n libcairo-script-interpreter -p /sbin/ldconfig
152
153 %postun -n libcairo-script-interpreter -p /sbin/ldconfig
154
155 %files -n libcairo
156 %defattr(-, root, root)
157 %doc COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
158 %{_libdir}/libcairo.so.*
159
160 %files -n libcairo-gobject
161 %defattr(-, root, root)
162 %{_libdir}/libcairo-gobject.so.2*
163
164 %files -n libcairo-script-interpreter
165 %defattr(-, root, root)
166 %doc util/cairo-script/COPYING
167 %{_libdir}/libcairo-script-interpreter.so.*
168
169 %files tools
170 %defattr(-, root, root)
171 %doc util/cairo-trace/COPYING util/cairo-trace/COPYING-GPL-3
172 %{_bindir}/cairo-sphinx
173 %{_bindir}/cairo-trace
174 %dir %{_libdir}/cairo
175 %{_libdir}/cairo/cairo-fdr.so
176 %{_libdir}/cairo/cairo-sphinx.so
177 %{_libdir}/cairo/libcairo-trace.so
178
179 %files devel
180 %defattr(-, root, root)
181 %doc PORTING_GUIDE
182 %doc %{_datadir}/gtk-doc/html/cairo
183 %{_includedir}/cairo/
184 %{_libdir}/*.so
185 %{_libdir}/pkgconfig/*.pc
186
187 %changelog