Remove tz platform config devel dependency
[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:   System/Libraries
6 License: Apache-2.0
7 Source0: %{name}-%{version}.tar.gz
8 Source1001: %{name}.manifest
9
10 Requires(post):   /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12
13 BuildRequires: cmake
14 BuildRequires: pkgconfig(dlog)
15 BuildRequires: pkgconfig(openssl)
16 BuildRequires: pkgconfig(key-manager)
17 BuildRequires: pkgconfig(libtzplatform-config)
18
19 %description
20 Web application encryption and decryption service
21
22 %package devel
23 Summary:    Web application encryption service (development files)
24 Group:      Development/Libraries
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 Group:      Development
33 Requires:   %{name} = %{version}-%{release}
34
35 %description test
36 Web application encryption and decryption service (test)
37
38
39
40 %prep
41 %setup -q
42 cp %{SOURCE1001} .
43
44 %build
45 %{!?build_type:%define build_type "Release"}
46 %cmake . -DPREFIX=%{_prefix} \
47          -DEXEC_PREFIX=%{_exec_prefix} \
48          -DINCLUDEDIR=%{_includedir} \
49          -DLIBDIR=%{_libdir} \
50          -DBINDIR=%TZ_SYS_BIN \
51          -DSYSTEMD_UNIT_DIR=%{_unitdir} \
52          -DCMAKE_BUILD_TYPE=%{build_type} \
53          -DTZ_SYS_BIN=%TZ_SYS_BIN \
54          -DTZ_SYS_SHARE=%TZ_SYS_SHARE
55
56 make %{?jobs:-j%jobs}
57
58
59 %install
60 rm -rf %{buildroot}
61 mkdir -p %{buildroot}%{TZ_SYS_SHARE}/license
62 cp LICENSE.Apache-2.0 %{buildroot}%{TZ_SYS_SHARE}/license/%{name}
63 %make_install
64 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
65 ln -s ../webappenc-initializer.service %{buildroot}%{_unitdir}/multi-user.target.wants/webappenc-initializer.service
66
67
68 %clean
69 rm -rf %{buildroot}
70
71 %post
72 /sbin/ldconfig
73 systemctl daemon-reload
74 if [ $1 = 1 ]; then
75     # installation
76     systemctl start webappenc-initializer.service
77 fi
78
79 if [ $1 = 2 ]; then
80     # update
81     systemctl restart webappenc-initializer.service
82 fi
83
84 %postun
85 /sbin/ldconfig
86 if [ $1 = 0 ]; then
87     # uninstall
88     systemctl daemon-reload
89 fi
90
91
92 %files
93 %defattr(-,root,root,-)
94 %manifest %{name}.manifest
95 %{TZ_SYS_SHARE}/license/%{name}
96 %{_libdir}/%{name}.so.*
97 %{_unitdir}/webappenc-initializer.service
98 %{_unitdir}/multi-user.target.wants/webappenc-initializer.service
99 %{TZ_SYS_BIN}/wae_initializer
100 %{TZ_SYS_SHARE}/wae/app_dek/WAE_APPDEK_KEK_PrivateKey.pem
101 %{TZ_SYS_SHARE}/wae/app_dek/WAE_APPDEK_KEK_PublicKey.pem
102
103 %files devel
104 %defattr(-,root,root,-)
105 %{_includedir}/*
106 %{_libdir}/pkgconfig/%{name}.pc
107 %{_libdir}/%{name}.so
108
109 %files test
110 %defattr(-,root,root,-)
111 %{TZ_SYS_BIN}/wae_tests
112
113