Create makefile for computeconfig
A makefile with the install target was created for computeconfig. The specfile was updated accordingly. Story: 2004043 Task: 27548 Change-Id: I25fc8bcb269dd9c5222b2c2b9db537c2b68601ba Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
This commit is contained in:
parent
af2f75a17c
commit
f7f2d9b512
|
@ -15,23 +15,23 @@ Requires: systemd
|
||||||
%description
|
%description
|
||||||
Initial compute node configuration
|
Initial compute node configuration
|
||||||
|
|
||||||
%package -n computeconfig-standalone
|
%package -n computeconfig-standalone
|
||||||
Summary: computeconfig
|
Summary: computeconfig
|
||||||
Group: base
|
Group: base
|
||||||
|
|
||||||
%description -n computeconfig-standalone
|
|
||||||
Initial compute node configuration
|
|
||||||
|
|
||||||
%package -n computeconfig-subfunction
|
%description -n computeconfig-standalone
|
||||||
|
Initial compute node configuration
|
||||||
|
|
||||||
|
%package -n computeconfig-subfunction
|
||||||
Summary: computeconfig
|
Summary: computeconfig
|
||||||
Group: base
|
Group: base
|
||||||
|
|
||||||
%description -n computeconfig-subfunction
|
%description -n computeconfig-subfunction
|
||||||
Initial compute node configuration
|
Initial compute node configuration
|
||||||
|
|
||||||
%define local_etc_initd /etc/init.d/
|
%define initddir /etc/init.d/
|
||||||
%define local_goenabledd /etc/goenabled.d/
|
%define goenableddir /etc/goenabled.d/
|
||||||
%define local_etc_systemd /etc/systemd/system/
|
%define systemddir /etc/systemd/system/
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup
|
%setup
|
||||||
|
@ -39,61 +39,47 @@ Initial compute node configuration
|
||||||
%build
|
%build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
install -d -m 755 %{buildroot}%{local_etc_initd}
|
make install INITDDIR=%{buildroot}%{initddir} GOENABLEDDIR=%{buildroot}%{goenableddir} SYSTEMDDIR=%{buildroot}%{systemddir}
|
||||||
install -p -D -m 700 compute_config %{buildroot}%{local_etc_initd}/compute_config
|
|
||||||
install -p -D -m 700 compute_services %{buildroot}%{local_etc_initd}/compute_services
|
|
||||||
|
|
||||||
install -d -m 755 %{buildroot}%{local_goenabledd}
|
|
||||||
install -p -D -m 755 config_goenabled_check.sh %{buildroot}%{local_goenabledd}/config_goenabled_check.sh
|
|
||||||
|
|
||||||
install -d -m 755 %{buildroot}%{local_etc_systemd}
|
|
||||||
install -d -m 755 %{buildroot}%{local_etc_systemd}/config
|
|
||||||
install -p -D -m 664 computeconfig.service %{buildroot}%{local_etc_systemd}/config/computeconfig-standalone.service
|
|
||||||
install -p -D -m 664 computeconfig-combined.service %{buildroot}%{local_etc_systemd}/config/computeconfig-combined.service
|
|
||||||
#install -p -D -m 664 config.service %{buildroot}%{local_etc_systemd}/config.service
|
|
||||||
|
|
||||||
%post -n computeconfig-standalone
|
%post -n computeconfig-standalone
|
||||||
if [ ! -e $D%{local_etc_systemd}/computeconfig.service ]; then
|
if [ ! -e $D%{systemddir}/computeconfig.service ]; then
|
||||||
cp $D%{local_etc_systemd}/config/computeconfig-standalone.service $D%{local_etc_systemd}/computeconfig.service
|
cp $D%{systemddir}/config/computeconfig-standalone.service $D%{systemddir}/computeconfig.service
|
||||||
else
|
else
|
||||||
cmp -s $D%{local_etc_systemd}/config/computeconfig-standalone.service $D%{local_etc_systemd}/computeconfig.service
|
cmp -s $D%{systemddir}/config/computeconfig-standalone.service $D%{systemddir}/computeconfig.service
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rm -f $D%{local_etc_systemd}/computeconfig.service
|
rm -f $D%{systemddir}/computeconfig.service
|
||||||
cp $D%{local_etc_systemd}/config/computeconfig-standalone.service $D%{local_etc_systemd}/computeconfig.service
|
cp $D%{systemddir}/config/computeconfig-standalone.service $D%{systemddir}/computeconfig.service
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
systemctl enable computeconfig.service
|
systemctl enable computeconfig.service
|
||||||
|
|
||||||
|
|
||||||
%post -n computeconfig-subfunction
|
%post -n computeconfig-subfunction
|
||||||
if [ ! -e $D%{local_etc_systemd}/computeconfig.service ]; then
|
if [ ! -e $D%{systemddir}/computeconfig.service ]; then
|
||||||
cp $D%{local_etc_systemd}/config/computeconfig-combined.service $D%{local_etc_systemd}/computeconfig.service
|
cp $D%{systemddir}/config/computeconfig-combined.service $D%{systemddir}/computeconfig.service
|
||||||
else
|
else
|
||||||
cmp -s $D%{local_etc_systemd}/config/computeconfig-combined.service $D%{local_etc_systemd}/computeconfig.service
|
cmp -s $D%{systemddir}/config/computeconfig-combined.service $D%{systemddir}/computeconfig.service
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rm -f $D%{local_etc_systemd}/computeconfig.service
|
rm -f $D%{systemddir}/computeconfig.service
|
||||||
cp $D%{local_etc_systemd}/config/computeconfig-combined.service $D%{local_etc_systemd}/computeconfig.service
|
cp $D%{systemddir}/config/computeconfig-combined.service $D%{systemddir}/computeconfig.service
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
systemctl enable computeconfig.service
|
systemctl enable computeconfig.service
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
# rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc LICENSE
|
%doc LICENSE
|
||||||
%{local_etc_initd}/*
|
%{initddir}/*
|
||||||
|
|
||||||
%files -n computeconfig-standalone
|
%files -n computeconfig-standalone
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%dir %{local_etc_systemd}/config
|
%dir %{systemddir}/config
|
||||||
%{local_etc_systemd}/config/computeconfig-standalone.service
|
%{systemddir}/config/computeconfig-standalone.service
|
||||||
#%{local_etc_systemd}/config.service
|
%{goenableddir}/*
|
||||||
%{local_goenabledd}/*
|
|
||||||
|
|
||||||
%files -n computeconfig-subfunction
|
%files -n computeconfig-subfunction
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%dir %{local_etc_systemd}/config
|
%dir %{systemddir}/config
|
||||||
%{local_etc_systemd}/config/computeconfig-combined.service
|
%{systemddir}/config/computeconfig-combined.service
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
INITDDIR ?= /etc/init.d/
|
||||||
|
GOENABLEDDIR ?= /etc/goenabled.d/
|
||||||
|
SYSTEMDDIR ?= /etc/systemd/system/
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -d -m 755 $(INITDDIR)
|
||||||
|
install -d -m 755 $(GOENABLEDDIR)
|
||||||
|
install -d -m 755 $(SYSTEMDDIR)
|
||||||
|
install -d -m 755 $(SYSTEMDDIR)/config
|
||||||
|
install -p -D -m 700 compute_config $(INITDDIR)/compute_config
|
||||||
|
install -p -D -m 700 compute_services $(INITDDIR)/compute_services
|
||||||
|
install -p -D -m 755 config_goenabled_check.sh $(GOENABLEDDIR)/config_goenabled_check.sh
|
||||||
|
install -p -D -m 664 computeconfig.service $(SYSTEMDDIR)/config/computeconfig-standalone.service
|
||||||
|
install -p -D -m 664 computeconfig-combined.service $(SYSTEMDDIR)/config/computeconfig-combined.service
|
Loading…
Reference in New Issue