Kubernetes 1.16.0 node label fix
[ta/config-manager.git] / config-manager.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 Name:       config-manager
16 Version:    %{_version}
17 Release:    1%{?dist}
18 Summary:    Contains code for the config manager
19 License:    %{_platform_licence}
20 Source0:    %{name}-%{version}.tar.gz
21 Vendor:     %{_platform_vendor}
22 BuildArch:  noarch
23
24 BuildRequires: python
25 BuildRequires: python-setuptools
26
27 %description
28 This RPM contains source code for the config manager.
29
30 %prep
31 %autosetup
32
33 %install
34 mkdir -p %{buildroot}/opt/cmframework/activators
35 mkdir -p %{buildroot}/opt/cmframework/validators
36 mkdir -p %{buildroot}/opt/cmframework/userconfighandlers
37 mkdir -p %{buildroot}/opt/cmframework/inventoryhandlers
38 mkdir -p %{buildroot}/etc/cmframework/masks.d
39
40 mkdir -p %{buildroot}/opt/cmframework/scripts
41 cp cmframework/scripts/*.sh %{buildroot}/opt/cmframework/scripts
42 cp cmframework/scripts/cmserver %{buildroot}/opt/cmframework/scripts
43 cp cmframework/scripts/cmagent %{buildroot}/opt/cmframework/scripts
44 cp cmframework/scripts/redis.conf %{buildroot}/opt/cmframework/scripts
45 cp cmframework/config/masks.d/default.cfg %{buildroot}/etc/cmframework/masks.d/
46
47 mkdir -p %{buildroot}/usr/lib/systemd/system
48 cp cmframework/systemd/config-manager.service  %{buildroot}/usr/lib/systemd/system
49 cp cmframework/systemd/cmagent.service  %{buildroot}/usr/lib/systemd/system
50
51 mkdir -p %{buildroot}/%{_python_site_packages_path}/cmframework/
52 set -e
53 cd cmframework/src && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} --install-scripts %{_platform_bin_path} && cd -
54
55 cd cmdatahandlers && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} --install-scripts %{_platform_bin_path} && cd -
56
57 mkdir -p %{buildroot}/etc/service-profiles/
58 cp serviceprofiles/profiles/*.profile %{buildroot}/etc/service-profiles/
59
60 cd serviceprofiles/python && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} && cd -
61
62 cd hostcli && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} && cd -
63
64 %files
65 %defattr(0755,root,root,0755)
66 /opt/cmframework
67 /usr/lib/systemd/system/config-manager.service
68 /usr/lib/systemd/system/cmagent.service
69 %{_platform_bin_path}/cmserver
70 %{_platform_bin_path}/cmcli
71 %{_platform_bin_path}/cmagent
72 %dir /etc/cmframework/masks.d
73 /etc/cmframework/masks.d/default.cfg
74 %{_python_site_packages_path}/cmframework*
75 %{_python_site_packages_path}/cmdatahandlers*
76 %{_python_site_packages_path}/serviceprofiles*
77 %{_python_site_packages_path}/cmcli*
78 /etc/service-profiles/*
79
80 %pre
81
82 %post
83 ln -sf /opt/cmframework/scripts/inventory.sh /opt/openstack-ansible/inventory/
84 chmod -x /usr/lib/systemd/system/config-manager.service
85 chmod -x /usr/lib/systemd/system/cmagent.service
86
87 %preun
88
89 %postun
90
91 %clean
92 rm -rf %{buildroot}