Package version up to 1.5.19
[platform/core/uifw/libtpl-egl.git] / packaging / libtpl-egl.spec
1 %bcond_with utest
2 %bcond_with utest_gcov
3
4 #TPL VERSION MACROS
5 %define TPL_VERSION_MAJOR       1
6 %define TPL_VERSION_MINOR       5
7 %define TPL_VERSION_PATCH       19
8 %define TPL_VERSION                     %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH}
9
10 #TPL WINDOW SYSTEM DEFINITION
11 %define TPL_WINSYS      WL
12
13 #TPL FEATURE OPTION
14 %define ENABLE_TTRACE                           0
15 %define ENABLE_DLOG                                     1
16 %define ENABLE_DEFAULT_LOG                      0
17 %define ENABLE_DEFAULT_DUMP                     0
18 %define ENABLE_OBJECT_HASH_CHECK        1
19 %define ENABLE_WORKER_TEST_ONLY         0
20 %define ENABLE_DEFAULT_WL_THREAD        0
21
22 #TPL INSTALL OPTION
23 %define ENABLE_TPL_TEST                 0
24 %define ENABLE_TPL_TEST_GCOV    0
25
26 #WAYLAND-EGL VERSION MACROS
27 %define WL_EGL_VERSION_MAJOR    1
28 %define WL_EGL_VERSION_MINOR    2
29 %define WL_EGL_VERSION_PATCH    4
30 %define WL_EGL_VERSION                  %{WL_EGL_VERSION_MAJOR}.%{WL_EGL_VERSION_MINOR}.%{WL_EGL_VERSION_PATCH}
31
32 #WAYLAND-EGL-TIZEN VERSION MACROS
33 %define WL_EGL_TIZEN_VERSION_MAJOR      1
34 %define WL_EGL_TIZEN_VERSION_MINOR      0
35 %define WL_EGL_TIZEN_VERSION_PATCH      0
36 %define WL_EGL_TIZEN_VERSION            %{WL_EGL_TIZEN_VERSION_MAJOR}.%{WL_EGL_TIZEN_VERSION_MINOR}.%{WL_EGL_TIZEN_VERSION_PATCH}
37
38 #TPL WINDOW SYSTEM CHECK
39 %if "%{TPL_WINSYS}" != "DRI2" && "%{TPL_WINSYS}" != "DRI3" && "%{TPL_WINSYS}" != "WL"
40 BuildRequires:          ERROR(No_window_system_designated)
41 %endif
42
43 Name:           libtpl-egl
44 Version:        %{TPL_VERSION}
45 Release:        0
46 %if "%{TPL_WINSYS}" == "DRI2"
47 Summary:        Tizen Porting Layer for EGL (DRI2 backend)
48 %endif
49 %if "%{TPL_WINSYS}" == "DRI3"
50 Summary:        Tizen Porting Layer for EGL (DRI3 backend)
51 %endif
52 %if "%{TPL_WINSYS}" == "WL"
53 Summary:        Tizen Porting Layer for EGL (Wayland backend)
54 %endif
55 Group: Graphics & UI Framework/GL
56 License:        MIT
57 Source:         %{name}-%{version}.tar.gz
58
59 BuildRequires:  cmake
60 BuildRequires:  pkg-config
61 BuildRequires:  pkgconfig(libtbm)
62 BuildRequires:  pkgconfig(dlog)
63
64 %if "%{TPL_WINSYS}" == "DRI2" || "%{TPL_WINSYS}" == "DRI3"
65 BuildRequires:  pkgconfig(libdri2)
66 BuildRequires:  pkgconfig(xext)
67 BuildRequires:  pkgconfig(xfixes)
68 BuildRequires:  pkgconfig(x11)
69 BuildRequires:  pkgconfig(x11-xcb)
70 BuildRequires:  pkgconfig(xcb)
71 BuildRequires:  pkgconfig(xcb-dri3)
72 BuildRequires:  pkgconfig(xcb-sync)
73 BuildRequires:  pkgconfig(xcb-present)
74 BuildRequires:  pkgconfig(xshmfence)
75 BuildRequires:  pkgconfig(libdrm)
76 %endif
77
78 %if "%{TPL_WINSYS}" == "WL"
79 BuildRequires:  libtool
80 BuildRequires:  wayland-devel
81 BuildRequires:  pkgconfig(gbm)
82 BuildRequires:  pkgconfig(libtdm-client)
83 BuildRequires:  pkgconfig(wayland-tbm-client)
84 BuildRequires:  pkgconfig(wayland-tbm-server)
85 BuildRequires:  pkgconfig(tizen-surface-client)
86 BuildRequires:  pkgconfig(glib-2.0)
87 %endif
88
89 %if "%{ENABLE_TTRACE}" == "1"
90 BuildRequires: pkgconfig(ttrace)
91 %endif
92
93 %global TZ_SYS_RO_SHARE  %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
94
95 %description
96 Tizen Porting Layer (a.k.a TPL) is a linkage between the underlying window
97 system and the EGL porting layer.
98
99 The following window systems are supported:
100 - X11 DRI2/DRI3
101 - Wayland
102
103 %package devel
104 Summary:        Development files for TPL
105 Group:          System/Libraries
106 Requires:       %{name} = %{version}-%{release}
107 %if "%{TPL_WINSYS}" == "WL"
108 Requires:   libwayland-egl-devel
109 %endif
110
111 %description devel
112 This package contains the development libraries and header files needed by
113 the GPU Vendor DDK's EGL.
114
115 %if "%{TPL_WINSYS}" == "WL"
116 %package -n libwayland-egl
117 Version:        %{WL_EGL_VERSION}
118 Release:        0
119 Summary:    Wayland EGL backend
120
121 %description -n libwayland-egl
122 Wayland EGL backend
123
124 %package -n libwayland-egl-devel
125 Version:        %{WL_EGL_VERSION}
126 Release:        0
127 Summary:    Development header files for use with Wayland protocol
128 Requires:       libwayland-egl
129
130 %description -n libwayland-egl-devel
131 Development header files for use with Wayland protocol
132
133 %package -n libwayland-egl-tizen
134 Version:        %{WL_EGL_TIZEN_VERSION}
135 Release:        0
136 Summary:    Wayland EGL TIZEN backend
137
138 %description -n libwayland-egl-tizen
139 This package provides tizen specific extension fo wayland-egl.
140
141 %package -n libwayland-egl-tizen-devel
142 Version:        %{WL_EGL_TIZEN_VERSION}
143 Release:        0
144 Summary:    Development header files for wayland-egl tizen extensions.
145 Requires:       libwayland-egl libwayland-egl-tizen
146
147 %description -n libwayland-egl-tizen-devel
148 Development header files for wayland-egl tizen extensions.
149 %endif
150
151 %if %{with utest} || "%{ENABLE_TPL_TEST}" == "1"
152 %package    utest
153 Summary:    Unit test module of libtpl-egl
154 BuildRequires:  gtest-devel
155
156 %description utest
157 Unit test module of libtpl-egl (previously known as tpl-test)
158 %endif
159
160 %prep
161 %setup -q
162
163 %build
164 export TPL_VERSION_MAJOR=%{TPL_VERSION_MAJOR}
165 export TPL_VERSION_MINOR=%{TPL_VERSION_MINOR}
166 export TPL_VERSION_PATCH=%{TPL_VERSION_PATCH}
167
168 export WL_EGL_VERSION_MAJOR=%{WL_EGL_VERSION_MAJOR}
169 export WL_EGL_VERSION_MINOR=%{WL_EGL_VERSION_MINOR}
170 export WL_EGL_VERSION_PATCH=%{WL_EGL_VERSION_PATCH}
171
172 export WL_EGL_TIZEN_VERSION_MAJOR=%{WL_EGL_TIZEN_VERSION_MAJOR}
173 export WL_EGL_TIZEN_VERSION_MINOR=%{WL_EGL_TIZEN_VERSION_MINOR}
174 export WL_EGL_TIZEN_VERSION_PATCH=%{WL_EGL_TIZEN_VERSION_PATCH}
175
176 %reconfigure    \
177 %ifarch aarch64
178         --with-arch=aarch64     \
179 %endif
180 %if "%{TPL_WINSYS}" == "WL"
181         --with-wayland=yes      \
182         --enable-wayland-thread=%{ENABLE_DEFAULT_WL_THREAD}     \
183 %endif
184 %if %{with utest} || "%{ENABLE_TPL_TEST}" == "1"
185         --with-utest=yes        \
186 %if %{with utest_gcov} || "%{ENABLE_TPL_TEST_GCOV}" == "1"
187         --enable-gcov=yes       \
188 %endif
189 %endif
190         --enable-dlog=%{ENABLE_DLOG}                                                    \
191         --enable-dlog-default=%{ENABLE_DEFAULT_LOG}                             \
192         --enable-dump=%{ENABLE_DEFAULT_DUMP}                                    \
193         --enable-object-hash-check=%{ENABLE_OBJECT_HASH_CHECK}  \
194         --enable-ttrace=%{ENABLE_TTRACE}
195
196 make %{?_smp_mflags}
197
198 %install
199 rm -fr %{buildroot}
200 %make_install
201
202 %clean
203 rm -rf %{buildroot}
204
205 %post -p /sbin/ldconfig
206 %postun -p /sbin/ldconfig
207
208 %if "%{TPL_WINSYS}" == "WL"
209 %post   -n libwayland-egl -p /sbin/ldconfig
210 %postun -n libwayland-egl -p /sbin/ldconfig
211 %post   -n libwayland-egl-tizen -p /sbin/ldconfig
212 %postun -n libwayland-egl-tizen -p /sbin/ldconfig
213 %endif
214
215 %files
216 %manifest packaging/libtpl-egl.manifest
217 %license COPYING
218 %defattr(-,root,root,-)
219 %{_libdir}/libtpl-egl.so.%{TPL_VERSION_MAJOR}
220 %{_libdir}/libtpl-egl.so.%{TPL_VERSION}
221
222 %files devel
223 %defattr(-,root,root,-)
224 %{_includedir}/tpl.h
225 %{_libdir}/pkgconfig/tpl-egl.pc
226 %{_libdir}/libtpl-egl.so
227
228 %if "%{TPL_WINSYS}" == "WL"
229 %files -n libwayland-egl
230 %manifest packaging/libwayland-egl.manifest
231 %license COPYING
232 %defattr(-,root,root,-)
233 %{_libdir}/libwayland-egl.so*
234
235 %files -n libwayland-egl-devel
236 %defattr(-,root,root,-)
237 %{_includedir}/wayland-egl-tizen.h
238 %{_libdir}/libwayland-egl.so
239 %{_libdir}/pkgconfig/wayland-egl.pc
240
241 %files -n libwayland-egl-tizen
242 %manifest packaging/libwayland-egl-tizen.manifest
243 %license COPYING
244 %defattr(-,root,root,-)
245 %{_libdir}/libwayland-egl-tizen.so*
246
247 %files -n libwayland-egl-tizen-devel
248 %defattr(-,root,root,-)
249 %{_includedir}/wayland-egl-tizen.h
250 %{_libdir}/libwayland-egl-tizen.so
251 %{_libdir}/pkgconfig/wayland-egl-tizen.pc
252 %endif
253
254 %if %{with utest} || "%{ENABLE_TPL_TEST}" == "1"
255 %files utest
256 %defattr(-,root,root,-)
257 %{_bindir}/tpl-test
258 %endif