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