7bf0a3e46c5084b0b9d5d25a0305e8d324e0d621
[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.8.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 %remove_docs
102
103
104 %pre
105 %__mkdir_p %{_unitdir_user}/basic.target.wants
106 ln -sf ../tdm-socket-user.path %{_unitdir_user}/basic.target.wants/
107
108 %post -p /sbin/ldconfig
109 %postun -p /sbin/ldconfig
110 rm -f %{_unitdir_user}/basic.target.wants/tdm-socket-user.path
111
112 %files
113 %manifest %{name}.manifest
114 %defattr(-,root,root,-)
115 %license COPYING
116 %{_libdir}/libtdm.so.*
117 %{_libdir}/tdm/libtdm-dummy.so
118 %{_libdir}/tdm/libtdm-virtual.so
119 %attr(750,root,root) %{_bindir}/tdm-monitor
120 %{_unitdir_user}/tdm-socket-user.path
121 %{_unitdir_user}/tdm-socket-user.service
122
123 %files devel
124 %manifest %{name}.manifest
125 %defattr(-,root,root,-)
126 %{_includedir}/tdm.h
127 %{_includedir}/tdm_common.h
128 %{_includedir}/tdm_backend.h
129 %{_includedir}/tdm_helper.h
130 %{_includedir}/tdm_list.h
131 %{_includedir}/tdm_log.h
132 %{_includedir}/tdm_types.h
133 %{_includedir}/tdm_deprecated.h
134 %{_libdir}/pkgconfig/libtdm.pc
135 %{_libdir}/libtdm.so
136
137 %files client
138 %manifest %{name}.manifest
139 %defattr(-,root,root,-)
140 %license COPYING
141 %{_libdir}/libtdm-client.so.*
142
143 %files client-devel
144 %manifest %{name}.manifest
145 %defattr(-,root,root,-)
146 %{_includedir}/tdm_client.h
147 %{_includedir}/tdm_client_types.h
148 %{_libdir}/pkgconfig/libtdm-client.pc
149 %{_libdir}/libtdm-client.so
150
151 %files tools
152 %manifest %{name}.manifest
153 %attr(750,root,root) %{_bindir}/tdm-test-server
154 %{_bindir}/tdm-test-client
155
156 %if "%{HALTESTS_PACKAGE}" == "1"
157 %files haltests
158 %defattr(-,root,root,-)
159 %{_bindir}/tdm-haltests
160 %endif
161
162 %changelog