service: Move dumpsys-service to /usr/libexec
[platform/core/system/dumpsys.git] / packaging / dumpsys.spec
1 %define on_off() %{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}}
2
3 %if "%{?profile}" == "tv"
4 %undefine _with_tests
5 %else
6 %define _with_tests on
7 %endif
8
9 %bcond_with tests
10
11 Name:       dumpsys
12 Summary:    Dumpsys is a framework to get logs from services and applications.
13 Version:    2.0.10
14 Release:    1
15 Group:      Framework/system
16 License:    Apache-2.0
17 Source0:    %{name}-%{version}.tar.gz
18 Source1001:    dumpsys.manifest
19 BuildRequires:  pkgconfig(glib-2.0)
20 BuildRequires:  pkgconfig(dlog)
21 BuildRequires:  cmake
22 %if %{with tests}
23 BuildRequires:  cmocka-devel cmocka
24 BuildRequires:  lcov
25 %endif
26 Requires:       dumpsys-common
27
28 %description
29 This package provides dumpsys utility and libraries to allow collecting logs from services and applications.
30
31 %package -n dumpsys-common
32 Summary: DBus policy config files
33 %description -n dumpsys-common
34
35 %package -n dumpsys-devel
36 Summary: dumpsys development package.
37 Requires: dumpsys
38 %description -n dumpsys-devel
39 This package provides library and header files.
40
41 %package -n libdumpsys-system
42 Summary: Package with dumpsys API library for services.
43 Requires: dumpsys-common
44 %description -n libdumpsys-system
45 This package provides dumpsys API library for services.
46
47 %package -n libdumpsys-system-devel
48 Requires: libdumpsys-system
49 Summary: libdumpsys-system development package.
50 %description -n libdumpsys-system-devel
51 This package provides library and header files.
52
53 %package -n libdumpsys-user
54 Summary: Package with dumpsys API library for services.
55 Requires: dumpsys-common
56 BuildRequires: pkgconfig(pkgmgr-info)
57 %description -n libdumpsys-user
58 This package provides dumpsys API library for services.
59
60 %package -n libdumpsys-user-devel
61 Requires: libdumpsys-user
62 Summary: libdumpsys-user development package.
63 %description -n libdumpsys-user-devel
64 This package provides library and header files.
65
66 %if %{with tests}
67 %package tests
68 Summary: Contains scripts for testing dumpsys
69 %description tests
70 %endif
71
72 %prep
73 %setup -q
74
75 %build
76 cp %{SOURCE1001} .
77 export CFLAGS+=" -Werror -fvisibility=hidden"
78
79 %cmake . \
80     -DVERSION=%{version} \
81     -DTESTS=%{on_off tests} \
82     -DDUMPSYS_SYSTEM_TESTS_PATH=%{_libdir}/dumpsys_system_tests/ \
83     -DDUMPSYS_TESTS_PATH=%{_libdir}/dumpsys_unit_tests/
84
85 make %{?jobs:-j%jobs}
86
87 %if %{with tests}
88 make coverage
89 %endif
90
91 %install
92 rm -rf %{buildroot}
93 %make_install
94
95 %files
96 %license LICENSE
97 %manifest %{name}.manifest
98
99 %defattr(0755,root,root)
100 %{_bindir}/dumpsys
101 %{_libdir}/libdumpsys.so.*
102 %{_libexecdir}/dumpsys-service
103
104 %defattr(0644,root,root)
105 %{_unitdir}/dumpsys-service.service
106 %{_prefix}/lib/tmpfiles.d/dumpsys-run.conf
107 %{_prefix}/share/dbus-1/system-services/org.tizen.dumpsys.service.service
108
109 %files -n dumpsys-common
110 %manifest %{name}.manifest
111 %defattr(0644,root,root)
112 %{_sysconfdir}/dbus-1/system.d/dumpsys-service.conf
113
114 %files -n dumpsys-devel
115 %manifest %{name}.manifest
116 %{_includedir}/libdumpsys.h
117 %{_libdir}/libdumpsys.so
118 %{_libdir}/pkgconfig/dumpsys.pc
119
120 %files -n libdumpsys-system
121 %manifest %{name}.manifest
122 %{_libdir}/libdumpsys-system.so.*
123
124 %files -n libdumpsys-system-devel
125 %manifest %{name}.manifest
126 %{_includedir}/dumpsys-system.h
127 %{_libdir}/libdumpsys-system.so
128 %{_libdir}/pkgconfig/dumpsys-system.pc
129
130 %files -n libdumpsys-user
131 %manifest %{name}.manifest
132 %{_libdir}/libdumpsys-user.so.*
133
134 %files -n libdumpsys-user-devel
135 %manifest %{name}.manifest
136 %{_includedir}/dumpsys-user.h
137 %{_libdir}/libdumpsys-user.so
138 %{_libdir}/pkgconfig/dumpsys-user.pc
139
140 %if %{with tests}
141 %files tests
142 %manifest %{name}.manifest
143 %defattr(0755,root,root)
144 %{_libdir}/dumpsys_system_tests/utils/dumpsys-utils.sh
145 %{_libdir}/dumpsys_system_tests/utils/test-app
146 %{_libdir}/dumpsys_system_tests/run.sh
147 %{_libdir}/dumpsys_system_tests/dumpsys_system/dumpsys_system.sh
148 %{_libdir}/dumpsys_system_tests/dumpsys_notfound/dumpsys_notfound.sh
149 %{_libdir}/dumpsys_unit_tests/test_libdumpsys
150 %{_libdir}/dumpsys_unit_tests/test_dumpsys_service
151 %{_libdir}/dumpsys_unit_tests/test_dumpsys_client_user_api
152 %{_libdir}/dumpsys_unit_tests/test_dumpsys_client_system_api
153 %endif