summaryrefslogtreecommitdiff
path: root/packaging/log_dump.spec
blob: ce97c0ba9e1f25277941afc5bfbbbd1ae77cc3bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Name:      log_dump
Summary:    log_dump
Version:    5.5.19
Release:    1
Group:      Framework/system
License:    Apache-2.0 and BSD
Source0:    %{name}-%{version}.tar.gz
Source1001:    log_dump.manifest
Requires:       crash-worker
BuildRequires:  pkgconfig(dlog)
BuildRequires:  pkgconfig(libtzplatform-config)
BuildRequires:  pkgconfig(iniparser)
BuildRequires:  pkgconfig(capi-system-info)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  cmake
BuildRequires:  pkgconfig(pkgmgr-info)

%description
log_dump

%prep
%setup -q

%define crash_root_path %{TZ_SYS_CRASH_ROOT}
%define crash_all_log   %{TZ_SYS_ALLLOGS}
%define crash_dump_gen  %{TZ_SYS_DUMPGEN}

%build
cp %{SOURCE1001} .

%cmake src/log_dump/ \
       -DCRASH_ROOT_PATH=%{crash_root_path} \
       -DDUMP_SYSTEMSTATE_BIN_PATH=%{_bindir}/dump_systemstate \
       -DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf

make %{?jobs:-j%jobs}

%install
rm -rf %{buildroot}
%make_install
mkdir -p %{buildroot}%{crash_all_log}
mkdir -p %{buildroot}%{crash_dump_gen}
cp dump_scripts/* %{buildroot}%{crash_dump_gen}
chmod 755 %{buildroot}%{crash_dump_gen}/*

%post
/usr/bin/chsmack -a "System" -t %{crash_dump_gen}
/usr/bin/chsmack -a "System" -t %{crash_dump_gen}/module.d
/usr/bin/chsmack -a "System::Shared" -t %{crash_all_log}
/usr/bin/chsmack -a "_"  %{crash_dump_gen}/module.d/*

%files
%license LICENSE
%manifest log_dump.manifest
%dir %{crash_all_log}
%{crash_dump_gen}/*
%attr(-,root,root) %{_unitdir}/log_dump.service
%attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/log_dump.conf
%attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.service
%attr(0750,system_fw,system_fw) %{_bindir}/log_dump