Adapt to tizenorg: Generate app label from pkg_id
[platform/core/security/libprivilege-control.git] / packaging / libprivilege-control.spec
1 Name:       libprivilege-control
2 Summary:    Library to control privilege of application
3 Version:    0.0.43.TIZEN
4 Release:    1
5 Group:      Security/Access Control
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001:    %{name}.manifest
9 BuildRequires: cmake
10 BuildRequires: libcap-devel
11 BuildRequires: pkgconfig(libsmack)
12 BuildRequires: pkgconfig(dlog)
13 BuildRequires: pkgconfig(libiri)
14 BuildRequires: pkgconfig(sqlite3)
15
16 %description
17 development package of library to control privilege of in-house application
18
19 %package devel
20 Summary:    Control privilege of application (devel)
21 Requires:   %{name} = %{version}-%{release}
22
23 %description devel
24 Library to control privilege of application (devel)
25
26 %package conf
27 Summary:    Control privilege of application files
28 Requires:   %{name} = %{version}-%{release}
29
30 %description conf
31 Library to control privilege of application files
32
33
34 %prep
35 %setup -q
36 cp %{SOURCE1001} .
37
38 %build
39 %if 0%{?sec_build_binary_debug_enable}
40 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
41 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
42 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
43 %endif
44
45 export CFLAGS="${CFLAGS} -Wno-implicit-function-declaration"
46 %cmake . -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
47          -DCMAKE_VERBOSE_MAKEFILE=ON
48
49 VERBOSE=1 make %{?jobs:-j%jobs}
50
51 %install
52 %make_install
53 mkdir -p %{buildroot}/usr/share/privilege-control/
54
55 mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants
56 ln -sf /usr/lib/systemd/system/smack-rules.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/smack-rules.service
57 mkdir -p %{buildroot}/opt/dbspace
58
59 %post
60 /sbin/ldconfig
61
62 /usr/share/privilege-control/db/updater.sh
63
64 %postun -p /sbin/ldconfig
65
66 api_feature_loader --verbose --dir=/usr/share/privilege-control/
67 api_feature_loader --verbose --rules=/usr/share/privilege-control/ADDITIONAL_RULES.smack
68
69 %check
70 ./db/updater.sh --check-files %{buildroot}
71
72 %files
73 %manifest %{name}.manifest
74 %license LICENSE
75 %{_libdir}/*.so.*
76 %{_bindir}/slp-su
77 %{_libdir}/librules-db-sql-udf.so
78 #systemd service
79 /usr/lib/systemd/system/smack-rules.service
80 /usr/bin/api_feature_loader
81 #link to activate systemd service
82 /usr/lib/systemd/system/multi-user.target.wants/smack-rules.service
83 /usr/share/privilege-control/db/rules-db.sql
84 /usr/share/privilege-control/db/rules-db-data.sql
85 /usr/share/privilege-control/db/updater.sh
86 /usr/share/privilege-control/db/updates/*
87 /usr/share/privilege-control/db/load-rules-db.sql
88 /etc/opt/upgrade/220.libprivilege-updater.patch.sh
89 %attr(755, root, root) %dir /opt/dbspace
90
91 %files conf
92 %manifest %{name}.manifest
93 /opt/dbspace/.privilege_control*.db
94
95 %files devel
96 %manifest %{name}.manifest
97 %{_includedir}/*.h
98 %{_libdir}/*.so
99 %{_libdir}/pkgconfig/*.pc