e9296377a3d24e73eacc5cf8c6bcd74539441ddd
[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(libdrm)
13 BuildRequires:  pkgconfig(pthread-stubs)
14 %if %{with wayland}
15 BuildRequires:  pkgconfig
16 BuildRequires:  pkgconfig(wayland-client)
17 %else
18 BuildRequires:  pkgconfig(x11)
19 BuildRequires:  pkgconfig(libdri2)
20 %endif
21 BuildRequires:  pkgconfig(capi-base-common)
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 %prep
38 %setup -q
39
40 %build
41
42 %if %{with wayland}
43 %reconfigure --prefix=%{_prefix} --with-tbm-platform=WAYLAND \
44             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
45 %else
46 %reconfigure --prefix=%{_prefix} --with-tbm-platform=X11 \
47             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
48 %endif
49
50 make %{?_smp_mflags}
51
52 %install
53 rm -rf %{buildroot}
54 mkdir -p %{buildroot}/usr/share/license
55 cp -af COPYING %{buildroot}/usr/share/license/%{name}
56 %make_install
57
58
59 %clean
60 rm -rf %{buildroot}
61
62 %post -p /sbin/ldconfig
63 %postun -p /sbin/ldconfig
64
65
66 %files
67 %manifest libtbm.manifest
68 %defattr(-,root,root,-)
69 /usr/share/license/%{name}
70 %{_libdir}/libtbm.so.*
71 %ifarch x86_64
72 %else
73 %{_libdir}/libdrm_slp.so.*
74 %endif
75
76 %files devel
77 %defattr(-,root,root,-)
78 %dir %{_includedir}
79 %{_includedir}/tbm_bufmgr.h
80 %{_includedir}/tbm_surface.h
81 %{_includedir}/tbm_surface_internal.h
82 %{_includedir}/tbm_bufmgr_backend.h
83 %{_includedir}/tbm_type.h
84 %{_libdir}/libtbm.so
85 %ifarch x86_64
86 %else
87 %{_libdir}/libdrm_slp.so
88 %endif
89 %{_libdir}/pkgconfig/libtbm.pc