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