9ca1257c3d588e849a2511bf02d27040614b9ed2
[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.15.1
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 %{_includedir}/tdm_deprecated.h
133 %{_libdir}/pkgconfig/libtdm.pc
134 %{_libdir}/libtdm.so
135
136 %files client
137 %manifest %{name}.manifest
138 %defattr(-,root,root,-)
139 %license COPYING
140 %{_libdir}/libtdm-client.so.*
141
142 %files client-devel
143 %manifest %{name}.manifest
144 %defattr(-,root,root,-)
145 %{_includedir}/tdm_client.h
146 %{_includedir}/tdm_client_types.h
147 %{_libdir}/pkgconfig/libtdm-client.pc
148 %{_libdir}/libtdm-client.so
149
150 %files tools
151 %manifest %{name}.manifest
152 %attr(750,root,root) %{_bindir}/tdm-test-server
153 %{_bindir}/tdm-test-client
154
155 %if "%{UTEST_PACKAGE}" == "1"
156 %files utests
157 %defattr(-,root,root,-)
158 %{_bindir}/tdm-utests
159 %endif
160
161 %changelog