X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=config-manager.spec;fp=config-manager.spec;h=6620c8a0ce0f4b0a44d84ed8a17bf47f68af3ed2;hb=c389bdee7b3845b55f443dbf04c0ce4083a55886;hp=0000000000000000000000000000000000000000;hpb=5030f0c004701dd422c78c71c014ef60f48139fc;p=ta%2Fconfig-manager.git diff --git a/config-manager.spec b/config-manager.spec new file mode 100644 index 0000000..6620c8a --- /dev/null +++ b/config-manager.spec @@ -0,0 +1,92 @@ +# Copyright 2019 Nokia + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Name: config-manager +Version: %{_version} +Release: 1%{?dist} +Summary: Contains code for the config manager +License: %{_platform_licence} +Source0: %{name}-%{version}.tar.gz +Vendor: %{_platform_vendor} +BuildArch: noarch + +BuildRequires: python +BuildRequires: python-setuptools + +%description +This RPM contains source code for the config manager. + +%prep +%autosetup + +%install +mkdir -p %{buildroot}/opt/cmframework/activators +mkdir -p %{buildroot}/opt/cmframework/validators +mkdir -p %{buildroot}/opt/cmframework/userconfighandlers +mkdir -p %{buildroot}/opt/cmframework/inventoryhandlers +mkdir -p %{buildroot}/etc/cmframework/masks.d + +mkdir -p %{buildroot}/opt/cmframework/scripts +cp cmframework/scripts/*.sh %{buildroot}/opt/cmframework/scripts +cp cmframework/scripts/cmserver %{buildroot}/opt/cmframework/scripts +cp cmframework/scripts/cmagent %{buildroot}/opt/cmframework/scripts +cp cmframework/scripts/redis.conf %{buildroot}/opt/cmframework/scripts +cp cmframework/config/masks.d/default.cfg %{buildroot}/etc/cmframework/masks.d/ + +mkdir -p %{buildroot}/usr/lib/systemd/system +cp cmframework/systemd/config-manager.service %{buildroot}/usr/lib/systemd/system +cp cmframework/systemd/cmagent.service %{buildroot}/usr/lib/systemd/system + +mkdir -p %{buildroot}/%{_python_site_packages_path}/cmframework/ +set -e +cd cmframework/src && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} --install-scripts %{_platform_bin_path} && cd - + +cd cmdatahandlers && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} --install-scripts %{_platform_bin_path} && cd - + +mkdir -p %{buildroot}/etc/service-profiles/ +cp serviceprofiles/profiles/*.profile %{buildroot}/etc/service-profiles/ + +cd serviceprofiles/python && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} && cd - + +cd hostcli && python setup.py install --root %{buildroot} --no-compile --install-purelib %{_python_site_packages_path} && cd - + +%files +%defattr(0755,root,root,0755) +/opt/cmframework +/usr/lib/systemd/system/config-manager.service +/usr/lib/systemd/system/cmagent.service +%{_platform_bin_path}/cmserver +%{_platform_bin_path}/cmcli +%{_platform_bin_path}/cmagent +%dir /etc/cmframework/masks.d +/etc/cmframework/masks.d/default.cfg +%{_python_site_packages_path}/cmframework* +%{_python_site_packages_path}/cmdatahandlers* +%{_python_site_packages_path}/serviceprofiles* +%{_python_site_packages_path}/cmcli* +/etc/service-profiles/* + +%pre + +%post +ln -sf /opt/cmframework/scripts/inventory.sh /opt/openstack-ansible/inventory/ +chmod -x /usr/lib/systemd/system/config-manager.service +chmod -x /usr/lib/systemd/system/cmagent.service + +%preun + +%postun + +%clean +rm -rf %{buildroot}