summaryrefslogtreecommitdiff
path: root/packaging/libwebappenc.spec
blob: 342d1f3312147c81b8ca2b5ce5631e325bd16b38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Name:    libwebappenc
Summary: Web application encryption service
Version: 0.1.0
Release: 1
Group:   Security/Libraries
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest

Requires(post):   /sbin/ldconfig
Requires(postun): /sbin/ldconfig

BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(key-manager)
BuildRequires: pkgconfig(libtzplatform-config)

%description
Web application encryption and decryption service

%package devel
Summary:    Web application encryption service (development files)
Group:      Security/Development
Requires:   %{name} = %{version}-%{release}

%description devel
Web application encryption and decryption service (development files)

%package test
Summary:    Web application encryption service (test)
Group:      Security/Development
Requires:   %{name} = %{version}-%{release}

%description test
Web application encryption and decryption service (test)

%prep
%setup -q
cp %{SOURCE1001} .

%build
%{!?build_type:%define build_type "Release"}
%cmake . -DPREFIX=%{_prefix} \
         -DEXEC_PREFIX=%{_exec_prefix} \
         -DINCLUDEDIR=%{_includedir} \
         -DLIBDIR=%{_libdir} \
         -DBINDIR=%TZ_SYS_BIN \
         -DSYSTEMD_UNIT_DIR=%{_unitdir} \
         -DCMAKE_BUILD_TYPE=%{build_type} \
         -DTZ_SYS_SHARE=%TZ_SYS_SHARE

make %{?jobs:-j%jobs}

%install
%make_install
%install_service multi-user.target.wants webappenc-initializer.service

%post
/sbin/ldconfig
systemctl daemon-reload
if [ $1 = 1 ]; then
    # installation
    systemctl start webappenc-initializer.service
fi

if [ $1 = 2 ]; then
    # update
    systemctl restart webappenc-initializer.service
fi

%postun
/sbin/ldconfig
if [ $1 = 0 ]; then
    # uninstall
    systemctl daemon-reload
fi

%files
%manifest %{name}.manifest
%license LICENSE
%{_libdir}/%{name}.so.*
%{_unitdir}/webappenc-initializer.service
%{_unitdir}/multi-user.target.wants/webappenc-initializer.service
%{TZ_SYS_BIN}/wae_initializer
%{TZ_SYS_SHARE}/wae/app_dek/WAE_APPDEK_KEK_PrivateKey.pem
%{TZ_SYS_SHARE}/wae/app_dek/WAE_APPDEK_KEK_PublicKey.pem

%files devel
%{_includedir}/*
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/%{name}.so

%files test
%{TZ_SYS_BIN}/wae_tests