add the build configuration to distinguish between x11 and wayland
[platform/core/uifw/libtbm.git] / packaging / libtbm.spec
1 #%bcond_with x
2 %bcond_with wayland
3
4 Name:           libtbm
5 Version:        1.1.0
6 Release:        3
7 License:        MIT
8 Summary:        The library for Tizen Buffer Manager
9 Group:          System/Libraries
10 Source0:        %{name}-%{version}.tar.gz
11
12 BuildRequires:  pkgconfig(pthread-stubs)
13 BuildRequires:  pkgconfig(libdrm)
14 %if %{with wayland}
15 %else
16 BuildRequires:  pkgconfig(x11)
17 BuildRequires:  pkgconfig(libdri2)
18 %endif
19 BuildRequires:  pkgconfig(capi-base-common)
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 %prep
36 %setup -q
37
38 %build
39
40 %if %{with wayland}
41 %reconfigure --prefix=%{_prefix} --with-tbm-platform=WAYLAND \
42             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
43 %else
44 %reconfigure --prefix=%{_prefix} --with-tbm-platform=X11 \
45             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
46 %endif
47
48 make %{?_smp_mflags}
49
50 %install
51 rm -rf %{buildroot}
52 mkdir -p %{buildroot}/usr/share/license
53 cp -af COPYING %{buildroot}/usr/share/license/%{name}
54 %make_install
55
56
57 %clean
58 rm -rf %{buildroot}
59
60 %post -p /sbin/ldconfig
61 %postun -p /sbin/ldconfig
62
63
64 %files
65 %manifest libtbm.manifest
66 %defattr(-,root,root,-)
67 /usr/share/license/%{name}
68 %{_libdir}/libtbm.so.*
69 %if %{with wayland}
70 %else
71 %{_libdir}/libdrm_slp.so.*
72 %endif
73
74 %files devel
75 %defattr(-,root,root,-)
76 %dir %{_includedir}
77 %{_includedir}/tbm_bufmgr.h
78 %{_includedir}/tbm_surface.h
79 %{_includedir}/tbm_surface_internal.h
80 %{_includedir}/tbm_bufmgr_backend.h
81 %{_includedir}/tbm_type.h
82 %{_libdir}/libtbm.so
83 %if %{with wayland}
84 %else
85 %{_libdir}/libdrm_slp.so
86 %endif
87 %{_libdir}/pkgconfig/libtbm.pc
88