ha/service-mgmt/sm/opensuse/sm.spec
Abraham Arce f38de3f45f openSUSE: Open Build Service Artifacts
OBS is a generic system to build and distribute binary packages
from sources [0], StarlingX OBS Project:

- Cloud:StarlingX:2.0 [1]

Build Service Management uses Open Build Service (OBS) with the
following base artifacts under Service Management repository:

- Specfiles
- Changelogs
- Rpmlintrcs

The following components are included and succesfully building,
(with their source OBS repository):

- sm        [2]
- sm-common [3]
- sm-db     [4]
- sm-api    [5]
- sm-client [6]
- sm-tools  [7]

The following considerations are taken for Gerrit files:

- Added %changelog directive to all specfiles

The following considerations are taken for OBS _service files:

- Added parameter "extract" to get spec, changes and rpmlintrc files.
- All component version standardized to 1.0.0

[0] openbuildservice.org
[1] https://build.opensuse.org/project/show/Cloud:StarlingX:2.0
[2] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm
[3] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-common
[4] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-db
[5] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-api
[6] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-client
[7] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-tools

Story: 2006508
Task: 36495
Task: 36496
Task: 36497
Task: 36498
Task: 36534
Task: 36794

Change-Id: I06a7e132de4892b846d99977ff1bfc5bf240ade4
Co-authored-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2019-10-09 10:05:20 -05:00

93 lines
2.0 KiB
RPMSpec

Summary: Service Management
Name: sm
Version: 1.0.0
Release: 2
License: Apache-2.0
Group: System/Base
URL: https://www.starlingx.io
Source0: %{name}-%{version}.tar.gz
# Patches no applied to upstream yet.
Patch0: 0001-Change-shebang-to-help-rpm-runtime-dependency-detect.patch
BuildRequires: gcc-c++
BuildRequires: fm-common-dev
BuildRequires: libsm_db1-devel
BuildRequires: sm-common-devel
BuildRequires: mtce-devel
BuildRequires: glib2-devel
BuildRequires: glibc
BuildRequires: sqlite3-devel
BuildRequires: gcc
BuildRequires: libuuid-devel
BuildRequires: libjson-c3
BuildRequires: libjson-c-devel
BuildRequires: openssl-devel
BuildRequires: systemd-sysvinit
BuildRequires: insserv-compat
BuildRequires: systemd
BuildRequires: systemd-devel
Requires(post): systemd
Requires(preun): systemd
# Needed for /etc/init.d, can be removed when we go fully systemd
Requires: aaa_base
# Needed for /etc/logrotate.d
Requires: logrotate
# for collect stuff
Requires: time
%description
The StarlingX Service Managment system.
%prep
%setup -n %{name}-%{version}
%patch0 -p3
%build
VER=%{version}
MAJOR=`echo $VER | awk -F . '{print $1}'`
make -j"%(nproc)"
%install
rm -rf %{buildroot}
VER=%{version}
MAJOR=`echo $VER | awk -F . '{print $1}'`
make DEST_DIR=%{buildroot} UNIT_DIR=%{_unitdir} install
%pre
%service_add_pre sm.service
%service_add_pre sm-shutdown.service
%preun
%service_del_preun sm.service
%service_del_preun sm-shutdown.service
%post
%service_add_post sm.service
%service_add_post sm-shutdown.service
/usr/bin/systemctl enable sm.service >/dev/null 2>&1
/usr/bin/systemctl enable sm-shutdown.service >/dev/null 2>&1
%postun
%service_del_postun sm.service
%service_del_postun sm-shutdown.service
%files
%license LICENSE
%defattr(-,root,root,-)
%dir %{_sysconfdir}/pmon.d
%{_unitdir}/*
%{_bindir}/sm
/usr/local/sbin/sm-notify
/usr/local/sbin/sm-troubleshoot
/usr/local/sbin/sm-notification
%{_sysconfdir}/init.d/sm
%{_sysconfdir}/init.d/sm-shutdown
%config %{_sysconfdir}/pmon.d/sm.conf
%config %{_sysconfdir}/logrotate.d/sm.logrotate
%changelog