summaryrefslogtreecommitdiff
path: root/packaging/libwebappenc.spec
blob: 4184b8483a02a69a0a6790b258993be454d9ef89 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Name:    libwebappenc
Summary: Web application encryption service
Version: 0.1.0
Release: 1
Group:   Security/Libraries
License: Apache-2.0 and BSL-1.0
Source0: %{name}-%{version}.tar.gz

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)
License:    Apache-2.0
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)
License:    Apache-2.0 and BSL-1.0
Group:      Security/Development
BuildRequires: boost-devel
Requires:      %{name} = %{version}-%{release}

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

%define user_name          security_fw
%define group_name         security_fw
%define smack_domain       System
%define bin_dir            %TZ_SYS_BIN
%define rw_share_dir       %TZ_SYS_SHARE
%define upgrade_dir        %TZ_SYS_RO_SHARE/upgrade
%define upgrade_script_dir %{upgrade_dir}/scripts
%define upgrade_data_dir   %{upgrade_dir}/data

%prep
%setup -q

%build
%{!?build_type:%define build_type "Release"}
%cmake . -DPREFIX=%{_prefix} \
         -DEXEC_PREFIX=%{_exec_prefix} \
         -DINCLUDEDIR=%{_includedir} \
         -DLIBDIR=%{_libdir} \
         -DSYSTEMD_UNIT_DIR=%{_unitdir} \
         -DCMAKE_BUILD_TYPE=%{build_type} \
         -DRW_SHARE_DIR=%rw_share_dir \
         -DUPGRADE_DATA_DIR=%upgrade_data_dir \
         -DUPGRADE_SCRIPT_DIR=%upgrade_script_dir \
         -DUSER_NAME=%user_name \
         -DGROUP_NAME=%group_name \
         -DSMACK_DOMAIN=%smack_domain \
         -DBINDIR=%bin_dir

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
%license LICENSE.BSL-1.0
%{_libdir}/%{name}.so.*
%{_unitdir}/webappenc-initializer.service
%{_unitdir}/multi-user.target.wants/webappenc-initializer.service
%{bin_dir}/wae_initializer
%dir %attr(770, %user_name, %group_name) %{rw_share_dir}/wae
%dir %attr(770, %user_name, %group_name) %{rw_share_dir}/wae/app_dek
%attr(660, %user_name, %group_name) %{rw_share_dir}/wae/app_dek/*

%attr(775,root,root) %{upgrade_script_dir}/200.wae.sh
%{upgrade_data_dir}/wae/app_dek/*

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

%files test
%manifest %{name}-test.manifest
%license LICENSE
%license LICENSE.BSL-1.0
%{bin_dir}/wae_tests
%{_libdir}/libwae_tests_common.so*
%attr(660, %user_name, %group_name) %{rw_share_dir}/wae/test/app_dek/*