Remove profile macro in spec file
[platform/core/security/ode.git] / packaging / ode.spec
1 Name:    ode
2 Version: 0.0.1
3 Release: 0
4 License: Apache-2.0
5 Source0: file://%{name}-%{version}.tar.gz
6 Summary: Tizen device encryption and secure erase manager
7 Group:   Security/Service
8 Requires: systemd
9 BuildRequires: gcc
10 BuildRequires: cmake
11 BuildRequires: gettext-tools
12 BuildRequires: pkgconfig(klay)
13 BuildRequires: pkgconfig(glib-2.0)
14 BuildRequires: pkgconfig(libxml-2.0)
15 BuildRequires: pkgconfig(libtzplatform-config)
16 BuildRequires: pkgconfig(key-manager)
17 BuildRequires: pkgconfig(cynara-client)
18 BuildRequires: pkgconfig(cynara-session)
19
20 %description
21 The ode package provides a daemon which is responsible for encrypting/decryption storages and secure erasing.
22
23 %files
24 %manifest ode.manifest
25 %defattr(644,root,root,755)
26 %attr(755,root,root) %{_bindir}/oded
27 %{_unitdir}/ode.service
28 %{_unitdir}/multi-user.target.wants/ode.service
29 %attr(700,root,root) %{_sbindir}/ode-admin-cli
30
31 %prep
32 %setup -q
33
34 %build
35 %{!?build_type:%define build_type "RELEASE"}
36
37 %if %{build_type} == "DEBUG" || %{build_type} == "PROFILING" || %{build_type} == "CCOV"
38         CFLAGS="$CFLAGS -Wp,-U_FORTIFY_SOURCE"
39         CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
40 %endif
41
42 %cmake . -DVERSION=%{version} \
43          -DCMAKE_BUILD_TYPE=%{build_type} \
44          -DRUN_DIR=%{TZ_SYS_RUN} \
45          -DBIN_DIR=%{TZ_SYS_BIN} \
46          -DSYSTEMD_UNIT_DIR=%{_unitdir}
47
48 make %{?jobs:-j%jobs}
49
50 %install
51 %make_install
52 mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants
53 ln -s ../ode.service %{buildroot}/%{_unitdir}/multi-user.target.wants/ode.service
54
55 %clean
56 rm -rf %{buildroot}
57
58 %postun
59
60 ## ODE Client Package ########################################################
61 %package -n libode
62 Summary: Library for Tizen device encryption and secure erase
63 Group: Security/Libraries
64 BuildRequires: pkgconfig(libtzplatform-config)
65 Requires: %{name} = %{version}-%{release}
66 Requires(post): /sbin/ldconfig
67 Requires(postun): /sbin/ldconfig
68
69 %description -n libode
70 The libode package contains the libraries needed to encrypt/decrypt storages and secure erasing.
71
72 %post -n libode -p /sbin/ldconfig
73
74 %postun -n libode -p /sbin/ldconfig
75
76 %files -n libode
77 %manifest ode.manifest
78 %defattr(644,root,root,755)
79 %attr(755,root,root) %{_libdir}/libode.so.%{version}
80 %{_libdir}/libode.so.0
81
82 ## Devel Package ##############################################################
83 %package -n libode-devel
84 Summary: Libraries and header files for device encryption client development
85 Group: Development/Libraries
86 Requires: libode = %{version}-%{release}
87
88 %description -n libode-devel
89 The libode-devel package includes the libraries and header files necessary for
90 developing device encryption client program.
91
92 %files -n libode-devel
93 %manifest ode.manifest
94 %defattr(644,root,root,755)
95 %{_libdir}/libode.so
96 %{_includedir}/ode
97 %{_libdir}/pkgconfig/ode.pc
98
99 ## Unittest Package ###########################################################
100 %package -n unit-tests
101 Summary: Unit tests to verify components of device encryption
102 Group: Security/Testing
103 Requires: libode = %{version}-%{release}
104
105 %description -n unit-tests
106 The libode-devel package includes the libraries and header files necessary for
107 developing device encryption client program.
108
109 %files -n unit-tests
110 %manifest ode.manifest
111 %defattr(644,root,root,755)
112 %attr(755,root,root) %{_bindir}/ode-engine-unit-tests