Skip to content
Snippets Groups Projects
Commit 08990349 authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

Added add_lib_to_ld_config.sh and remove_lib_from_ld_config.sh user scripts....

Added add_lib_to_ld_config.sh and remove_lib_from_ld_config.sh user scripts. Added maintainer scripts to automatically call that scripts
parent e369d428
No related branches found
No related tags found
1 merge request!2Added add_lib_to_ld_config.sh and remove_lib_from_ld_config.sh user scripts....
Pipeline #6033 failed
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
...@@ -102,7 +102,7 @@ IF (UNIX) ...@@ -102,7 +102,7 @@ IF (UNIX)
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu")
# Uncomment to add the necessary mantainer scripts # Uncomment to add the necessary mantainer scripts
# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/package_scripts/preinst;${CMAKE_SOURCE_DIR}/package_scripts/postinst;${CMAKE_SOURCE_DIR}/package_scripts/prerm;${CMAKE_SOURCE_DIR}/package_scripts/postrm") SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm")
# Uncomment to add dependencies comma separated # Uncomment to add dependencies comma separated
# SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-<package_name>-dev (>= 1.0~${DISTRIB})") # SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-<package_name>-dev (>= 1.0~${DISTRIB})")
......
#!/bin/bash
set -e
FILE="/etc/ld.so.conf.d/iri.conf"
LIB=
LOCAL="local/"
usage() {
echo "Usage: $0 -l <library> [-p]"
echo " -l specify library name"
echo " -p specify if installed from package. Optional."
exit 1
}
while getopts ":hl:p" arg; do
case $arg in
l) LIB=$OPTARG;;
p) LOCAL="";;
h) usage;;
*) usage;;
esac
done
if [ -z "$LIB" ]
then
echo "Error: no library specified"
usage
fi
sudo touch $FILE
LINE="/usr/${LOCAL}lib/iri/${LIB}"
echo "Adding ${LINE} to ${FILE}..."
grep -qF -- "$LINE" "$FILE" || echo "$LINE" | sudo tee -a "$FILE" > /dev/null
sudo ldconfig
echo "Done."
#!/bin/bash
set -e
case "$1" in
configure)
echo " Adding iri-scripts-path.sh to /etc/profile.d..."
FILE="/etc/profile.d/iri-scripts-path.sh"
sudo echo "# Expand PATH to include the directory where IRI scripts go." > $FILE
sudo echo "iri_script_path=\"/usr/local/share/iri:/usr/share/iri\"" >> $FILE
sudo echo "if [ -n \"\${PATH##*\${iri_script_path}}\" -a -n \"\${PATH##*\${iri_script_path}:*}\" ]; then" >> $FILE
sudo echo " export PATH=\$PATH:\${iri_script_path}" >> $FILE
sudo echo "fi" >> $FILE
echo " Done. It's necessary a log out for changes to take effect."
echo " Trying to add library to ldconfig..."
/usr/share/iri/add_lib_to_ld_config.sh -l iriutils -p && echo " Done." || echo " /usr/share/iri/add_lib_to_ld_config.sh doesn't exists. Download it from iriutils and execute it."
;;
abort-upgrade)
;;
abort-remove)
;;
abort-deconfigure)
;;
esac
exit 0
#!/bin/bash
set -e
case "$1" in
remove)
echo " Trying to remove library from ldconfig..."
/usr/share/iri/remove_lib_from_ld_config.sh -l iriutils -p && echo " Done." || echo " /usr/share/iri/remove_lib_from_ld_config.sh doesn't exists. Download it from iriutils and execute it."
;;
upgrade)
;;
deconfigure)
;;
failed-upgrade)
;;
esac
exit 0
#!/bin/bash
set -e
FILE="/etc/ld.so.conf.d/iri.conf"
LIB=
LOCAL="local\/"
usage() {
echo "Usage: $0 -l <library> [-p]"
echo " -l specify library name"
echo " -p specify if installed from package. Optional."
exit 1
}
while getopts ":hl:p" arg; do
case $arg in
l) LIB=$OPTARG;;
p) LOCAL="";;
h) usage;;
*) usage;;
esac
done
if [ -z "$LIB" ]
then
echo "Error: no library specified"
usage
fi
sudo touch $FILE
echo "Removing /usr/${LOCAL}lib/iri/${LIB} from ${FILE}..."
LINE="\/usr\/${LOCAL}lib\/iri\/${LIB}"
sudo sed -i "/$LINE/d" $FILE
sudo ldconfig
echo "Done."
...@@ -28,4 +28,10 @@ INSTALL(FILES ${headers} DESTINATION include/iri/${PROJECT_NAME}) ...@@ -28,4 +28,10 @@ INSTALL(FILES ${headers} DESTINATION include/iri/${PROJECT_NAME})
INSTALL(FILES ../Findiriutils.cmake DESTINATION ${CMAKE_ROOT}/Modules/) INSTALL(FILES ../Findiriutils.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
INSTALL(FILES ../scripts/add_lib_to_ld_config.sh
../scripts/remove_lib_from_ld_config.sh
DESTINATION share/iri
PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)
ADD_SUBDIRECTORY(examples) ADD_SUBDIRECTORY(examples)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment