473911cde62f60663b4dd2bc08f8bca4f663a9ba
[platform/core/security/nice-lad.git] / packaging / nice-lad.spec
1 Name:       nice-lad
2 Summary:    Narcissistic, Incredible, Completely Exceptional Logger of Access Denials
3 Version:    0.1.0
4 Release:    1
5 Group:      Security/Access Control
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001:    %{name}.manifest
9 Source1002:    nice-lad-tests.manifest
10 BuildRequires: boost-devel
11 BuildRequires: cmake
12 BuildRequires: pkgconfig(audit)
13 BuildRequires: pkgconfig(libsystemd-journal)
14 BuildRequires: pkgconfig(security-manager)
15
16 %{?systemd_requires}
17
18 %if !%{defined build_type}
19 %define build_type RELEASE
20 %endif
21
22 %description
23 Narcissistic, Incredible, Completely Exceptional Logger of Access Denials.
24 The tool collects logs of access denials on platform (syscalls, Smack, Cynara
25 and Nether). It also reasonably populates audit's filters, so there is
26 no unneeded impact on performance. The tool works as a plugin for audit and is
27 only spawned on demand. nice-lad could be helpful for developers trying
28 to debug their applications.
29
30 %package tests
31 Summary:    Unit tests for nice-lad
32 BuildRequires: pkgconfig(gmock)
33
34 %description tests
35 Unit tests for nice-lad. A standalone application checking correctness
36 of nice-lad's components.
37
38 %prep
39 %setup -q
40 cp -a %{SOURCE1001} .
41 cp -a %{SOURCE1002} .
42
43 %build
44 %if 0%{?sec_build_binary_debug_enable}
45 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
46 %endif
47
48 %if %{?build_type} == "DEBUG"
49 export CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
50 %endif
51
52 export LDFLAGS+="-Wl,--rpath=%{_libdir}"
53
54 %cmake . \
55         -DCMAKE_BUILD_TYPE=%{?build_type} \
56         -DBIN_DIR:PATH=%{_bindir} \
57         -DSBIN_DIR:PATH=%{_sbindir} \
58         -DSYS_CONFIG_DIR:PATH=%{_sysconfdir} \
59         -DCMAKE_VERBOSE_MAKEFILE=ON \
60         -DWITH_SECURITY_MANAGER=ON \
61         -DWITH_JOURNALD=ON
62 make %{?jobs:-j%jobs}
63
64 %install
65 rm -rf %{buildroot}
66 %make_install
67
68 %files
69 %manifest %{name}.manifest
70 %license LICENSE
71 %attr(755,root,root) %{_sbindir}/%{name}
72 %config %{_sysconfdir}/audisp/plugins.d/nice_lad.conf
73
74 %files -n nice-lad-tests
75 %manifest nice-lad-tests.manifest
76 %license LICENSE
77 %attr(755,root,root) %{_bindir}/nice-lad-tests
78