put gtest framework source code
[platform/core/uifw/libtbm.git] / packaging / libtbm.spec
1 %bcond_with x
2 %bcond_with wayland
3 %bcond_with utest
4
5 Name:           libtbm
6 Version:        2.0.3
7 Release:        1
8 License:        MIT
9 Summary:        The library for Tizen Buffer Manager
10 Group:          System/Libraries
11 Source0:        %{name}-%{version}.tar.gz
12 Source1001:             %name.manifest
13
14 BuildRequires:  pkgconfig(libdrm)
15 BuildRequires:  pkgconfig(wayland-server)
16 BuildRequires:  pkgconfig(wayland-client)
17 BuildRequires:  pkgconfig(capi-base-common)
18 BuildRequires:  pkgconfig(libpng)
19 BuildRequires:  pkgconfig(dlog)
20
21 %description
22 Description: %{summary}
23
24 %package devel
25 Summary:        Tizen Buffer Manager Library - Development
26 Group:          Development/Libraries
27 Requires:       libtbm = %{version}
28 Requires:       pkgconfig(capi-base-common)
29
30 %description devel
31 The library for Tizen Buffer Manager.
32
33 Development Files.
34
35 %if %{with utest}
36 %package utests
37 Summary: Tizen Buffer Manager unit tests package
38 Group: System/Libraries
39
40 %description utests
41 Test module for testing libtbm APIs
42 %endif
43
44 %global TZ_SYS_RO_SHARE  %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
45
46 %prep
47 %setup -q
48 cp %{SOURCE1001} .
49
50 %build
51 UTEST="no"
52
53 %if %{with utest}
54 cd ut/gtest/googletest
55 autoreconf --install
56 ./configure
57 make
58 cd ../../..
59 UTEST="yes"
60 %endif
61
62 %if %{with wayland}
63 %reconfigure --prefix=%{_prefix} --with-tbm-platform=WAYLAND  --with-utest=${UTEST} \
64             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
65 %else
66 %reconfigure --prefix=%{_prefix} --with-tbm-platform=X11  --with-utest=${UTEST} \
67             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
68 %endif
69
70 make %{?_smp_mflags}
71
72 %install
73 rm -rf %{buildroot}
74 mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/license
75 cp -af COPYING %{buildroot}/%{TZ_SYS_RO_SHARE}/license/%{name}
76 %if %{with utest}
77 cp -af %{_builddir}/%{buildsubdir}/ut/gtest/googletest/LICENSE %{buildroot}/%{TZ_SYS_RO_SHARE}/license/googletest
78 %endif
79 %make_install
80
81
82 %__mkdir_p %{buildroot}%{_unitdir}
83 install -m 644 service/tbm-drm-auth.service %{buildroot}%{_unitdir}
84 install -m 644 service/tbm-drm-auth.path %{buildroot}%{_unitdir}
85 %__mkdir_p %{buildroot}%{_unitdir_user}
86 install -m 644 service/tbm-drm-auth-user.service %{buildroot}%{_unitdir_user}
87 install -m 644 service/tbm-drm-auth-user.path %{buildroot}%{_unitdir_user}
88
89 %clean
90 rm -rf %{buildroot}
91
92 %pre
93 %__mkdir_p %{_unitdir}/graphical.target.wants
94 ln -sf ../tbm-drm-auth.path %{_unitdir}/graphical.target.wants/
95
96 %if "%{?profile}" == "mobile" || "%{?profile}" == "wearable"
97 %__mkdir_p %{_unitdir_user}/basic.target.wants
98 ln -sf ../tbm-drm-auth-user.path %{_unitdir_user}/basic.target.wants/
99 %else
100 %__mkdir_p %{_unitdir_user}/default.target.wants
101 ln -sf ../tbm-drm-auth-user.path %{_unitdir_user}/default.target.wants/
102 %endif
103
104 %post -p /sbin/ldconfig
105 %postun -p /sbin/ldconfig
106 rm -f %{_unitdir}/graphical.target.wants/tbm-drm-auth.path
107
108 %if "%{?profile}" == "mobile" || "%{?profile}" == "wearable"
109 rm -f %{_unitdir_user}/basic.target.wants/tbm-drm-auth-user.path
110 %else
111 rm -f %{_unitdir_user}/default.target.wants/tbm-drm-auth-user.path
112 %endif
113
114 %files
115 %manifest %{name}.manifest
116 %defattr(-,root,root,-)
117 %{TZ_SYS_RO_SHARE}/license/%{name}
118 %{_libdir}/libtbm.so.*
119 %{_unitdir}/tbm-drm-auth.path
120 %{_unitdir}/tbm-drm-auth.service
121 %{_unitdir_user}/tbm-drm-auth-user.path
122 %{_unitdir_user}/tbm-drm-auth-user.service
123
124 %files devel
125 %manifest %{name}.manifest
126 %defattr(-,root,root,-)
127 %dir %{_includedir}
128 %{_includedir}/tbm_bufmgr.h
129 %{_includedir}/tbm_surface.h
130 %{_includedir}/tbm_surface_internal.h
131 %{_includedir}/tbm_surface_queue.h
132 %{_includedir}/tbm_bufmgr_backend.h
133 %{_includedir}/tbm_type.h
134 %{_includedir}/tbm_drm_helper.h
135 %{_includedir}/tbm_sync.h
136 %{_libdir}/libtbm.so
137 %{_libdir}/pkgconfig/libtbm.pc
138
139 %if %{with utest}
140 %files utests
141 %defattr(-,root,root,-)
142 %{_bindir}/tbm_utests
143 %{TZ_SYS_RO_SHARE}/license/%{name}
144 %{TZ_SYS_RO_SHARE}/license/googletest
145 %endif