From 6578b7a3b174449361b5d65189bbd879165abfeb Mon Sep 17 00:00:00 2001 From: Erich Cordoba Date: Wed, 25 Sep 2019 15:10:09 -0500 Subject: [PATCH] Add opensuse specfiles to nfv The nfv components were enabled in the opensuse build system, however to improve maintenance it was decided to move these files to the official repositories. The Open Build Service (OBS) project can be found here: https://build.opensuse.org/project/show/Cloud:StarlingX:2.0 Story: 2006508 Task: 36809 Change-Id: Ie4084c3f0dbfc9683eb8fb023cc6531d59dc3b1a Signed-off-by: Erich Cordoba --- mtce-guest/opensuse/mtce-guest.changes | 13 ++ mtce-guest/opensuse/mtce-guest.rpmlintrc | 1 + mtce-guest/opensuse/mtce-guest.spec | 180 +++++++++++++++ nfv/opensuse/nfv.changes | 8 + nfv/opensuse/nfv.rpmlintrc | 1 + nfv/opensuse/nfv.spec | 207 ++++++++++++++++++ .../opensuse/nova-api-proxy.changes | 15 ++ .../opensuse/nova-api-proxy.rpmlintrc | 1 + nova-api-proxy/opensuse/nova-api-proxy.spec | 76 +++++++ 9 files changed, 502 insertions(+) create mode 100644 mtce-guest/opensuse/mtce-guest.changes create mode 100644 mtce-guest/opensuse/mtce-guest.rpmlintrc create mode 100644 mtce-guest/opensuse/mtce-guest.spec create mode 100644 nfv/opensuse/nfv.changes create mode 100644 nfv/opensuse/nfv.rpmlintrc create mode 100644 nfv/opensuse/nfv.spec create mode 100644 nova-api-proxy/opensuse/nova-api-proxy.changes create mode 100644 nova-api-proxy/opensuse/nova-api-proxy.rpmlintrc create mode 100644 nova-api-proxy/opensuse/nova-api-proxy.spec diff --git a/mtce-guest/opensuse/mtce-guest.changes b/mtce-guest/opensuse/mtce-guest.changes new file mode 100644 index 00000000..13ed2882 --- /dev/null +++ b/mtce-guest/opensuse/mtce-guest.changes @@ -0,0 +1,13 @@ +------------------------------------------------------------------- +Mon Sep 16 15:45:00 UTC 2019 - Dominig ar Foll Intel Open Source + +- move to _service to get source from git repo +------------------------------------------------------------------- +Wed Jun 19 12:45:22 UTC 2019 - Marcela Rosales + +- Use openSUSE RPMs for the Requires tags to fix installation errors. + +------------------------------------------------------------------- +Wed Jun 12 14:07:21 UTC 2019 - Marcela Rosales + +- Initial Commit diff --git a/mtce-guest/opensuse/mtce-guest.rpmlintrc b/mtce-guest/opensuse/mtce-guest.rpmlintrc new file mode 100644 index 00000000..adc59bf3 --- /dev/null +++ b/mtce-guest/opensuse/mtce-guest.rpmlintrc @@ -0,0 +1 @@ +setBadness('script-without-shebang', 2) diff --git a/mtce-guest/opensuse/mtce-guest.spec b/mtce-guest/opensuse/mtce-guest.spec new file mode 100644 index 00000000..90db6bfb --- /dev/null +++ b/mtce-guest/opensuse/mtce-guest.spec @@ -0,0 +1,180 @@ +Summary: Maintenance Guest Server/Agent Package +Name: mtce-guest +Version: 1.0.0 +%define patchlevel %{tis_patch_ver} +Release: %{tis_patch_ver}%{?_tis_dist} +License: Apache-2.0 +Group: System/Base +URL: https://opendev.org/starlingx/nfv + +Source0: %{name}-%{version}.tar.gz + +BuildRequires: openssl +BuildRequires: openssl-devel +BuildRequires: libjson-c3 +BuildRequires: libjson-c-devel +BuildRequires: libevent +BuildRequires: libevent-devel +BuildRequires: libuuid1 +BuildRequires: libuuid-devel +BuildRequires: fm-common +BuildRequires: fm-common-dev +BuildRequires: mtce-common-devel >= 1.0 +BuildRequires: systemd +BuildRequires: systemd-sysvinit +BuildRequires: sysvinit-tools +BuildRequires: insserv-compat +BuildRequires: cppcheck +BuildRequires: gcc-c++ + +%description +Maintenance Guest Agent Service and Server assists in VM guest +heartbeat control and failure reporting at the controller level. + +%package -n mtce-guestAgent +Summary: Maintenance Guest Agent Package +Group: System/Base +Requires: dpkg +Requires: time +Requires: libjson-c3 +Requires: libstdc++6 +Requires: glibc +Requires: fm-common >= 1.0 +Requires: bash >= 4.4 +Requires: libgcc_s1 +Requires: libevent >= 2.0.21 +Requires: libuuid1 +Requires: systemd +Requires: systemd-sysvinit +Requires: sysvinit-tools +Requires: insserv-compat +Requires: logrotate +Requires: openssl + + +%description -n mtce-guestAgent +Maintenance Guest Agent Service assists in +VM guest heartbeat control and failure reporting at the controller +level. + +%package -n mtce-guestServer +Summary: Maintenance Guest Server Package +Group: System/Base +Requires: util-linux +Requires: bash >= 4.4 +Requires: systemd +Requires: dpkg +Requires: libjson-c3 +Requires: libjson-c-devel +Requires: libstdc++6 +Requires: glibc +Requires: fm-common >= 1.0 +Requires: libgcc_s1 +Requires: libevent >= 2.0.21 +Requires: libuuid1 +Requires: logrotate +Requires: openssl + +%description -n mtce-guestServer +Maintenance Guest Server assists in VM guest +heartbeat control and failure reporting at the worker level. + +%define local_bindir /usr/local/bin + +%prep +%setup -n %{name}-%{version}/src + +# build mtce-guestAgent and mtce-guestServer package +%build +VER=%{version} +MAJOR=$(echo $VER | awk -F . '{print $1}') +MINOR=$(echo $VER | awk -F . '{print $2}') +make MAJOR=$MAJOR MINOR=$MINOR %{?_smp_mflags} build + +# install mtce-guestAgent and mtce-guestServer package +%install +make install \ + DESTDIR=%{buildroot} \ + PREFIX=%{buildroot}/usr/local \ + SYSCONFDIR=%{buildroot}%{_sysconfdir} \ + LOCALBINDIR=%{buildroot}%{local_bindir} \ + UNITDIR=%{buildroot}%{_unitdir} + +# guestServer +%pre -n mtce-guestServer +%service_add_pre guestServer.service + +# enable all services in systemd +%post -n mtce-guestServer +%service_add_post guestServer.service +systemctl enable guestServer.service + +%preun -n mtce-guestServer +%service_del_preun guestServer.service + +%postun -n mtce-guestServer +%service_del_postun guestServer.service +%insserv_cleanup + +# guestAgent +%pre -n mtce-guestAgent +%service_add_pre guestAgent.service + +%post -n mtce-guestAgent +%service_add_post guestAgent.service + +%preun -n mtce-guestAgent +%service_del_preun guestAgent.service + +%postun -n mtce-guestAgent +%service_del_postun guestAgent.service +%insserv_cleanup + +%files -n mtce-guestAgent +%license LICENSE +%defattr(-,root,root,-) + +# create mtc and its tmp dir +%dir %{_sysconfdir}/mtc +%dir %{_sysconfdir}/mtc/tmp + +# config files - non-modifiable +%{_sysconfdir}/mtc/guestAgent.ini + +%{_unitdir}/guestAgent.service +%{_sysconfdir}/logrotate.d/guestAgent.logrotate +/usr/lib/ocf/resource.d/platform/guestAgent + +%{_sysconfdir}/init.d/guestAgent +%{local_bindir}/guestAgent + +%{_prefix}/lib/ocf +%{_prefix}/lib/ocf/resource.d +%{_prefix}/lib/ocf/resource.d/platform +%config %{_sysconfdir}/logrotate.d/guestAgent.logrotate +%config %{_sysconfdir}/mtc/guestAgent.ini + +%files -n mtce-guestServer +%license LICENSE +%defattr(-,root,root,-) + +# create mtc and its tmp dir +%dir %{_sysconfdir}/mtc +%dir %{_sysconfdir}/mtc/tmp + +# config files - non-modifiable +%{_sysconfdir}/mtc/guestServer.ini + +%{_sysconfdir}/pmon.d/guestServer.conf +%{_sysconfdir}/logrotate.d/guestServer.logrotate +%{_unitdir}/guestServer.service + +%{_sysconfdir}/init.d/guestServer +%{local_bindir}/guestServer + +%{_sysconfdir}/pmon.d +%config %{_sysconfdir}/logrotate.d/guestServer.logrotate +%config %{_sysconfdir}/mtc/guestServer.ini +%config %{_sysconfdir}/pmon.d/guestServer.conf + +%changelog diff --git a/nfv/opensuse/nfv.changes b/nfv/opensuse/nfv.changes new file mode 100644 index 00000000..db519357 --- /dev/null +++ b/nfv/opensuse/nfv.changes @@ -0,0 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 16 15:45:00 UTC 2019 - Dominig ar Foll Intel Open Source + +- move to _service to get source from git repo +------------------------------------------------------------------- +Wed Jun 5 08:33:59 UTC 2019 - Marcela Rosales + +- Initial Commit diff --git a/nfv/opensuse/nfv.rpmlintrc b/nfv/opensuse/nfv.rpmlintrc new file mode 100644 index 00000000..adc59bf3 --- /dev/null +++ b/nfv/opensuse/nfv.rpmlintrc @@ -0,0 +1 @@ +setBadness('script-without-shebang', 2) diff --git a/nfv/opensuse/nfv.spec b/nfv/opensuse/nfv.spec new file mode 100644 index 00000000..93b44a07 --- /dev/null +++ b/nfv/opensuse/nfv.spec @@ -0,0 +1,207 @@ +Summary: Network Function Virtualization +Name: nfv +Version: 1.0.0 +Release: %{tis_patch_ver}%{?_tis_dist} +License: Apache-2.0 +Group: System/Packages +URL: https://opendev.org/starlingx/nfv/ +Source0: %{name}-%{version}.tar.gz + + +%define debug_package %{nil} + +BuildRequires: python-setuptools +BuildRequires: python2-pip +BuildRequires: fdupes + +%description +StarlingX software for Network Function Virtualization Infrastructure support. + +%define local_bindir /usr/bin/ +%define pythonroot /usr/lib64/python2.7/site-packages + +%define build_python() { \ + pushd %1; \ + %{__python} setup.py build; \ + popd;} + + +%define install_python() { \ + pushd %1; \ + %{__python} setup.py install \ + --root=$RPM_BUILD_ROOT \ + --install-lib=%{pythonroot} \ + --prefix=/usr \ + --install-data=/usr/share \ + --single-version-externally-managed; \ + popd;} + + +%package -n nfv-common +Requires: librt.so.1()(64bit) +Summary: Network Function Virtualization Common +Group: System/Packages + +%description -n nfv-common +Network Function Virtualization Common + +%package -n nfv-plugins +Summary: Network Function Virtualization Plugins +Group: System/Packages + +%description -n nfv-plugins +Network Function Virtualization Plugins + +%package -n nfv-tools +Summary: Network Function Virtualization Tools%{pythonroot} +Group: System/Packages + +%description -n nfv-tools +Network Function Virtualization Tools + + +%package -n nfv-vim +Summary: Virtual Infrastructure Manager +Group: System/Packages + +%description -n nfv-vim +Virtual Infrastructure Manager + +%package -n nfv-client +Summary: Network Function Virtualization Client +Group: System/Packages + +%description -n nfv-client +Network Function Virtualization Client + +%prep +%setup -n %{name}-%{version} + +# use actual value of %%{_systx-nfv-%{version}.tar.gzsconfdir} to repace @SYSCONFDIR@ in config files +# use actual value of %%{pythonroot} to replace @PYTHONROOT@ in config.ini. +sed -i -e 's|@SYSCONFDIR@|%{_sysconfdir}|g' nfv-vim/scripts/vim +sed -i -e 's|@SYSCONFDIR@|%{_sysconfdir}|g' nfv-vim/scripts/vim-api +sed -i -e 's|@SYSCONFDIR@|%{_sysconfdir}|g' nfv-vim/scripts/vim-webserver +sed -i -e 's|@SYSCONFDIR@|%{_sysconfdir}|g' nfv-vim/nfv_vim/config.ini +sed -i -e 's|@PYTHONROOT@|%{pythonroot}|g' nfv-vim/nfv_vim/config.ini + +%build +%build_python nfv-common +%build_python nfv-plugins +%build_python nfv-tools +%build_python nfv-vim +%build_python nfv-client + +%install +%install_python nfv-common +%install_python nfv-plugins +%install_python nfv-tools +%install_python nfv-vim +%install_python nfv-client + +# nfv-client +install -d -m 755 %{buildroot}%{_sysconfdir}/bash_completion.d +install -m 444 nfv-client/scripts/sw-manager.completion %{buildroot}%{_sysconfdir}/bash_completion.d/sw-manager + +# nfv-plugins +install -d -m 755 %{buildroot}/%{_sysconfdir}/nfv/ +install -d -m 755 %{buildroot}/%{_sysconfdir}/nfv/nfv_plugins/ +install -d -m 755 %{buildroot}/%{_sysconfdir}/nfv/nfv_plugins/alarm_handlers/ +install -p -D -m 600 nfv-plugins/nfv_plugins/alarm_handlers/config.ini %{buildroot}/%{_sysconfdir}/nfv/nfv_plugins/alarm_handlers/config.ini +install -d -m 755 %{buildroot}/%{_sysconfdir}/nfv/nfv_plugins/event_log_handlers/ +install -p -D -m 600 nfv-plugins/nfv_plugins/event_log_handlers/config.ini %{buildroot}/%{_sysconfdir}/nfv/nfv_plugins/event_log_handlers/config.ini +install -d -m 755 %{buildroot}/%{_sysconfdir}/nfv/nfv_plugins/nfvi_plugins/ +install -p -D -m 600 nfv-plugins/nfv_plugins/nfvi_plugins/config.ini %{buildroot}/%{_sysconfdir}/nfv/nfv_plugins/nfvi_plugins/config.ini +install -d -m 755 %{buildroot}/ +install -p -D -m 644 nfv-plugins/scripts/nfvi-plugins.logrotate %{buildroot}/%{_sysconfdir}/logrotate.d/nfvi-plugins.logrotate + +# nfv-vim +install -d -m 755 %{buildroot}/usr/lib/ocf/resource.d/nfv +install -p -D -m 755 nfv-vim/scripts/vim %{buildroot}/usr/lib/ocf/resource.d/nfv/vim +install -p -D -m 755 nfv-vim/scripts/vim-api %{buildroot}/usr/lib/ocf/resource.d/nfv/vim-api +install -p -D -m 755 nfv-vim/scripts/vim-webserver %{buildroot}/usr/lib/ocf/resource.d/nfv/vim-webserver +install -d -m 755 %{buildroot}/%{_sysconfdir}/nfv/ +install -d -m 755 %{buildroot}/%{_sysconfdir}/nfv/vim/ +install -p -D -m 600 nfv-vim/nfv_vim/config.ini %{buildroot}/%{_sysconfdir}/nfv/vim/config.ini +install -p -D -m 600 nfv-vim/nfv_vim/debug.ini %{buildroot}/%{_sysconfdir}/nfv/vim/debug.ini + +%fdupes %{buildroot}%{pythonroot} + + +%post -n nfv-common + +%post -n nfv-plugins + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) + +%files -n nfv-common +%defattr(-,root,root,-) +%doc nfv-common/LICENSE +%dir %{pythonroot}/nfv_common/ +%{pythonroot}/nfv_common/* +%dir %{pythonroot}/windriver_nfv_common_plugins-%{version}-py2.7.egg-info +%{pythonroot}/windriver_nfv_common_plugins-%{version}-py2.7.egg-info/* + +%files -n nfv-plugins +%dir /etc/nfv +%defattr(-,root,root,-) +%doc nfv-plugins/LICENSE +%config %{_sysconfdir}/logrotate.d/ +%{_sysconfdir}/logrotate.d/nfvi-plugins.logrotate +%dir %{_sysconfdir}/nfv/nfv_plugins/ +%config(noreplace)/%{_sysconfdir}/nfv/nfv_plugins/alarm_handlers/config.ini +%config(noreplace)/%{_sysconfdir}/nfv/nfv_plugins/event_log_handlers/config.ini +%config(noreplace)/%{_sysconfdir}/nfv/nfv_plugins/nfvi_plugins/config.ini +%{_sysconfdir}/nfv/nfv_plugins/* +%dir %{pythonroot}/nfv_plugins/ +%{pythonroot}/nfv_plugins/* +%dir %{pythonroot}/windriver_nfv_plugins-%{version}-py2.7.egg-info +%{pythonroot}/windriver_nfv_plugins-%{version}-py2.7.egg-info/* + +%files -n nfv-tools +%defattr(-,root,root,-) +%doc nfv-tools/LICENSE +%{local_bindir}/nfv-forensic +%{local_bindir}/nfv-notify +%dir %{pythonroot}/nfv_tools/ +%{pythonroot}/nfv_tools/* +%dir %{pythonroot}/nfv_tools-%{version}-py2.7.egg-info +%{pythonroot}/nfv_tools-%{version}-py2.7.egg-info/* + +%files -n nfv-vim +%dir /etc/nfv +%dir /usr/lib/ocf +%dir /usr/lib/ocf/resource.d +%defattr(-,root,root,-) +%doc nfv-vim/LICENSE +%{local_bindir}/nfv-vim +%{local_bindir}/nfv-vim-api +%{local_bindir}/nfv-vim-manage +%{local_bindir}/nfv-vim-webserver +%dir %{_sysconfdir}/nfv/vim/ +%config(noreplace)/%{_sysconfdir}/nfv/vim/config.ini +%config(noreplace)/%{_sysconfdir}/nfv/vim/debug.ini +%dir /usr/lib/ocf/resource.d/nfv/ +/usr/lib/ocf/resource.d/nfv/vim +/usr/lib/ocf/resource.d/nfv/vim-api +/usr/lib/ocf/resource.d/nfv/vim-webserver +%dir %{pythonroot}/nfv_vim/ +%{pythonroot}/nfv_vim/* +%dir %{pythonroot}/nfv_vim-%{version}-py2.7.egg-info +%{pythonroot}/nfv_vim-%{version}-py2.7.egg-info/* + +%files -n nfv-client +%defattr(-,root,root,-) +%doc nfv-client/LICENSE +%{local_bindir}/sw-manager +%{_sysconfdir}/bash_completion.d/sw-manager +%dir %{pythonroot}/nfv_client/ +%{pythonroot}/nfv_client/* +%dir %{pythonroot}/nfv_client-%{version}-py2.7.egg-info +%{pythonroot}/nfv_client-%{version}-py2.7.egg-info/* + +%changelog diff --git a/nova-api-proxy/opensuse/nova-api-proxy.changes b/nova-api-proxy/opensuse/nova-api-proxy.changes new file mode 100644 index 00000000..eff99274 --- /dev/null +++ b/nova-api-proxy/opensuse/nova-api-proxy.changes @@ -0,0 +1,15 @@ +------------------------------------------------------------------- +Tue Sep 17 06:45:00 UTC 2019 - Dominig ar Foll Intel Open Source + +- move to _service to get source from git repo +------------------------------------------------------------------- +Thu Jun 20 14:47:42 UTC 2019 - Marcela Rosales + +- Modify Requires to use openSUSE's python2-Routes package instead of python-routes +- Delete unused nfv.changes file + +------------------------------------------------------------------- +Tue May 28 09:07:26 UTC 2019 - Marcela Rosales + +- Initial Commit + diff --git a/nova-api-proxy/opensuse/nova-api-proxy.rpmlintrc b/nova-api-proxy/opensuse/nova-api-proxy.rpmlintrc new file mode 100644 index 00000000..adc59bf3 --- /dev/null +++ b/nova-api-proxy/opensuse/nova-api-proxy.rpmlintrc @@ -0,0 +1 @@ +setBadness('script-without-shebang', 2) diff --git a/nova-api-proxy/opensuse/nova-api-proxy.spec b/nova-api-proxy/opensuse/nova-api-proxy.spec new file mode 100644 index 00000000..82ee2598 --- /dev/null +++ b/nova-api-proxy/opensuse/nova-api-proxy.spec @@ -0,0 +1,76 @@ +Summary: Nova Compute API Proxy +Name: nova-api-proxy +Version: 1.0.0 +Release: %{tis_patch_ver}%{?_tis_dist} +License: Apache-2.0 +Group: System/Packages +URL: https://opendev.org/starlingx/nfv/ +Source0: %{name}-%{version}.tar.gz + +%define debug_package %{nil} + +BuildRequires: python-setuptools +BuildRequires: python2-pip +Requires: python-eventlet +Requires: python2-Routes +Requires: python-webob +Requires: python-paste +BuildRequires: fdupes + +%description +The Nova Compute API Proxy + +%define local_bindir %{_bindir} +%define local_initddir %{_sysconfdir}/rc.d/init.d +%define pythonroot %{_libdir}/python2.7/site-packages +%define local_etc_systemd %{_sysconfdir}/systemd/system/ +%define local_proxy_conf %{_sysconfdir}/proxy/ + +%prep +%setup -n %{name}-%{version}/%{name} + +%build +%{__python} setup.py build + +%install +%{__python} setup.py install --root=$RPM_BUILD_ROOT \ + --install-lib=%{pythonroot} \ + --prefix=%{_prefix} \ + --install-data=%{_prefix}/share \ + --single-version-externally-managed + +install -d -m 755 %{buildroot}%{local_etc_systemd} +install -p -D -m 644 nova_api_proxy/scripts/api-proxy.service %{buildroot}%{local_etc_systemd}/api-proxy.service +install -d -m 755 %{buildroot}%{local_initddir} +install -p -D -m 755 nova_api_proxy/scripts/api-proxy %{buildroot}%{local_initddir}/api-proxy + +install -d -m 755 %{buildroot}%{local_proxy_conf} +install -p -D -m 600 nova_api_proxy/nova-api-proxy.conf %{buildroot}%{local_proxy_conf}/nova-api-proxy.conf +install -p -D -m 600 nova_api_proxy/api-proxy-paste.ini %{buildroot}%{local_proxy_conf}/api-proxy-paste.ini + +%fdupes %{buildroot}%{pythonroot} + +%clean +rm -rf $RPM_BUILD_ROOT + +# Note: Package name is nova-api-proxy but import is nova_api_proxy so can't +# use '%%{name}'. +%files +%defattr(-,root,root,-) +%dir %{_sysconfdir}/proxy +%dir %{_sysconfdir}/rc.d +%dir %{_sysconfdir}/rc.d/init.d +%dir %{_sysconfdir}/systemd +%dir %{_sysconfdir}/systemd/system +%dir %{_libdir}/python2.7/site-packages/api_proxy-1.0.0-py2.7.egg-info +%doc LICENSE +%{local_bindir}/* +%{local_initddir}/* +%{local_etc_systemd}/* +%config(noreplace) %{local_proxy_conf}/nova-api-proxy.conf +%{local_proxy_conf}/api-proxy-paste.ini +%dir %{pythonroot}/nova_api_proxy +%{pythonroot}/nova_api_proxy/* +%{pythonroot}/api_proxy-%{version}-py2.7.egg-info/* + +%changelog