@@ -83,6 +83,24 @@ mkdir -p %{buildroot}/%{catalina_base}/temp
83
83
mkdir -p %{buildroot }/%{catalina_base }/logs
84
84
cp -r work %{buildroot }/%{catalina_base }
85
85
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
+
86
104
%files
87
105
%attr(0644,root,root) %{_unitdir }/tomcat9.service
88
106
%defattr(0640,tomcat,%tomcat_group,0750)
@@ -120,22 +138,4 @@ if [ "$1" == 2 ]; then
120
138
fi
121
139
fi
122
140
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
-
141
141
0 commit comments