7d796f94345e83606079f64504f1f462120195d9
[platform/core/security/libwebappenc.git] / packaging / libwebappenc.spec
1 Name:    libwebappenc
2 Summary: Web application encryption service
3 Version: 0.1.0
4 Release: 1
5 Group:   Security/Libraries
6 License: Apache-2.0 and BSL-1.0
7 Source0: %{name}-%{version}.tar.gz
8
9 Requires(post):   /sbin/ldconfig
10 Requires(postun): /sbin/ldconfig
11
12 BuildRequires: cmake
13 BuildRequires: pkgconfig(dlog)
14 BuildRequires: pkgconfig(openssl)
15 BuildRequires: pkgconfig(key-manager)
16 BuildRequires: pkgconfig(libtzplatform-config)
17
18 %description
19 Web application encryption and decryption service
20
21 %package devel
22 Summary:    Web application encryption service (development files)
23 License:    Apache-2.0
24 Group:      Security/Development
25 Requires:   %{name} = %{version}-%{release}
26
27 %description devel
28 Web application encryption and decryption service (development files)
29
30 %package test
31 Summary:    Web application encryption service (test)
32 License:    Apache-2.0 and BSL-1.0
33 Group:      Security/Development
34 BuildRequires: boost-devel
35 Requires:      %{name} = %{version}-%{release}
36
37 %description test
38 Web application encryption and decryption service (test)
39
40 %define bin_dir         %TZ_SYS_BIN
41 %define rw_share_dir    %TZ_SYS_SHARE
42
43 %prep
44 %setup -q
45
46 %build
47 %{!?build_type:%define build_type "Release"}
48 %cmake . -DPREFIX=%{_prefix} \
49          -DEXEC_PREFIX=%{_exec_prefix} \
50          -DINCLUDEDIR=%{_includedir} \
51          -DLIBDIR=%{_libdir} \
52          -DSYSTEMD_UNIT_DIR=%{_unitdir} \
53          -DCMAKE_BUILD_TYPE=%{build_type} \
54          -DRW_SHARE_DIR=%rw_share_dir \
55          -DBINDIR=%bin_dir
56
57 make %{?jobs:-j%jobs}
58
59 %install
60 %make_install
61 %install_service multi-user.target.wants webappenc-initializer.service
62
63 %post
64 /sbin/ldconfig
65 systemctl daemon-reload
66 if [ $1 = 1 ]; then
67     # installation
68     systemctl start webappenc-initializer.service
69 fi
70
71 if [ $1 = 2 ]; then
72     # update
73     systemctl restart webappenc-initializer.service
74 fi
75
76 %postun
77 /sbin/ldconfig
78 if [ $1 = 0 ]; then
79     # uninstall
80     systemctl daemon-reload
81 fi
82
83 %files
84 %manifest %{name}.manifest
85 %license LICENSE
86 %license LICENSE.BSL-1.0
87 %{_libdir}/%{name}.so.*
88 %{_unitdir}/webappenc-initializer.service
89 %{_unitdir}/multi-user.target.wants/webappenc-initializer.service
90 %{bin_dir}/wae_initializer
91 %{rw_share_dir}/wae/app_dek/WAE_APPDEK_KEK_PrivateKey.pem
92 %{rw_share_dir}/wae/app_dek/WAE_APPDEK_KEK_PublicKey.pem
93
94 %files devel
95 %{_includedir}/*
96 %{_libdir}/pkgconfig/%{name}.pc
97 %{_libdir}/%{name}.so
98
99 %files test
100 %manifest %{name}-test.manifest
101 %license LICENSE
102 %license LICENSE.BSL-1.0
103 %{bin_dir}/wae_tests
104 %{_libdir}/libwae_tests_common.so*