b7b69677bd02399ed0d163ad804759c07b9653eb
[platform/adaptation/spreadtrum/libtbm-sprd.git] / packaging / libtbm-sprd.spec
1 Name:           libtbm-sprd
2 Version:        3.0.0
3 Release:        0
4 License:        MIT
5 Summary:        Tizen Buffer Manager - sprd backend
6 Group:          System/Libraries
7 ExcludeArch:    %{ix86} x86_64 aarch64
8 Source0:        %{name}-%{version}.tar.gz
9 Source1001:     %{name}.manifest
10 Source1002:     libhal-backend-tbm-sprd.manifest
11
12 BuildRequires:  pkgconfig(libdrm)
13 BuildRequires:  pkgconfig(libtbm)
14 BuildRequires:  pkgconfig(hal-api-common)
15 BuildRequires:  pkgconfig(hal-api-tbm)
16 BuildRequires:  pkgconfig(dlog)
17 BuildRequires:  pkgconfig(libudev)
18 BuildRequires:  kernel-headers-3.10-sc7730
19 BuildConflicts: linux-glibc-devel
20
21 %description
22 descriptionion:Tizen Buffer manager backend module for spreadtrum
23
24 %package -n hal-backend-tbm-sprd
25 Summary:        hal-backend-tbm module for spreadtrum
26 Group:          System/Libraries
27 Requires:       hal-api-tbm
28 Requires:       hal-api-common
29
30 %description -n hal-backend-tbm-sprd
31 descriptionion: hal tbm backend module for sprd
32
33 %prep
34 %setup -q
35 cp %{SOURCE1001} .
36 cp %{SOURCE1002} .
37
38 %build
39
40 %reconfigure --prefix=%{_prefix} --libdir=%{_libdir}/bufmgr \
41             --with-hal-libdir=%{_hal_libdir} \
42             CFLAGS="${CFLAGS} -Wall -Werror `pkg-config --cflags dlog`" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
43
44 make %{?_smp_mflags}
45
46 %install
47 rm -rf %{buildroot}
48
49 # make rule for tgl
50 mkdir -p %{buildroot}%{_libdir}/udev/rules.d/
51 cp -af rules/99-libtbm_sprd.rules %{buildroot}%{_libdir}/udev/rules.d/
52 cp -af rules/99-libhal-backend-tbm-sprd.rules %{buildroot}%{_libdir}/udev/rules.d/
53
54 %make_install
55
56 %post
57 if [ -f %{_libdir}/bufmgr/libtbm_default.so ]; then
58     rm -rf %{_libdir}/bufmgr/libtbm_default.so
59 fi
60 ln -s libtbm_sprd.so %{_libdir}/bufmgr/libtbm_default.so
61
62 if [ -f %{_hal_libdir}/libhal-backend-tbm.so ]; then
63     rm -rf %{_hal_libdir}/libhal-backend-tbm.so
64 fi
65 ln -s libhal-backend-tbm-sprd.so %{_hal_libdir}/libhal-backend-tbm.so
66
67 %postun -p /sbin/ldconfig
68
69 %files
70 %manifest %{name}.manifest
71 %license COPYING
72 %{_libdir}/bufmgr/libtbm_*.so*
73 %{_libdir}/udev/rules.d/99-libtbm_sprd.rules
74
75 %files -n hal-backend-tbm-sprd
76 %manifest libhal-backend-tbm-sprd.manifest
77 %license COPYING
78 %{_hal_libdir}/libhal-backend-*.so*
79 %{_libdir}/udev/rules.d/99-libhal-backend-tbm-sprd.rules