Package version up to 2.2.0
[platform/core/uifw/libtbm.git] / packaging / libtbm.spec
1 %bcond_with x
2 %bcond_with wayland
3 %define UTEST_PACKAGE 1
4
5 Name:           libtbm
6 Version:        2.2.0
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 BuildRequires:  pkgconfig(pixman-1)
21 BuildRequires:  gtest-devel 
22
23 %description
24 Description: %{summary}
25
26 %package devel
27 Summary:        Tizen Buffer Manager Library - Development
28 Group:          Development/Libraries
29 Requires:       libtbm = %{version}
30 Requires:       pkgconfig(capi-base-common)
31
32 %description devel
33 The library for Tizen Buffer Manager.
34
35 Development Files.
36
37 %if "%{UTEST_PACKAGE}" == "1"
38 %package utests
39 Summary: Tizen Buffer Manager unit tests package
40 Group: System/Libraries
41
42 %description utests
43 Test module for testing libtbm APIs
44 %endif
45
46 %global TZ_SYS_RO_SHARE  %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
47
48 %prep
49 %setup -q
50 cp %{SOURCE1001} .
51
52 %build
53 UTEST="no"
54
55 %if "%{UTEST_PACKAGE}" == "1"
56 UTEST="yes"
57 %endif
58
59 %if %{with wayland}
60 %reconfigure --prefix=%{_prefix} --with-tbm-platform=WAYLAND  --with-utests=${UTEST} \
61             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
62 %else
63 %reconfigure --prefix=%{_prefix} --with-tbm-platform=X11  --with-utests=${UTEST} \
64             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
65 %endif
66
67 make %{?_smp_mflags}
68
69 %install
70 rm -rf %{buildroot}
71 %make_install
72
73 %__mkdir_p %{buildroot}%{_unitdir_user}
74 install -m 644 service/tbm-drm-auth-user.service %{buildroot}%{_unitdir_user}
75 install -m 644 service/tbm-drm-auth-user.path %{buildroot}%{_unitdir_user}
76
77 %clean
78 rm -rf %{buildroot}
79
80 %pre
81 %__mkdir_p %{_unitdir_user}/basic.target.wants
82 ln -sf ../tbm-drm-auth-user.path %{_unitdir_user}/basic.target.wants/
83
84 %post -p /sbin/ldconfig
85 %postun -p /sbin/ldconfig
86 rm -f %{_unitdir_user}/basic.target.wants/tbm-drm-auth-user.path
87
88 %files
89 %manifest %{name}.manifest
90 %defattr(-,root,root,-)
91 %license COPYING
92 %{_libdir}/libtbm.so.*
93 %{_unitdir_user}/tbm-drm-auth-user.path
94 %{_unitdir_user}/tbm-drm-auth-user.service
95
96 %files devel
97 %manifest %{name}.manifest
98 %defattr(-,root,root,-)
99 %dir %{_includedir}
100 %{_includedir}/tbm_bufmgr.h
101 %{_includedir}/tbm_surface.h
102 %{_includedir}/tbm_surface_internal.h
103 %{_includedir}/tbm_surface_queue.h
104 %{_includedir}/tbm_bufmgr_backend.h
105 %{_includedir}/tbm_type.h
106 %{_includedir}/tbm_drm_helper.h
107 %{_includedir}/tbm_sync.h
108 %{_libdir}/libtbm.so
109 %{_libdir}/pkgconfig/libtbm.pc
110
111 %if "%{UTEST_PACKAGE}" == "1"
112 %files utests
113 %defattr(-,root,root,-)
114 %{_bindir}/tbm-utests
115 %endif