Revert "Revert "put gtest framework source code""
[platform/core/uifw/libtdm.git] / packaging / libtdm.spec
1 %bcond_with utest
2
3 Name:           libtdm
4 Version:        1.8.2
5 Release:        0
6 Summary:        User Library of Tizen Display Manager
7 Group:          Development/Libraries
8 License:        MIT
9 Source0:        %{name}-%{version}.tar.gz
10 Source1001:         %{name}.manifest
11 BuildRequires:  pkgconfig(libtbm)
12 BuildRequires:  pkgconfig(libpng)
13 BuildRequires:  pkgconfig(ttrace)
14 BuildRequires:  pkgconfig(wayland-server)
15 BuildRequires:  pkgconfig(pixman-1)
16
17 %description
18 Common user library of Tizen Display Manager : libtdm front-end library
19
20 %package devel
21 Summary:        Devel of Tizen Display Manager Library
22 Group:          Development/Libraries
23 Requires:       libtdm = %{version}
24 Requires:       pkgconfig(libtbm)
25
26 %description devel
27 This supports frontend & backend library header and so
28
29 %package client
30 Summary:        Client library for Tizen Display Manager
31 Group:          Development/Libraries
32 Requires:       libtdm = %{version}
33
34 %description client
35 Tizen Display Manager Client Library
36
37 %package client-devel
38 Summary:        Client library for Tizen Display Manager
39 Group:          Development/Libraries
40 Requires:       libtdm-client = %{version}
41 Requires:       libtdm-devel
42
43 %description client-devel
44 Tizen Display Manager Client Library headers
45
46 %if %{with utest}
47 %package utests
48 Summary: Tizen Display Manager unit tests package
49 Group: Development/Libraries
50
51 %description utests
52 Test module for testing libtdm APIs
53 %endif
54
55 %global TZ_SYS_RO_SHARE  %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
56
57 %package tools
58 Summary:        Tools for libtdm
59 Group:          Development/Utilities
60 Requires:       libtdm = %{version}
61
62 %description tools
63 This contains libtdm tools for fundamental testing
64
65 %prep
66 %setup -q
67 cp %{SOURCE1001} .
68
69 %build
70 UTEST="no"
71
72 %if %{with utest}
73 cd ut/gtest/googletest
74 autoreconf --install
75 ./configure
76 make
77 cd ../../..
78 UTEST="yes"
79 %endif
80
81 %reconfigure --disable-static --with-utest=${UTEST} \
82              CFLAGS="${CFLAGS} -Wall -Werror" \
83              LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
84 make %{?_smp_mflags}
85
86 %install
87 rm -rf %{buildroot}
88 %make_install
89
90 %__mkdir_p %{buildroot}%{_unitdir_user}
91 install -m 644 service/tdm-socket-user.service %{buildroot}%{_unitdir_user}
92 install -m 644 service/tdm-socket-user.path %{buildroot}%{_unitdir_user}
93
94 %remove_docs
95
96
97 %pre
98 %__mkdir_p %{_unitdir_user}/basic.target.wants
99 ln -sf ../tdm-socket-user.path %{_unitdir_user}/basic.target.wants/
100
101 %post -p /sbin/ldconfig
102 %postun -p /sbin/ldconfig
103 rm -f %{_unitdir_user}/basic.target.wants/tdm-socket-user.path
104
105 %files
106 %manifest %{name}.manifest
107 %defattr(-,root,root,-)
108 %license COPYING
109 %{_libdir}/libtdm.so.*
110 %{_libdir}/tdm/libtdm-dummy.so
111 %attr(750,root,root) %{_bindir}/tdm-monitor
112 %{_unitdir_user}/tdm-socket-user.path
113 %{_unitdir_user}/tdm-socket-user.service
114
115 %files devel
116 %manifest %{name}.manifest
117 %defattr(-,root,root,-)
118 %{_includedir}/tdm.h
119 %{_includedir}/tdm_common.h
120 %{_includedir}/tdm_backend.h
121 %{_includedir}/tdm_helper.h
122 %{_includedir}/tdm_list.h
123 %{_includedir}/tdm_log.h
124 %{_includedir}/tdm_types.h
125 %{_libdir}/pkgconfig/libtdm.pc
126 %{_libdir}/libtdm.so
127
128 %files client
129 %manifest %{name}.manifest
130 %defattr(-,root,root,-)
131 %license COPYING
132 %{_libdir}/libtdm-client.so.*
133
134 %files client-devel
135 %manifest %{name}.manifest
136 %defattr(-,root,root,-)
137 %{_includedir}/tdm_client.h
138 %{_includedir}/tdm_client_types.h
139 %{_libdir}/pkgconfig/libtdm-client.pc
140 %{_libdir}/libtdm-client.so
141
142 %files tools
143 %manifest %{name}.manifest
144 %attr(750,root,root) %{_bindir}/tdm-test-server
145 %{_bindir}/tdm-test-client
146
147 %if %{with utest}
148 %files utests
149 %defattr(-,root,root,-)
150 %{_bindir}/tdm_utests
151 %{TZ_SYS_RO_SHARE}/license/%{name}
152 %{TZ_SYS_RO_SHARE}/license/googletest
153 %endif
154
155 %changelog