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