diff --git a/storageconfig/centos/storageconfig.spec b/storageconfig/centos/storageconfig.spec index 83a6695c88..fc603f607c 100644 --- a/storageconfig/centos/storageconfig.spec +++ b/storageconfig/centos/storageconfig.spec @@ -15,7 +15,6 @@ Initial storage node configuration %define local_etc_initd /etc/init.d/ %define local_etc_goenabledd /etc/goenabled.d/ -%define local_etc_systemd /etc/systemd/system/ %define debug_package %{nil} @@ -25,16 +24,10 @@ Initial storage node configuration %build %install - -install -d -m 755 %{buildroot}%{local_etc_initd} -install -p -D -m 700 storage_config %{buildroot}%{local_etc_initd}/storage_config - -install -d -m 755 %{buildroot}%{local_etc_goenabledd} -install -p -D -m 755 config_goenabled_check.sh %{buildroot}%{local_etc_goenabledd}/config_goenabled_check.sh - -install -d -m 755 %{buildroot}%{local_etc_systemd} -install -p -D -m 664 storageconfig.service %{buildroot}%{local_etc_systemd}/storageconfig.service -#install -p -D -m 664 config.service %{buildroot}%{local_etc_systemd}/config.service +make install \ + INITDDIR=%{buildroot}%{local_etc_initd} \ + GOENABLEDDIR=%{buildroot}%{local_etc_goenabledd} \ + SYSTEMDDIR=%{buildroot}%{_unitdir} %post systemctl enable storageconfig.service @@ -48,11 +41,11 @@ systemctl enable storageconfig.service # update-rc.d $OPT storage_config defaults 60 %clean -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc LICENSE %{local_etc_initd}/* %{local_etc_goenabledd}/* -%{local_etc_systemd}/* +%{_unitdir}/* diff --git a/storageconfig/storageconfig/Makefile b/storageconfig/storageconfig/Makefile new file mode 100644 index 0000000000..3a9053bdbb --- /dev/null +++ b/storageconfig/storageconfig/Makefile @@ -0,0 +1,15 @@ +# +# 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 -p -D -m 700 storage_config $(INITDDIR)/storage_config + install -d -m 755 $(GOENABLEDDIR) + install -p -D -m 755 config_goenabled_check.sh $(GOENABLEDDIR)/config_goenabled_check.sh + install -d -m 755 $(SYSTEMDDIR) + install -p -D -m 664 storageconfig.service $(SYSTEMDDIR)/storageconfig.service