Capability update
[ta/caas-security.git] / rpmbuild.spec
1 # Copyright 2019 Nokia
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 %define COMPONENT security
16 %define RPM_NAME caas-%{COMPONENT}
17 %define RPM_MAJOR_VERSION 1.0.0
18 %define RPM_MINOR_VERSION 6
19
20 Name:           %{RPM_NAME}
21 Version:        %{RPM_MAJOR_VERSION}
22 Release:        %{RPM_MINOR_VERSION}%{?dist}
23 Summary:        Containers as a Service security related playbooks + manifests
24 License:        %{_platform_license}
25 BuildArch:      x86_64
26 Vendor:         %{_platform_vendor}
27 Source0:        %{name}-%{version}.tar.gz
28
29 %description
30 This rpm contains the necessary security related playbooks + manifests for the caas subsystem.
31
32 %prep
33 %autosetup
34
35 %build
36
37 %install
38 mkdir -p %{buildroot}/%{_caas_rbac_manifests_path}/
39 rsync -av rbac_manifests/* %{buildroot}/%{_caas_rbac_manifests_path}/
40
41 mkdir -p %{buildroot}/%{_playbooks_path}/
42 rsync -av ansible/playbooks/* %{buildroot}/%{_playbooks_path}/
43
44 mkdir -p %{buildroot}/%{_roles_path}/
45 rsync -av ansible/roles/* %{buildroot}/%{_roles_path}/
46
47 %files
48 %{_caas_rbac_manifests_path}/*
49 %{_playbooks_path}/*
50 %{_roles_path}/*
51
52
53 %preun
54
55 %post
56 mkdir -p %{_postconfig_path}/
57 ln -sf %{_playbooks_path}/rbac.yaml     %{_postconfig_path}
58 ln -sf %{_playbooks_path}/security.yaml %{_postconfig_path}
59
60
61 %postun
62 if [ $1 -eq 0 ]; then
63     rm -f %{_postconfig_path}/rbac.yaml
64     rm -f %{_postconfig_path}/security.yaml
65 fi
66
67
68 %clean
69 rm -rf ${buildroot}