Organize initial source structure
[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 %{!?profile:%define profile "mobile"}
43
44 %cmake . -DVERSION=%{version} \
45          -DCMAKE_BUILD_TYPE=%{build_type} \
46          -DTIZEN_PROFILE_NAME=%{profile} \
47          -DRUN_DIR=%{TZ_SYS_RUN} \
48          -DBIN_DIR=%{TZ_SYS_BIN} \
49          -DSYSTEMD_UNIT_DIR=%{_unitdir}
50
51 make %{?jobs:-j%jobs}
52
53 %install
54 %make_install
55 mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants
56 ln -s ../ode.service %{buildroot}/%{_unitdir}/multi-user.target.wants/ode.service
57
58 %clean
59 rm -rf %{buildroot}
60
61 %postun
62
63 ## ODE Client Package ########################################################
64 %package -n libode
65 Summary: Library for Tizen device encryption and secure erase
66 Group: Security/Libraries
67 BuildRequires: pkgconfig(libtzplatform-config)
68 Requires: %{name} = %{version}-%{release}
69 Requires(post): /sbin/ldconfig
70 Requires(postun): /sbin/ldconfig
71
72 %description -n libode
73 The libode package contains the libraries needed to encrypt/decrypt storages and secure erasing.
74
75 %post -n libode -p /sbin/ldconfig
76
77 %postun -n libode -p /sbin/ldconfig
78
79 %files -n libode
80 %manifest ode.manifest
81 %defattr(644,root,root,755)
82 %attr(755,root,root) %{_libdir}/libode.so.%{version}
83 %{_libdir}/libode.so.0
84
85 ## Devel Package ##############################################################
86 %package -n libode-devel
87 Summary: Libraries and header files for device encryption client development
88 Group: Development/Libraries
89 Requires: libode = %{version}-%{release}
90
91 %description -n libode-devel
92 The libode-devel package includes the libraries and header files necessary for
93 developing device encryption client program.
94
95 %files -n libode-devel
96 %manifest ode.manifest
97 %defattr(644,root,root,755)
98 %{_libdir}/libode.so
99 %{_includedir}/ode
100 %{_libdir}/pkgconfig/ode.pc
101
102 ## Unittest Package ###########################################################
103 %package -n unit-tests
104 Summary: Unit tests to verify components of device encryption
105 Group: Security/Testing
106 Requires: libode = %{version}-%{release}
107
108 %description -n unit-tests
109 The libode-devel package includes the libraries and header files necessary for
110 developing device encryption client program.
111
112 %files -n unit-tests
113 %manifest ode.manifest
114 %defattr(644,root,root,755)
115 %attr(755,root,root) %{_bindir}/ode-engine-unit-tests