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

Adapted to Ubuntu 18.04 package generation

parent 8946c095
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@ IF (UNIX)
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu")
#Uncomment to add the necessary mantainer scripts
#SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/preinst;${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm;${CMAKE_SOURCE_DIR}/scripts/debian/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
#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-dep1-dev (>= 1.0~${DISTRIB}), iri-dep2-dev (>= 1.0~${DISTRIB})")
......@@ -88,4 +88,4 @@ ELSE(UNIX)
COMMENT "packaging only implemented in unix"
TARGET uninstall
)
ENDIF(UNIX)
\ No newline at end of file
ENDIF(UNIX)
......@@ -168,6 +168,24 @@ else
echo "Creating $FILES_DIR directory"
mkdir $FILES_DIR
fi
#create the scripts directory
SCRIPTS_DIR="./scripts"
if [ -e "$SCRIPTS_DIR" ]
then
echo "$SCRIPTS_DIR directory already exists, skipping ..."
else
echo "Creating $SCRIPTS_DIR directory"
mkdir $SCRIPTS_DIR
fi
#create the scripts/debian directory
DEBIAN_DIR="./scripts/debian"
if [ -e "$DEBIAN_DIR" ]
then
echo "$DEBIAN_DIR directory already exists, skipping ..."
else
echo "Creating $DEBIAN_DIR directory"
mkdir $DEBIAN_DIR
fi
#parse the dependencies and create the dependencies file
arr=$(echo $DEP | tr "," "\n")
......@@ -376,6 +394,9 @@ then
sed -i "/${comment}/ a ${line_to_add}" ${file}
fi
sed 's/project_name/'$NAME'/g' <postinst_template >./scripts/debian/postinst
sed 's/project_name/'$NAME'/g' <prerm_template >./scripts/debian/prerm
if [ $TEST = 1 ]
then
Library_name=$(echo $NAME | sed 's/\([a-zA-Z]\)\([a-zA-Z0-9]*\)/\u\1\2/g')
......@@ -395,4 +416,6 @@ rm driver_example_src_template.cpp
rm Findlib_template.cmake
rm .gitlab-ci_template.yml
rm new_project.sh
rm -rf .git
\ No newline at end of file
rm -rf .git
rm postinst_template
rm prerm_template
#!/bin/bash
set -e
case "$1" in
configure)
echo " Trying to add library to ldconfig..."
/usr/share/iri/add_lib_to_ld_config.sh -l project_name -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 project_name -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
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