-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move maintainer scripts to be in their own files.
Refs #10271
- Loading branch information
1 parent
6c8911a
commit 00c7a09
Showing
5 changed files
with
150 additions
and
99 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
Code/Mantid/Build/CMake/Packaging/rpm/scripts/rpm_post_install.sh.in
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,22 @@ | ||
#!/bin/sh | ||
# | ||
# RPM post-install script for installation with ENVVARS_ON_INSTALL=True | ||
# Create links created inside installation directories along | ||
# with any other links inside /etc | ||
# | ||
ENVVARS_ON_INSTALL=@ENVVARS_ON_INSTALL_INT@ | ||
|
||
if [ ! -e @PKG_INSTALL_PREFIX@/@BIN_DIR@/mantidplot ]; then | ||
ln -s @PKG_INSTALL_PREFIX@/@BIN_DIR@/MantidPlot @PKG_INSTALL_PREFIX@/@BIN_DIR@/mantidplot | ||
fi | ||
|
||
if [ -f @PKG_INSTALL_PREFIX@/@BIN_DIR@/MantidPlot ]; then | ||
mv @PKG_INSTALL_PREFIX@/@BIN_DIR@/MantidPlot @PKG_INSTALL_PREFIX@/@BIN_DIR@/MantidPlot_exe | ||
ln -s @PKG_INSTALL_PREFIX@/@BIN_DIR@/launch_mantidplot.sh @PKG_INSTALL_PREFIX@/@BIN_DIR@/MantidPlot | ||
fi | ||
|
||
if [ ${ENVVARS_ON_INSTALL} -eq 1 ]; then | ||
# Link profiles to /etc/profile.d | ||
ln -s @PKG_INSTALL_PREFIX@/@ETC_DIR@/mantid.sh /etc/profile.d/mantid.sh | ||
ln -s @PKG_INSTALL_PREFIX@/@ETC_DIR@/mantid.csh /etc/profile.d/mantid.csh | ||
fi |
14 changes: 14 additions & 0 deletions
14
Code/Mantid/Build/CMake/Packaging/rpm/scripts/rpm_post_uninstall.sh.in
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,14 @@ | ||
#!/bin/sh | ||
# | ||
# RPM post-uninstall script | ||
# If the installation directory is empty then it is removed | ||
# | ||
|
||
# If the install prefix contains mantid then prune empty directories. | ||
# Begin extra cautious here just in case some has set the something like Prefix=/usr | ||
if echo \"@PKG_INSTALL_PREFIX@\" | grep -qi mantid; then | ||
find @PKG_INSTALL_PREFIX@ -mindepth 1 -type d -empty -delete | ||
rmdir --ignore-fail-on-non-empty -p @PKG_INSTALL_PREFIX@ | ||
else | ||
echo Install prefix does not contain the word mantid. Empty directories NOT removed. | ||
fi |
21 changes: 21 additions & 0 deletions
21
Code/Mantid/Build/CMake/Packaging/rpm/scripts/rpm_pre_install.sh.in
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,21 @@ | ||
#!/bin/sh | ||
# | ||
# RPM pre-install script for installation | ||
# Removes any stale links before they are recreated fresh | ||
# with any other links inside /etc if required | ||
# | ||
ENVVARS_ON_INSTALL=@ENVVARS_ON_INSTALL_INT@ | ||
|
||
if [ -h @PKG_INSTALL_PREFIX@/@BIN_DIR@/mantidplot ]; then | ||
rm @PKG_INSTALL_PREFIX@/@BIN_DIR@/mantidplot | ||
fi | ||
|
||
if [ ${ENVVARS_ON_INSTALL} -eq 1 ]; then | ||
# Profiles | ||
if [ -h /etc/profile.d/mantid.sh ]; then | ||
rm /etc/profile.d/mantid.sh | ||
fi | ||
if [ -h /etc/profile.d/mantid.csh ]; then | ||
rm /etc/profile.d/mantid.csh | ||
fi | ||
fi |
21 changes: 21 additions & 0 deletions
21
Code/Mantid/Build/CMake/Packaging/rpm/scripts/rpm_pre_uninstall.sh.in
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,21 @@ | ||
#!/bin/sh | ||
# | ||
# RPM pre-uninstall script | ||
# Remove links to mantidplot & /etc/profile.d | ||
# | ||
|
||
if [ -h @PKG_INSTALL_PREFIX@/@BIN_DIR@/mantidplot ]; then | ||
rm @PKG_INSTALL_PREFIX@/@BIN_DIR@/mantidplot | ||
fi | ||
|
||
if [ -h /etc/profile.d/mantid.sh ]; then | ||
rm /etc/profile.d/mantid.sh | ||
fi | ||
|
||
if [ -h /etc/profile.d/mantid.csh ]; then | ||
rm /etc/profile.d/mantid.csh | ||
fi | ||
|
||
if [ -f @PKG_INSTALL_PREFIX@/@BIN_DIR@MantidPlot_exe ]; then | ||
rm @PKG_INSTALL_PREFIX@/@BIN_DIR@/MantidPlot_exe | ||
fi |