Skip to content

Commit 644da63

Browse files
authored
Update tomcat.spec
1 parent f171306 commit 644da63

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

tomcat.spec

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,24 @@ mkdir -p %{buildroot}/%{catalina_base}/temp
8383
mkdir -p %{buildroot}/%{catalina_base}/logs
8484
cp -r work %{buildroot}/%{catalina_base}
8585

86+
#Conditions for installing the manager and host-manager applications
87+
#If a fresh install, manager application will be installed
88+
#If an upgrade, manager application will only be upgraded IF it currently exists within the Tomcat webapps directory.
89+
#This gives users the ability to remove the manager applications if unneedded and them not be reinstalled during upgrades.
90+
if [ "$1" == 1 ]; then
91+
# Fresh install
92+
cp -r %{catalina_home}/webapps/manager %{catalina_base}/webapps/
93+
cp -r %{catalina_home}/webapps/host-manager %{catalina_base}/webapps/
94+
elif [ "$1" == 2 ]; then
95+
# Upgrade
96+
if [ -d %{catalina_base}/webapps/manager ]; then
97+
cp -r %{catalina_home}/webapps/manager %{catalina_base}/webapps/
98+
fi
99+
if [ -d %{catalina_base}/webapps/host-manager ]; then
100+
cp -r %{catalina_home}/webapps/host-manager %{catalina_base}/webapps/
101+
fi
102+
fi
103+
86104
%files
87105
%attr(0644,root,root) %{_unitdir}/tomcat9.service
88106
%defattr(0640,tomcat,%tomcat_group,0750)
@@ -120,22 +138,4 @@ if [ "$1" == 2 ]; then
120138
fi
121139
fi
122140

123-
#Conditions for installing the manager and host-manager applications
124-
#If a fresh install, manager application will be installed
125-
#If an upgrade, manager application will only be upgraded IF it currently exists within the Tomcat webapps directory.
126-
#This gives users the ability to remove the manager applications if unneedded and them not be reinstalled during upgrades.
127-
if [ "$1" == 1 ]; then
128-
# Fresh install
129-
cp -r %{catalina_home}/webapps/manager %{catalina_base}/webapps/
130-
cp -r %{catalina_home}/webapps/host-manager %{catalina_base}/webapps/
131-
elif [ "$1" == 2 ]; then
132-
# Upgrade
133-
if [ -d %{catalina_base}/webapps/manager ]; then
134-
cp -r %{catalina_home}/webapps/manager %{catalina_base}/webapps/
135-
fi
136-
if [ -d %{catalina_base}/webapps/host-manager ]; then
137-
cp -r %{catalina_home}/webapps/host-manager %{catalina_base}/webapps/
138-
fi
139-
fi
140-
141141

0 commit comments

Comments
 (0)