77# with the License. You may obtain a copy of the License at
88#
99# http://www.apache.org/licenses/LICENSE-2.0
10- #
10+ #
1111# Unless required by applicable law or agreed to in writing,
1212# software distributed under the License is distributed on an
1313# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -86,7 +86,7 @@ Requires: iptables-services
8686Group: System Environment/Libraries
8787%description management
8888The CloudStack management server is the central point of coordination,
89- management, and intelligence in CloudStack.
89+ management, and intelligence in CloudStack.
9090
9191%package common
9292Summary: Apache CloudStack common files and scripts
@@ -107,9 +107,6 @@ Requires: iptables
107107Requires: ethtool
108108Requires: iproute
109109Requires: ipset
110- Requires: jsvc
111- Requires: jakarta-commons-daemon
112- Requires: jakarta-commons-daemon-jsvc
113110Requires: perl
114111Requires: libvirt-python
115112Requires: qemu-img
@@ -179,10 +176,10 @@ if [ "%{_ossnoss}" == "NOREDIST" -o "%{_ossnoss}" == "noredist" ] ; then
179176 FLAGS= "$FLAGS -Dnoredist"
180177fi
181178
182- if [ "%{_sim }" == "SIMULATOR" -o "%{_sim }" == "simulator" ] ; then
179+ if [ "%{_sim }" == "SIMULATOR" -o "%{_sim }" == "simulator" ] ; then
183180 echo "Adding simulator flag to the maven build"
184181 FLAGS= "$FLAGS -Dsimulator"
185- fi
182+ fi
186183
187184mvn -Psystemvm -DskipTests $FLAGS clean package
188185
@@ -206,6 +203,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-common/scripts
206203mkdir -p ${RPM_BUILD_ROOT}%{_datadir }/%{name }-common/vms
207204mkdir -p ${RPM_BUILD_ROOT}%{python_sitearch }/
208205mkdir -p ${RPM_BUILD_ROOT}%/usr/bin
206+ mkdir -p ${RPM_BUILD_ROOT}/usr/lib/systemd/system
209207cp -r scripts/* ${RPM_BUILD_ROOT}%{_datadir }/%{name }-common/scripts
210208install -D systemvm/dist/systemvm.iso ${RPM_BUILD_ROOT}%{_datadir }/%{name }-common/vms/systemvm.iso
211209install -D systemvm/dist/systemvm.zip ${RPM_BUILD_ROOT}%{_datadir }/%{name }-common/vms/systemvm.zip
@@ -215,7 +213,7 @@ python -m py_compile ${RPM_BUILD_ROOT}%{python_sitearch}/cloud_utils.py
215213python -m compileall ${RPM_BUILD_ROOT}%{python_sitearch }/cloudutils
216214cp build/gitrev.txt ${RPM_BUILD_ROOT}%{_datadir }/%{name }-common/scripts
217215cp packaging/centos7/cloudstack-sccs ${RPM_BUILD_ROOT}/usr/bin
218-
216+
219217mkdir -p ${RPM_BUILD_ROOT}%{_datadir }/%{name }-common/scripts/network/cisco
220218cp -r plugins/network-elements/cisco-vnmc/scripts/network/cisco/* ${RPM_BUILD_ROOT}%{_datadir }/%{name }-common/scripts/network/cisco
221219
@@ -294,7 +292,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent
294292mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir }/log/%{name }/agent
295293mkdir -p ${RPM_BUILD_ROOT}%{_datadir }/%{name }-agent/lib
296294mkdir -p ${RPM_BUILD_ROOT}%{_datadir }/%{name }-agent/plugins
297- install -D packaging/centos7/cloud -agent.rc ${RPM_BUILD_ROOT}%{ _sysconfdir }/init.d/%{ name } -agent
295+ install -D packaging/systemd/cloudstack -agent.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/cloudstack -agent.service
298296install -D agent/target/transformed/agent.properties ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/agent/agent.properties
299297install -D agent/target/transformed/environment.properties ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/agent/environment.properties
300298install -D agent/target/transformed/log4j-cloud.xml ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/agent/log4j-cloud.xml
@@ -365,15 +363,14 @@ if [ "$1" == "1" ] ; then
365363fi
366364
367365if [ ! -f %{_datadir }/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util ] ; then
368- echo Please download vhd-util from http://download.cloud.com.s3.amazonaws.com/tools/vhd-util and put it in
366+ echo Please download vhd-util from http://download.cloud.com.s3.amazonaws.com/tools/vhd-util and put it in
369367 echo %{_datadir }/cloudstack-common/scripts/vm/hypervisor/xenserver/
370368fi
371369
372370%preun agent
373371/sbin/service cloudstack-agent stop || true
374372if [ " $1 " == " 0" ] ; then
375373 /sbin/chkconfig --del cloudstack-agent > /dev/null 2>&1 || true
376- /sbin/service cloudstack-agent stop > /dev/null 2>&1 || true
377374fi
378375
379376%pre agent
@@ -393,8 +390,7 @@ if [ "$1" == "1" ] ; then
393390 fi
394391 cp -a ${RPM_BUILD_ROOT} %{_datadir}/%{name}-agent/lib/libvirtqemuhook %{_sysconfdir}/libvirt/hooks/qemu
395392 /sbin/service libvirtd restart
396- /sbin/chkconfig --add cloudstack-agent > /dev/null 2>&1 || true
397- /sbin/chkconfig --level 345 cloudstack-agent on > /dev/null 2>&1 || true
393+ /sbin/systemctl enable cloudstack-agent > /dev/null 2>&1 || true
398394fi
399395
400396# if saved configs from upgrade exist, copy them over
0 commit comments