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