Test binaries added to middleware list
[platform/core/test/security-tests.git] / packaging / security-tests.spec
1 #sbs-git:slp/pkgs/w/wrt-security wrt-security 0.0.43
2 Name:       security-tests
3 Summary:    Security repository for holding tests.
4 Version:    0.0.45
5 Release:    1
6 Group:      Development/Libraries
7 License:    Apache License, Version 2.0
8 URL:        N/A
9 Source0:    %{name}-%{version}.tar.gz
10 BuildRequires: cmake
11 BuildRequires: pkgconfig(libsmack)
12 BuildRequires: pkgconfig(libprivilege-control)
13 BuildRequires: pkgconfig(security-server)
14 BuildRequires: pkgconfig(dpl-test-efl)
15 BuildRequires: pkgconfig(dlog)
16 Requires:   smack
17 Requires:   libprivilege-control
18
19 %description
20 Security tests repository - for tests that can't be kept together with code.
21
22 %prep
23 %setup -q
24
25 %build
26 export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib"
27
28 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
29         -DDPL_LOG="ON"                    \
30         -DVERSION=%{version}
31 make %{?jobs:-j%jobs}
32
33 %install
34 rm -rf %{buildroot}
35 %make_install
36 ln -sf /etc/smack/test_smack_rules %{buildroot}/etc/smack/test_smack_rules_lnk
37
38 %clean
39 rm -rf %{buildroot}
40
41 %post
42 find /etc/smack/test_privilege_control_DIR/ -type f -name exec -exec chmod 0755 {} +
43 # add test binaries to mw-list if it's not already there
44 BINARIES[0]="/usr/bin/security-server-tests-client-smack"
45 BINARIES[1]="/usr/bin/security-server-tests-label"
46 BINARIES[2]="/usr/bin/security-server-tests-server"
47 for BINARY in "${BINARIES[@]}"
48 do
49     grep -q $BINARY /usr/share/security-server/mw-list\
50      || echo $BINARY >> /usr/share/security-server/mw-list
51 done
52 echo "security-tests postinst done ..."
53
54 %postun
55
56 %files
57 %defattr(-, root, root, -)
58 /usr/bin/security-tests.sh
59 /usr/bin/security-tests-all.sh
60 /usr/bin/libsmack-test
61 /usr/bin/libprivilege-control-test
62 /usr/bin/security-server-tests-client-smack
63 /usr/bin/security-server-tests-label
64 /usr/bin/security-server-tests-pid-reuser
65 /usr/bin/security-server-tests-server
66 /usr/bin/security-server-tests-password
67 /etc/smack/test_smack_rules
68 /etc/smack/test_smack_rules_lnk
69 /usr/share/privilege-control/test_privilege_control_rules.smack
70 /etc/smack/test_privilege_control_DIR/*