This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move non-essentials (documentation, etc) into separate RPM (#1754)
- Loading branch information
1 parent
93a248f
commit ec8fb04
Showing
41 changed files
with
764 additions
and
143 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
earth_enterprise/rpms/opengee-extra/snippets/post-install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2020 The Open GEE Contributors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
umask 002 | ||
|
||
main_postinstall() | ||
{ | ||
if [ -f "/etc/init.d/geserver" ]; then | ||
install_searchexample_database | ||
|
||
# Set up the ExampleSearch plugin. The opengee-server-core RPM does | ||
# this by calling geresetpgdb, but there's no need to do a full reset | ||
# here. | ||
"$BASEINSTALLDIR_OPT/bin/psql" -q -d gesearch geuser -f "$SQLDIR/examplesearch.sql" | ||
|
||
service geserver restart | ||
fi | ||
|
||
if [ -f "/etc/init.d/gefusion" ]; then | ||
service gefusion stop | ||
add_fusion_tutorial_volume | ||
service gefusion start | ||
fi | ||
} | ||
|
||
main_postinstall $@ |
47 changes: 47 additions & 0 deletions
47
earth_enterprise/rpms/opengee-extra/snippets/pre-uninstall.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2020 The Open GEE Contributors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
main_preuninstall() | ||
{ | ||
# If the server is still installed then we need to remove the ExampleSearch | ||
# database entries. If the server has been uninstalled, the database is | ||
# already gone. | ||
if [ -f "/etc/init.d/geserver" ]; then | ||
echo "Deleting SearchExample Database" | ||
run_as_user "$GEPGUSER" "/opt/google/share/searchexample/searchexample delete" | ||
"$BASEINSTALLDIR_OPT/bin/psql" -q -d gesearch geuser -f "$SQLDIR/examplesearch_delete.sql" | ||
service geserver restart | ||
fi | ||
|
||
# If Fusion is still installed then we need to remove the tutorial source | ||
# volume. If fusion is no longer installed then there's nothing to do. | ||
if [ -f "/etc/init.d/gefusion" ]; then | ||
sudo service gefusion stop | ||
echo "Removing Tutorial Source Volume" | ||
"$BASEINSTALLDIR_OPT/bin/geconfigureassetroot" --noprompt --nochown \ | ||
--assetroot "$ASSET_ROOT" --removevolume opt | ||
sudo service gefusion start | ||
fi | ||
} | ||
|
||
# On Red Hat this script could be called as part of an upgrade. The first | ||
# argument to the script will be 0 if this is a full uninstall. | ||
# On Debian systems the first parameter is "upgrade", "remove" or "purge". | ||
# (See <https://wiki.debian.org/MaintainerScripts>.) | ||
if [ "$1" = "0" ] || [ "$1" = "remove" ] || [ "$1" = "purge" ]; then | ||
main_preuninstall $@ | ||
fi |
7 changes: 7 additions & 0 deletions
7
earth_enterprise/rpms/opengee-extra/src/post-install.sh.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<%= | ||
// Prefix variable definitions to install script: | ||
new File("${project.buildDir}/shared/install-utils.sh").text | ||
%> | ||
<%= new File("${project.buildDir}/shared/searchexample.sh").text %> | ||
<%= new File("${project.buildDir}/shared/fusiontutorial.sh").text %> | ||
<%= new File(thisTemplateFile.parent, '../snippets/post-install.sh').text %> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...engee-fusion/src/post-install.sh.template → ...-fusion-core/src/post-install.sh.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<%= new File("${project.buildDir}/shared/install-utils.sh").text %> | ||
<%= new File("${project.buildDir}/shared/fusiontutorial.sh").text %> | ||
<%= new File(thisTemplateFile.parent, '../snippets/post-install.sh').text %> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
earth_enterprise/rpms/opengee-server-core/src/pre-uninstall.sh.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%= new File("${project.buildDir}/shared/install-utils.sh").text %> | ||
<%= new File(thisTemplateFile.parent, '../snippets/pre-uninstall.sh').text %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2020 The Open GEE Contributors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
add_fusion_tutorial_volume() | ||
{ | ||
# The tutorial directory can't be added as a source volume until | ||
# opengee-fusion-core and opengee-extra are both installed. Both RPMs call | ||
# this function, but only the second one will actually add the volume. | ||
|
||
CONFIG_ASSET_ROOT="${BASEINSTALLDIR_OPT}/bin/geconfigureassetroot" | ||
if [[ -d "${FUSION_TUTORIAL_DIR}" && -f "${CONFIG_ASSET_ROOT}" ]]; then | ||
RET_VAL=0 | ||
"${CONFIG_ASSET_ROOT}" --addvolume \ | ||
"opt:${FUSION_TUTORIAL_DIR}" --noprompt --nochown || RET_VAL=$? | ||
if [ "$RET_VAL" -eq "255" ]; then | ||
cat <<END | ||
The geconfigureassetroot utility has failed while attempting | ||
to add the volume 'opt:${FUSION_TUTORIAL_DIR}'. | ||
This is probably because a volume named 'opt' already exists. | ||
END | ||
fi | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2020 The Open GEE Contributors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
install_searchexample_database() | ||
{ | ||
# The search example database can only be installed after opengee-server-core | ||
# (which provides postgresql) and opengee-extra (which provides searchexample) | ||
# are both installed. Both RPMs call this function and the second one will | ||
# run the install. | ||
|
||
if [[ -f "${PGSQL_PROGRAM}" && -f "${SEARCH_EX_SCRIPT}" ]]; then | ||
echo "Installing SearchExample Database" | ||
run_as_user "$GEPGUSER" "/opt/google/share/searchexample/searchexample create" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= new File(thisTemplateFile.parent, '../snippets/fusiontutorial.sh').text %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= new File(thisTemplateFile.parent, '../snippets/searchexample.sh').text %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.