From 066137c2292931a0eb2ce060926521f6453d3d93 Mon Sep 17 00:00:00 2001 From: Taben Malik Date: Fri, 5 May 2023 13:14:08 -0500 Subject: [PATCH 1/8] Fix expected time offset output --- data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data b/data index 432a0eb92..8447fbb79 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 432a0eb9206bb9e28ea82cb77d0b878006406bfe +Subproject commit 8447fbb798def21a2b3aabe392cb9ec1794e1079 From b546352bf6e7fd99c35ad20fbff7d0e515cdebf4 Mon Sep 17 00:00:00 2001 From: David Barber Date: Wed, 21 Jun 2023 13:22:58 -0500 Subject: [PATCH 2/8] fix deb11 optional pipeline jobs --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2674dd407..471bb34cd 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -333,6 +333,7 @@ deb11_op1_build: image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: # Install dependencies from latest CI first. + - apt-get install -y libhdf5-dev - bash debian/install_required_deps_debian.sh package_debian_11 pkg_max # Link optional libraries - ./optional_package_add.sh $PACKAGE_CONFIG_1 @@ -633,6 +634,7 @@ deb11_op2_test: - docker-executor image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: + - apt-get install -y libhdf5-dev - bash debian/install_required_deps_debian.sh package_debian_11 pkg_max - cd build - ctest -j 4 From cea9dd6608a1dba7f0633d7bf9192a231bd2fdaa Mon Sep 17 00:00:00 2001 From: Sydney Holdampf Date: Thu, 29 Jun 2023 14:40:33 -0500 Subject: [PATCH 3/8] Don't filter out almanac subframes when loading data --- core/apps/visibility/WhereSat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/apps/visibility/WhereSat.cpp b/core/apps/visibility/WhereSat.cpp index 5a225c764..3f4cc3cec 100644 --- a/core/apps/visibility/WhereSat.cpp +++ b/core/apps/visibility/WhereSat.cpp @@ -429,7 +429,7 @@ process() // get the ephemeris source(s) // without clock, SP3 doesn't work. navLib.addFactory(ndfp); // must be done before setTypeFilter - navLib.setTypeFilter({NavMessageType::Ephemeris, NavMessageType::Clock}); + navLib.setTypeFilter({NavMessageType::Ephemeris, NavMessageType::Almanac, NavMessageType::Clock}); if (debugLevel) { cout << "Attempting to read ephemeris data." << endl; From 77b0e7c8be6d46395217cb7f4ca0eb8e905437f5 Mon Sep 17 00:00:00 2001 From: David Barber Date: Mon, 29 May 2023 07:13:58 -0500 Subject: [PATCH 4/8] create debian/ubuntu major version coinstallable package --- .gitlab-ci.yml | 50 ++++++++++++++++++++++++++++++ debian/control | 2 +- debian/control.in | 20 ++++++++++++ debian/enable | 2 ++ debian/gnsstk-apps_enable.sh | 13 ++++++++ debian/gnsstk-apps_post_install.sh | 49 +++++++++++++++++++++++++++++ debian/gnsstk14-apps.install | 5 +++ debian/rules | 17 +++++++++- debian/source/options | 2 +- 9 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 debian/control.in create mode 100644 debian/enable create mode 100644 debian/gnsstk-apps_enable.sh create mode 100644 debian/gnsstk-apps_post_install.sh create mode 100644 debian/gnsstk14-apps.install diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 471bb34cd..7292bcdf6 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -258,6 +258,8 @@ deb10_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - mkdir -p build - cd build - cmake -DCMAKE_INSTALL_PREFIX=install -DPYTHON_EXECUTABLE=/usr/bin/python3 $CMAKE_ARG_DEFAULT @@ -276,6 +278,9 @@ deb10_op1_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_max + # source gnsstk's and optional dependencies' post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done # Link optional library - ./optional_package_add.sh $PACKAGE_CONFIG_1 - mkdir -p build @@ -296,6 +301,9 @@ deb10_op2_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_max + # source gnsstk's and optional dependencies' post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done # Link optional libraries - ./optional_package_add.sh $PACKAGE_CONFIG_2 - mkdir -p build @@ -316,6 +324,8 @@ deb11_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - mkdir -p build - cd build - cmake -DCMAKE_INSTALL_PREFIX=install $CMAKE_ARG_DEFAULT @@ -335,6 +345,9 @@ deb11_op1_build: # Install dependencies from latest CI first. - apt-get install -y libhdf5-dev - bash debian/install_required_deps_debian.sh package_debian_11 pkg_max + # source gnsstk's and optional dependencies' post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done # Link optional libraries - ./optional_package_add.sh $PACKAGE_CONFIG_1 - mkdir -p build @@ -356,6 +369,9 @@ deb11_op2_build: # Install dependencies from latest CI first. - apt-get install -y libhdf5-dev - bash debian/install_required_deps_debian.sh package_debian_11 pkg_max + # source gnsstk's and optional dependencies' post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done # Link optional libraries - ./optional_package_add.sh $PACKAGE_CONFIG_2 - mkdir -p build @@ -376,6 +392,8 @@ ubu20_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - mkdir -p build - cd build - cmake -DCMAKE_INSTALL_PREFIX=install -DPYTHON_EXECUTABLE=/usr/bin/python3 $CMAKE_ARG_DEFAULT @@ -581,6 +599,8 @@ deb10_test: image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_10 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd build - ctest -j 4 artifacts: @@ -599,6 +619,9 @@ deb10_op2_test: image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_10 pkg_max + # source gnsstk's and optional dependencies' post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done - cd build - ctest -j 4 artifacts: @@ -617,6 +640,8 @@ deb11_test: image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd build - ctest -j 4 artifacts: @@ -636,6 +661,9 @@ deb11_op2_test: script: - apt-get install -y libhdf5-dev - bash debian/install_required_deps_debian.sh package_debian_11 pkg_max + # source gnsstk's and optional dependencies' post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done - cd build - ctest -j 4 artifacts: @@ -654,6 +682,8 @@ ubu20_test: image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild script: - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd build - ctest -j 4 artifacts: @@ -841,6 +871,8 @@ deb11_user_install: image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd build - export gnsstk=`pwd`/install - cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../ @@ -860,6 +892,8 @@ ubu20_user_install: image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild script: - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd build - export gnsstk=`pwd`/install - cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../ @@ -968,6 +1002,8 @@ deb11_system_install: image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd build - export gnsstk=/usr/local - cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../ @@ -984,6 +1020,8 @@ ubu20_system_install: image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild script: - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd build - export gnsstk=/usr/local - cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../ @@ -1025,6 +1063,8 @@ package_debian_10: - rm -f .gitmodules # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh # Remove any directories left over from the above script. - rm -rf packages # Mark the debian log so that this package is a backport. @@ -1057,6 +1097,8 @@ package_debian_11: - rm -f .gitmodules # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh # Remove any directories left over from the above script. - rm -rf packages # Mark the debian log so that this package is a backport. @@ -1085,6 +1127,8 @@ package_ubuntu_20.04: - rm -f .gitmodules # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh # Remove any directories left over from the above script. - rm -rf packages # Mark the debian log so that this package is a backport. @@ -1259,6 +1303,8 @@ deb10_deploy: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd debs - sudo apt-get -y install ./*.deb - python3 -c "import gnsstk" @@ -1276,6 +1322,8 @@ deb11_deploy: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd debs - apt-get -y install ./*.deb - python3 -c "import gnsstk" @@ -1293,6 +1341,8 @@ ubu20_deploy: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min + # source gnsstk's post install script to set private library install env variables. + - source /usr/share/gnsstk*/gnsstk_post_install.sh - cd debs - sudo apt-get -y install ./*.deb - python3 -c "import gnsstk" diff --git a/debian/control b/debian/control index 2a38e2fe3..d7a273331 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Homepage: http://www.gnsstk.org/ Vcs-Git: https://github.com/SGL-UT/GNSSTk.git Vcs-Browser: https://github.com/SGL-UT/GNSSTk.git -Package: gnsstk-apps +Package: gnsstk14-apps Architecture: any Depends: libgnsstk14, ${misc:Depends}, ${shlibs:Depends} Description: GNSS Toolkit (GNSSTk) - command line tools diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 000000000..0a98fe949 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,20 @@ +Source: gnsstk-apps +Priority: optional +Maintainer: David Barber +Build-Depends: debhelper (>= 9), cmake, libgnsstk14 +Standards-Version: 3.9.5 +Section: libs +Homepage: http://www.gnsstk.org/ +Vcs-Git: https://github.com/SGL-UT/GNSSTk.git +Vcs-Browser: https://github.com/SGL-UT/GNSSTk.git + +Package: gnsstk__VER__-apps +Architecture: any +Depends: libgnsstk14, ${misc:Depends}, ${shlibs:Depends} +Description: GNSS Toolkit (GNSSTk) - command line tools + The GNSS Toolkit (GNSSTk) is an open-source (LGPL) project sponsored by + the Space and Geophysics Laboratory (SGL), part of the Applied Research + Laboratories (ARL) at The University of Texas at Austin. + The primary goals of the GNSSTk project are to: + * provide applications for use by the GNSS and satellite navigation community. + * provide a core library to facilitate the development of GNSS applications. diff --git a/debian/enable b/debian/enable new file mode 100644 index 000000000..0b96367f4 --- /dev/null +++ b/debian/enable @@ -0,0 +1,2 @@ +export PATH=/usr/share/gnsstk${GNSSTK_APPS_VER}-apps/bin${PATH:+:${PATH}} +export CMAKE_PREFIX_PATH=/usr/share/cmake/GNSSTK${GNSSTK_APPS_VER}_Apps${CMAKE_PREFIX_PATH:+:${CMAKE_PREFIX_PATH}} \ No newline at end of file diff --git a/debian/gnsstk-apps_enable.sh b/debian/gnsstk-apps_enable.sh new file mode 100644 index 000000000..2dd9ad388 --- /dev/null +++ b/debian/gnsstk-apps_enable.sh @@ -0,0 +1,13 @@ +#!/bin/bash +GNSSTK_APPS_VER=__VER__ + +# User created file that overwrites GNSSTK_APPS_VER variable if it exists +FILE=/etc/gnsstk-apps.conf + +if [ -f "$FILE" ]; then + echo "found $FILE so sourcing it" + set -o allexport && source $FILE && set +o allexport +fi + +echo "gnsstk-apps major version being used is $GNSSTK_APPS_VER" +source /usr/share/gnsstk__VER__-apps/enable \ No newline at end of file diff --git a/debian/gnsstk-apps_post_install.sh b/debian/gnsstk-apps_post_install.sh new file mode 100644 index 000000000..fdfcb9b10 --- /dev/null +++ b/debian/gnsstk-apps_post_install.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# This file should be sourced and not executed as bash script. Ex. source /etc/share/gnsstk__VER__-apps/gnsstk-apps_post_install.sh + +SRC_FILE=/usr/share/gnsstk__VER__-apps/gnsstk-apps_enable.sh +TGT_FILE=/etc/profile.d/gnsstk-apps_enable.sh + +# Initally file has not been copied yet. +COPIED=0 + +echo -e "\nAttempting to copy $SRC_FILE to $TGT_FILE \n" + +# Copying gnsstk-apps_enable.sh script to /etc/profile.d +if [[ -f "$SRC_FILE" && -f "$TGT_FILE" ]]; then + exit_loop=0 + while [ $exit_loop -lt 1 ] + do + read -p "$TGT_FILE exits so do you want to overwrite it (y/n)?" yn + case $yn in + [yY]) + echo -e "\nOk. Overwriting..." + cp -f $SRC_FILE $TGT_FILE + COPIED=1 + exit_loop=1 + ;; + [nN]) + echo -e "\nOk. Exiting..." + exit_loop=1 + ;; + *) + echo -e "\ninvalid response: ${yn}. Try again..." + ;; + esac + done +else + if [[ -f "$SRC_FILE" && ! -f "$TGT_FILE" ]]; then + echo -e "\nCopying $SRC_FILE to $TGT_FILE" + cp $SRC_FILE $TGT_FILE + COPIED=1 + fi +fi + +if [[ -f "$TGT_FILE" && $COPIED -ne 0 ]]; then + echo -e "\nSourcing $TGT_FILE with new enviroment variables" + source $TGT_FILE +fi + +echo -e "\nThe following env variables have been set or are already set" +env | grep 'LD_LIBRARY_PATH\|CPLUS_INCLUDE_PATH\|PYTHONPATH\|^PATH\|CMAKE_PREFIX_PATH' \ No newline at end of file diff --git a/debian/gnsstk14-apps.install b/debian/gnsstk14-apps.install new file mode 100644 index 000000000..876bf5664 --- /dev/null +++ b/debian/gnsstk14-apps.install @@ -0,0 +1,5 @@ +usr/bin/* usr/share/gnsstk__VER__-apps/bin +usr/share/cmake/GNSSTK_Apps/* usr/share/cmake/GNSSTK__VER___Apps +debian/enable usr/share/gnsstk__VER__-apps +debian/gnsstk-apps_enable.sh usr/share/gnsstk__VER__-apps +debian/gnsstk-apps_post_install.sh usr/share/gnsstk__VER__-apps \ No newline at end of file diff --git a/debian/rules b/debian/rules index 44853db6e..4bc632f53 100755 --- a/debian/rules +++ b/debian/rules @@ -17,11 +17,22 @@ include /usr/share/dpkg/default.mk # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +major = $(shell dpkg-parsechangelog -S Version | sed -ne 's/^\([0-9]\+\)\..*$$/\1/p') +minor = $(shell dpkg-parsechangelog -S Version | sed -ne 's/^[0-9]\+\.\([0-9]\+\)\..*$$/\1/p') + +gen_control: + @echo "$@ Generated $(major) $(minor)." + sed -e 's/__VER__/$(major)/g' debian/control.in >debian/control +# Update install file for co-installation of major pkg versions + sed -e 's/__VER__/$(major)/g' -i debian/gnsstk$(major)-apps.install + sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_enable.sh + sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_post_install.sh + # main packaging script based on dh7 syntax %: dh $@ --parallel --with python3 -override_dh_auto_configure: +override_dh_auto_configure: gen_control dh_auto_configure -- \ -DBUILD_EXT=ON \ -DUSE_RPATH=OFF \ @@ -32,3 +43,7 @@ override_dh_usrlocal: override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + +override_dh_auto_install: gen_control + dh_auto_install --destdir=debian/tmp + sed -e 's/PACKAGE_PREFIX_DIR}\/bin/PACKAGE_PREFIX_DIR}\/share\/gnsstk$(major)-apps\/bin/g' -i debian/tmp/usr/share/cmake/GNSSTK_Apps/GNSSTK_AppsConfig.cmake \ No newline at end of file diff --git a/debian/source/options b/debian/source/options index b905525f0..ce3650687 100644 --- a/debian/source/options +++ b/debian/source/options @@ -1,2 +1,2 @@ -extend-diff-ignore="debian/changelog$" +extend-diff-ignore="(debian/changelog|debian/.*install.*|debian/.*enable.*)$" git-depth=1 From 082fc31ef3eaadc9c998cc84ad1a34dd9e071238 Mon Sep 17 00:00:00 2001 From: David Barber Date: Wed, 5 Jul 2023 10:57:01 -0500 Subject: [PATCH 5/8] Apply code review updates from gnsstk coinstall MR --- debian/gnsstk-apps_enable.sh | 6 +++-- debian/gnsstk-apps_post_install.sh | 40 ++++++++++++---------------- debian/gnsstk-apps_post_uninstall.sh | 31 +++++++++++++++++++++ debian/gnsstk14-apps.install | 3 ++- debian/rules | 1 + 5 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 debian/gnsstk-apps_post_uninstall.sh diff --git a/debian/gnsstk-apps_enable.sh b/debian/gnsstk-apps_enable.sh index 2dd9ad388..690a3248f 100644 --- a/debian/gnsstk-apps_enable.sh +++ b/debian/gnsstk-apps_enable.sh @@ -1,8 +1,10 @@ #!/bin/bash GNSSTK_APPS_VER=__VER__ -# User created file that overwrites GNSSTK_APPS_VER variable if it exists -FILE=/etc/gnsstk-apps.conf +# User created file that overwrites GNSSTK_APPS_VER variable. +# Use kv pair GNSSTK_APPS_VER= in file /etc/toolkits.conf to overwrite. +# By default, /etc/toolkits.conf file doesn't exist so this gets ignored. +FILE=/etc/toolkits.conf if [ -f "$FILE" ]; then echo "found $FILE so sourcing it" diff --git a/debian/gnsstk-apps_post_install.sh b/debian/gnsstk-apps_post_install.sh index fdfcb9b10..38020dc3a 100644 --- a/debian/gnsstk-apps_post_install.sh +++ b/debian/gnsstk-apps_post_install.sh @@ -5,33 +5,27 @@ SRC_FILE=/usr/share/gnsstk__VER__-apps/gnsstk-apps_enable.sh TGT_FILE=/etc/profile.d/gnsstk-apps_enable.sh +# Set current major version that is being installed. +SRC_GNSSTK_APPS_VER=__VER__ + # Initally file has not been copied yet. COPIED=0 -echo -e "\nAttempting to copy $SRC_FILE to $TGT_FILE \n" - -# Copying gnsstk-apps_enable.sh script to /etc/profile.d +# Attempting to copy gnsstk-apps_enable.sh script to /etc/profile.d +# It will copy for these two use cases: +# 1) target file doesn't exist in /etc/profile.d +# 2) target file already exists but target gnsstk-apps major version is older +# than source file gnsstk-apps major version if [[ -f "$SRC_FILE" && -f "$TGT_FILE" ]]; then - exit_loop=0 - while [ $exit_loop -lt 1 ] - do - read -p "$TGT_FILE exits so do you want to overwrite it (y/n)?" yn - case $yn in - [yY]) - echo -e "\nOk. Overwriting..." - cp -f $SRC_FILE $TGT_FILE - COPIED=1 - exit_loop=1 - ;; - [nN]) - echo -e "\nOk. Exiting..." - exit_loop=1 - ;; - *) - echo -e "\ninvalid response: ${yn}. Try again..." - ;; - esac - done + TGT_GNSSTK_APPS_VER=$(sed -n -E -e 's/^GNSSTK_APPS_VER=([0-9]+).*/\1/p' $TGT_FILE) + if [ $TGT_GNSSTK_APPS_VER -lt $SRC_GNSSTK_APPS_VER ]; then + echo -e "\nCopying $SRC_FILE to $TGT_FILE" + cp -f $SRC_FILE $TGT_FILE + COPIED=1 + else + echo -e "\nTarget gnsstk-apps major version $TGT_GNSSTK_APPS_VER is greater or equal to source gnsstk-apps major version $SRC_GNSSTK_APPS_VER" + echo -e "Therefore, not copying $SRC_FILE to $TGT_FILE\n" + fi else if [[ -f "$SRC_FILE" && ! -f "$TGT_FILE" ]]; then echo -e "\nCopying $SRC_FILE to $TGT_FILE" diff --git a/debian/gnsstk-apps_post_uninstall.sh b/debian/gnsstk-apps_post_uninstall.sh new file mode 100644 index 000000000..cd141a27f --- /dev/null +++ b/debian/gnsstk-apps_post_uninstall.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# This file should be sourced and not executed as bash script. Ex. source /etc/share/gnsstk__VER__-apps/gnsstk-apps_post_uninstall.sh + +TGT_FILE=/etc/profile.d/gnsstk-apps_enable.sh + +# Attempting to remove gnsstk-apps_enable.sh script from /etc/profile.d +if [-f "$TGT_FILE" ]; then + exit_loop=0 + while [ $exit_loop -lt 1 ] + do + read -p "$TGT_FILE exists so do you want to delete it (y/n)?" yn + case $yn in + [yY]) + echo -e "\nOk. Removing file $TGT_FILE" + rm -f $TGT_FILE + if [ -f "$TGT_FILE" ]; then + echo -e "\n$TGT_FILE still exists so it will need to be manually removed." + fi + exit_loop=1 + ;; + [nN]) + echo -e "\nOk. Exiting..." + exit_loop=1 + ;; + *) + echo -e "\ninvalid response: ${yn}. Try again..." + ;; + esac + done +fi \ No newline at end of file diff --git a/debian/gnsstk14-apps.install b/debian/gnsstk14-apps.install index 876bf5664..dcb2f86cc 100644 --- a/debian/gnsstk14-apps.install +++ b/debian/gnsstk14-apps.install @@ -2,4 +2,5 @@ usr/bin/* usr/share/gnsstk__VER__-apps/bin usr/share/cmake/GNSSTK_Apps/* usr/share/cmake/GNSSTK__VER___Apps debian/enable usr/share/gnsstk__VER__-apps debian/gnsstk-apps_enable.sh usr/share/gnsstk__VER__-apps -debian/gnsstk-apps_post_install.sh usr/share/gnsstk__VER__-apps \ No newline at end of file +debian/gnsstk-apps_post_install.sh usr/share/gnsstk__VER__-apps +debian/gnsstk-apps_post_uninstall.sh usr/share/gnsstk__VER__-apps \ No newline at end of file diff --git a/debian/rules b/debian/rules index 4bc632f53..b9316f6f8 100755 --- a/debian/rules +++ b/debian/rules @@ -27,6 +27,7 @@ gen_control: sed -e 's/__VER__/$(major)/g' -i debian/gnsstk$(major)-apps.install sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_enable.sh sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_post_install.sh + sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_post_uninstall.sh # main packaging script based on dh7 syntax %: From f2c4be8d93b829955d8ddb26fbc4fb5d96fe3adb Mon Sep 17 00:00:00 2001 From: David Barber Date: Sun, 23 Jul 2023 20:48:01 -0500 Subject: [PATCH 6/8] add uninstall script to debian prerm maintainer script --- debian/gnsstk-apps_post_uninstall.sh | 31 ---------------- debian/gnsstk14-apps.install | 3 +- debian/prerm | 55 ++++++++++++++++++++++++++++ debian/rules | 2 +- debian/source/options | 2 +- 5 files changed, 58 insertions(+), 35 deletions(-) delete mode 100644 debian/gnsstk-apps_post_uninstall.sh create mode 100755 debian/prerm diff --git a/debian/gnsstk-apps_post_uninstall.sh b/debian/gnsstk-apps_post_uninstall.sh deleted file mode 100644 index cd141a27f..000000000 --- a/debian/gnsstk-apps_post_uninstall.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# This file should be sourced and not executed as bash script. Ex. source /etc/share/gnsstk__VER__-apps/gnsstk-apps_post_uninstall.sh - -TGT_FILE=/etc/profile.d/gnsstk-apps_enable.sh - -# Attempting to remove gnsstk-apps_enable.sh script from /etc/profile.d -if [-f "$TGT_FILE" ]; then - exit_loop=0 - while [ $exit_loop -lt 1 ] - do - read -p "$TGT_FILE exists so do you want to delete it (y/n)?" yn - case $yn in - [yY]) - echo -e "\nOk. Removing file $TGT_FILE" - rm -f $TGT_FILE - if [ -f "$TGT_FILE" ]; then - echo -e "\n$TGT_FILE still exists so it will need to be manually removed." - fi - exit_loop=1 - ;; - [nN]) - echo -e "\nOk. Exiting..." - exit_loop=1 - ;; - *) - echo -e "\ninvalid response: ${yn}. Try again..." - ;; - esac - done -fi \ No newline at end of file diff --git a/debian/gnsstk14-apps.install b/debian/gnsstk14-apps.install index dcb2f86cc..876bf5664 100644 --- a/debian/gnsstk14-apps.install +++ b/debian/gnsstk14-apps.install @@ -2,5 +2,4 @@ usr/bin/* usr/share/gnsstk__VER__-apps/bin usr/share/cmake/GNSSTK_Apps/* usr/share/cmake/GNSSTK__VER___Apps debian/enable usr/share/gnsstk__VER__-apps debian/gnsstk-apps_enable.sh usr/share/gnsstk__VER__-apps -debian/gnsstk-apps_post_install.sh usr/share/gnsstk__VER__-apps -debian/gnsstk-apps_post_uninstall.sh usr/share/gnsstk__VER__-apps \ No newline at end of file +debian/gnsstk-apps_post_install.sh usr/share/gnsstk__VER__-apps \ No newline at end of file diff --git a/debian/prerm b/debian/prerm new file mode 100755 index 000000000..db40e5409 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,55 @@ +#!/bin/bash +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Set current major version that is being installed. +SRC_GNSSTK_APPS_VER=__VER__ +TGT_FILE=/etc/profile.d/gnsstk-apps_enable.sh + +case "$1" in + remove|upgrade|deconfigure) + # Attempting to remove gnsstk-apps_enable.sh script from /etc/profile.d + # It will delete for this use case: + # 1) target file already exists but target gnsstk-apps major version is older + # than prerm gnsstk-apps major version + if [ -f "$TGT_FILE" ]; then + TGT_GNSSTK_APPS_VER=$(sed -n -E -e 's/^GNSSTK_APPS_VER=([0-9]+).*/\1/p' $TGT_FILE) + if [ $TGT_GNSSTK_APPS_VER -gt $SRC_GNSSTK_APPS_VER ]; then + echo -e "\nTarget gnsstk-apps major version $TGT_GNSSTK_APPS_VER is greater than source gnsstk-apps major version $SRC_GNSSTK_APPS_VER" + echo -e "Therefore, not deleting $TGT_FILE\n" + else + echo -e "\nDeleting $TGT_FILE" + rm -f $TGT_FILE + fi + fi + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/rules b/debian/rules index b9316f6f8..de1a221a9 100755 --- a/debian/rules +++ b/debian/rules @@ -27,7 +27,7 @@ gen_control: sed -e 's/__VER__/$(major)/g' -i debian/gnsstk$(major)-apps.install sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_enable.sh sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_post_install.sh - sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_post_uninstall.sh + sed -e 's/__VER__/$(major)/g' -i debian/prerm # main packaging script based on dh7 syntax %: diff --git a/debian/source/options b/debian/source/options index ce3650687..d72d4bf46 100644 --- a/debian/source/options +++ b/debian/source/options @@ -1,2 +1,2 @@ -extend-diff-ignore="(debian/changelog|debian/.*install.*|debian/.*enable.*)$" +extend-diff-ignore="(debian/changelog|debian/.*install.*|debian/.*enable.*|debian/prerm)$" git-depth=1 From 7ac05933536828bd6289aa4d5b835eff08295eb8 Mon Sep 17 00:00:00 2001 From: David Barber Date: Sun, 23 Jul 2023 22:38:46 -0500 Subject: [PATCH 7/8] add postinstall script to debian postinst maintainer script --- .gitlab-ci.yml | 111 +++++++++++++++-------------- debian/gnsstk-apps_enable.sh | 6 +- debian/gnsstk-apps_post_install.sh | 43 ----------- debian/gnsstk14-apps.install | 3 +- debian/postinst | 78 ++++++++++++++++++++ debian/rules | 2 +- debian/source/options | 2 +- 7 files changed, 144 insertions(+), 101 deletions(-) delete mode 100644 debian/gnsstk-apps_post_install.sh create mode 100755 debian/postinst diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7292bcdf6..191d7c3b4 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -88,8 +88,8 @@ variables: - /^tag_.*$/ - stable - /^release\/v[0-9.]*$/ - - /^bugfix/ci_*$/ - - /^feature/ci_*$/ + - /^bugfix\/ci_.*$/ + - /^feature\/ci_.*$/ variables: - $BLD_ONLY_VS2019 != "True" @@ -258,8 +258,8 @@ deb10_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - mkdir -p build - cd build - cmake -DCMAKE_INSTALL_PREFIX=install -DPYTHON_EXECUTABLE=/usr/bin/python3 $CMAKE_ARG_DEFAULT @@ -278,9 +278,9 @@ deb10_op1_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_max - # source gnsstk's and optional dependencies' post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh - - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done + # source gnsstk's and optional dependencies' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /etc/profile.d/${tks}_enable.sh; done # Link optional library - ./optional_package_add.sh $PACKAGE_CONFIG_1 - mkdir -p build @@ -301,9 +301,9 @@ deb10_op2_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_max - # source gnsstk's and optional dependencies' post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh - - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done + # source gnsstk's and optional dependencies' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /etc/profile.d/${tks}_enable.sh; done # Link optional libraries - ./optional_package_add.sh $PACKAGE_CONFIG_2 - mkdir -p build @@ -324,8 +324,8 @@ deb11_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - mkdir -p build - cd build - cmake -DCMAKE_INSTALL_PREFIX=install $CMAKE_ARG_DEFAULT @@ -345,9 +345,9 @@ deb11_op1_build: # Install dependencies from latest CI first. - apt-get install -y libhdf5-dev - bash debian/install_required_deps_debian.sh package_debian_11 pkg_max - # source gnsstk's and optional dependencies' post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh - - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done + # source gnsstk's and optional dependencies' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /etc/profile.d/${tks}_enable.sh; done # Link optional libraries - ./optional_package_add.sh $PACKAGE_CONFIG_1 - mkdir -p build @@ -367,11 +367,10 @@ deb11_op2_build: image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: # Install dependencies from latest CI first. - - apt-get install -y libhdf5-dev - bash debian/install_required_deps_debian.sh package_debian_11 pkg_max - # source gnsstk's and optional dependencies' post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh - - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done + # source gnsstk's and optional dependencies' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /etc/profile.d/${tks}_enable.sh; done # Link optional libraries - ./optional_package_add.sh $PACKAGE_CONFIG_2 - mkdir -p build @@ -392,8 +391,8 @@ ubu20_build: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - mkdir -p build - cd build - cmake -DCMAKE_INSTALL_PREFIX=install -DPYTHON_EXECUTABLE=/usr/bin/python3 $CMAKE_ARG_DEFAULT @@ -599,8 +598,8 @@ deb10_test: image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_10 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd build - ctest -j 4 artifacts: @@ -619,9 +618,9 @@ deb10_op2_test: image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_10 pkg_max - # source gnsstk's and optional dependencies' post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh - - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done + # source gnsstk's and optional dependencies' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /etc/profile.d/${tks}_enable.sh; done - cd build - ctest -j 4 artifacts: @@ -640,8 +639,8 @@ deb11_test: image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd build - ctest -j 4 artifacts: @@ -661,9 +660,9 @@ deb11_op2_test: script: - apt-get install -y libhdf5-dev - bash debian/install_required_deps_debian.sh package_debian_11 pkg_max - # source gnsstk's and optional dependencies' post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh - - for tks in ${PACKAGE_CONFIG_2}; do source /usr/share/${tks}*/${tks}_post_install.sh; done + # source gnsstk's and optional dependencies' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh + - for tks in ${PACKAGE_CONFIG_2}; do source /etc/profile.d/${tks}_enable.sh; done - cd build - ctest -j 4 artifacts: @@ -682,8 +681,8 @@ ubu20_test: image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild script: - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd build - ctest -j 4 artifacts: @@ -871,8 +870,8 @@ deb11_user_install: image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd build - export gnsstk=`pwd`/install - cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../ @@ -892,8 +891,8 @@ ubu20_user_install: image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild script: - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd build - export gnsstk=`pwd`/install - cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../ @@ -1002,8 +1001,8 @@ deb11_system_install: image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild script: - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd build - export gnsstk=/usr/local - cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../ @@ -1020,8 +1019,8 @@ ubu20_system_install: image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild script: - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd build - export gnsstk=/usr/local - cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../ @@ -1063,8 +1062,8 @@ package_debian_10: - rm -f .gitmodules # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh # Remove any directories left over from the above script. - rm -rf packages # Mark the debian log so that this package is a backport. @@ -1097,8 +1096,8 @@ package_debian_11: - rm -f .gitmodules # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh # Remove any directories left over from the above script. - rm -rf packages # Mark the debian log so that this package is a backport. @@ -1127,8 +1126,8 @@ package_ubuntu_20.04: - rm -f .gitmodules # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh # Remove any directories left over from the above script. - rm -rf packages # Mark the debian log so that this package is a backport. @@ -1303,10 +1302,12 @@ deb10_deploy: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_10 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd debs - sudo apt-get -y install ./*.deb + # source gnsstk-apps' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk-apps_enable.sh - python3 -c "import gnsstk" - timeconvert dependencies: @@ -1322,10 +1323,12 @@ deb11_deploy: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_debian_11 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd debs - apt-get -y install ./*.deb + # source gnsstk-apps' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk-apps_enable.sh - python3 -c "import gnsstk" - timeconvert dependencies: @@ -1341,10 +1344,12 @@ ubu20_deploy: script: # Install dependencies from latest CI first. - bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min - # source gnsstk's post install script to set private library install env variables. - - source /usr/share/gnsstk*/gnsstk_post_install.sh + # source gnsstk's enable script to set private library install env variables. + - source /etc/profile.d/gnsstk_enable.sh - cd debs - sudo apt-get -y install ./*.deb + # source gnsstk-apps' enable script to set private library install env variables. + - source /etc/profile.d/gnsstk-apps_enable.sh - python3 -c "import gnsstk" - timeconvert dependencies: diff --git a/debian/gnsstk-apps_enable.sh b/debian/gnsstk-apps_enable.sh index 690a3248f..63243909d 100644 --- a/debian/gnsstk-apps_enable.sh +++ b/debian/gnsstk-apps_enable.sh @@ -1,4 +1,5 @@ #!/bin/bash +# This file should be sourced and not executed as bash script. Ex. source /etc/profile.d/gnsstk-apps_enable.sh GNSSTK_APPS_VER=__VER__ # User created file that overwrites GNSSTK_APPS_VER variable. @@ -12,4 +13,7 @@ if [ -f "$FILE" ]; then fi echo "gnsstk-apps major version being used is $GNSSTK_APPS_VER" -source /usr/share/gnsstk__VER__-apps/enable \ No newline at end of file +source /usr/share/gnsstk__VER__-apps/enable + +echo -e "\nThe following env variables have been set or are already set" +env | grep 'LD_LIBRARY_PATH\|CPLUS_INCLUDE_PATH\|PYTHONPATH\|^PATH' \ No newline at end of file diff --git a/debian/gnsstk-apps_post_install.sh b/debian/gnsstk-apps_post_install.sh deleted file mode 100644 index 38020dc3a..000000000 --- a/debian/gnsstk-apps_post_install.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# This file should be sourced and not executed as bash script. Ex. source /etc/share/gnsstk__VER__-apps/gnsstk-apps_post_install.sh - -SRC_FILE=/usr/share/gnsstk__VER__-apps/gnsstk-apps_enable.sh -TGT_FILE=/etc/profile.d/gnsstk-apps_enable.sh - -# Set current major version that is being installed. -SRC_GNSSTK_APPS_VER=__VER__ - -# Initally file has not been copied yet. -COPIED=0 - -# Attempting to copy gnsstk-apps_enable.sh script to /etc/profile.d -# It will copy for these two use cases: -# 1) target file doesn't exist in /etc/profile.d -# 2) target file already exists but target gnsstk-apps major version is older -# than source file gnsstk-apps major version -if [[ -f "$SRC_FILE" && -f "$TGT_FILE" ]]; then - TGT_GNSSTK_APPS_VER=$(sed -n -E -e 's/^GNSSTK_APPS_VER=([0-9]+).*/\1/p' $TGT_FILE) - if [ $TGT_GNSSTK_APPS_VER -lt $SRC_GNSSTK_APPS_VER ]; then - echo -e "\nCopying $SRC_FILE to $TGT_FILE" - cp -f $SRC_FILE $TGT_FILE - COPIED=1 - else - echo -e "\nTarget gnsstk-apps major version $TGT_GNSSTK_APPS_VER is greater or equal to source gnsstk-apps major version $SRC_GNSSTK_APPS_VER" - echo -e "Therefore, not copying $SRC_FILE to $TGT_FILE\n" - fi -else - if [[ -f "$SRC_FILE" && ! -f "$TGT_FILE" ]]; then - echo -e "\nCopying $SRC_FILE to $TGT_FILE" - cp $SRC_FILE $TGT_FILE - COPIED=1 - fi -fi - -if [[ -f "$TGT_FILE" && $COPIED -ne 0 ]]; then - echo -e "\nSourcing $TGT_FILE with new enviroment variables" - source $TGT_FILE -fi - -echo -e "\nThe following env variables have been set or are already set" -env | grep 'LD_LIBRARY_PATH\|CPLUS_INCLUDE_PATH\|PYTHONPATH\|^PATH\|CMAKE_PREFIX_PATH' \ No newline at end of file diff --git a/debian/gnsstk14-apps.install b/debian/gnsstk14-apps.install index 876bf5664..37950211b 100644 --- a/debian/gnsstk14-apps.install +++ b/debian/gnsstk14-apps.install @@ -1,5 +1,4 @@ usr/bin/* usr/share/gnsstk__VER__-apps/bin usr/share/cmake/GNSSTK_Apps/* usr/share/cmake/GNSSTK__VER___Apps debian/enable usr/share/gnsstk__VER__-apps -debian/gnsstk-apps_enable.sh usr/share/gnsstk__VER__-apps -debian/gnsstk-apps_post_install.sh usr/share/gnsstk__VER__-apps \ No newline at end of file +debian/gnsstk-apps_enable.sh usr/share/gnsstk__VER__-apps \ No newline at end of file diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 000000000..5e8eee817 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,78 @@ +#!/bin/bash +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +SRC_FILE=/usr/share/gnsstk__VER__-apps/gnsstk-apps_enable.sh +TGT_FILE=/etc/profile.d/gnsstk-apps_enable.sh + +# Set current major version that is being installed. +SRC_GNSSTK_APPS_VER=__VER__ + +#Set echo font colors +BIRed='\033[1;91m' +BIBlue='\033[1;94m' +BIWhite='\033[1;97m' +Color_Off='\033[0m' + +case "$1" in + configure) + # Attempting to copy gnsstk-apps_enable.sh script to /etc/profile.d + # It will copy for these two use cases: + # 1) target file doesn't exist in /etc/profile.d + # 2) target file already exists but target gnsstk-apps major version is older + # than source file gnsstk-apps major version + if [[ -f "$SRC_FILE" && -f "$TGT_FILE" ]]; then + TGT_GNSSTK_APPS_VER=$(sed -n -E -e 's/^GNSSTK_APPS_VER=([0-9]+).*/\1/p' $TGT_FILE) + if [ $TGT_GNSSTK_APPS_VER -lt $SRC_GNSSTK_APPS_VER ]; then + echo -e "\nCopying $SRC_FILE to $TGT_FILE" + cp -f $SRC_FILE $TGT_FILE + else + echo -e "\nTarget gnsstk-apps major version $TGT_GNSSTK_APPS_VER is greater or equal to source gnsstk-apps major version $SRC_GNSSTK_APPS_VER" + echo -e "Therefore, not copying $SRC_FILE to $TGT_FILE\n" + fi + else + if [[ -f "$SRC_FILE" && ! -f "$TGT_FILE" ]]; then + echo -e "\nCopying $SRC_FILE to $TGT_FILE" + cp $SRC_FILE $TGT_FILE + fi + fi + # Let's post how to enable $TGT_FILE + echo -e "${BIBlue}#############################################################" + echo -e "${BIBlue}## ${BIWhite}To enable the toolkit: ${BIBlue}##" + echo -e "${BIBlue}## ${BIWhite}Either start a new login session. ${BIBlue}##" + echo -e "${BIBlue}## ${BIRed}Ex. su - or relogin ${BIBlue}##" + echo -e "${BIBlue}## ${BIWhite}or source the enable script. ${BIBlue}##" + echo -e "${BIBlue}## ${BIRed}Ex. source ${TGT_FILE} ${BIBlue}##" + echo -e "${BIBlue}#############################################################${Color_Off}\n" + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/rules b/debian/rules index de1a221a9..e767a65e3 100755 --- a/debian/rules +++ b/debian/rules @@ -26,7 +26,7 @@ gen_control: # Update install file for co-installation of major pkg versions sed -e 's/__VER__/$(major)/g' -i debian/gnsstk$(major)-apps.install sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_enable.sh - sed -e 's/__VER__/$(major)/g' -i debian/gnsstk-apps_post_install.sh + sed -e 's/__VER__/$(major)/g' -i debian/postinst sed -e 's/__VER__/$(major)/g' -i debian/prerm # main packaging script based on dh7 syntax diff --git a/debian/source/options b/debian/source/options index d72d4bf46..d882b4005 100644 --- a/debian/source/options +++ b/debian/source/options @@ -1,2 +1,2 @@ -extend-diff-ignore="(debian/changelog|debian/.*install.*|debian/.*enable.*|debian/prerm)$" +extend-diff-ignore="(debian/changelog|debian/.*install.*|debian/.*enable.*|debian/prerm|debian/postinst)$" git-depth=1 From 564bf990ff167e21bff8c2e6a08a0024d8d6190f Mon Sep 17 00:00:00 2001 From: David Barber Date: Mon, 14 Aug 2023 12:50:28 -0500 Subject: [PATCH 8/8] Release v14.1.0 --- CMakeLists.txt | 2 +- ChangeLog.md | 19 +++++++++++++++++++ Doxyfile | 2 +- RELNOTES.md | 24 ++++++++++++------------ debian/changelog | 11 +++++++++++ debian/control | 4 ++-- debian/control.in | 4 ++-- rpm_files/SPECS/gnsstk-apps.spec | 8 +++++++- 8 files changed, 55 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63a57ebb4..72b33e724 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_policy( VERSION 3.7.2 ) project( GNSSTK_APPS ) set( GNSSTK_APPS_VERSION_MAJOR "14" ) -set( GNSSTK_APPS_VERSION_MINOR "0" ) +set( GNSSTK_APPS_VERSION_MINOR "1" ) set( GNSSTK_APPS_VERSION_PATCH "0" ) set( GNSSTK_APPS_VERSION "${GNSSTK_APPS_VERSION_MAJOR}.${GNSSTK_APPS_VERSION_MINOR}.${GNSSTK_APPS_VERSION_PATCH}" ) set( CPACK_PACKAGE_VERSION_MAJOR ${GNSSTK_APPS_VERSION_MAJOR} ) diff --git a/ChangeLog.md b/ChangeLog.md index 8a7dbf1ca..08c8c8f9c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,22 @@ +# Version 14.1.0 Monday August 14, 2023 + +Modifications by Author +----------------------- + David Barber (5): + fix deb11 optional pipeline jobs + create debian/ubuntu major version coinstallable package + Apply code review updates from gnsstk coinstall MR + add uninstall script to debian prerm maintainer script + add postinstall script to debian postinst maintainer script + + Sydney Holdampf (1): + Don't filter out almanac subframes when loading data + + Taben Malik (1): + Fix expected time offset output + + + # Version 14.0.0 Thursday December 22, 2022 Modifications by Author diff --git a/Doxyfile b/Doxyfile index 7fc3a59af..a2aab79a5 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "GPS ToolKit Software Library" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 14.0.0 +PROJECT_NUMBER = 14.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/RELNOTES.md b/RELNOTES.md index ff7b75a38..e356da998 100755 --- a/RELNOTES.md +++ b/RELNOTES.md @@ -1,21 +1,21 @@ -GNSSTk-APPs 14.0.0 Release Notes +GNSSTk-APPs 14.1.0 Release Notes ======================== - * This release introduces a major update to the toolkit apps. - * It includes the following: - * Updating cmake package from using a hyphen to using an underscore. - * Adding PRN/SVN mapping support to navdump. - * Adding Ubuntu20.04 (focal) support. + * This release includes the following: + * Fixing WhereSat.cpp to no longer filter out almanac subframes. + * Fixing expected time offset output in gnsstk data submodule repo. + * Co-installation of major versions of debian packages. -Updates since v13.6.0 +Updates since v14.0.0 --------------------- **Build System and Test Suite** - * Updated the clean build parameter + * Update create debian/ubuntu major version coinstallable package **Gitlab CI** - * Add ubuntu 20.04 pipeline jobs + * Fix deb11 optional pipeline jobs -**Library Changes** - * Update replaced hypen with underscore from cmake package name - * Add PRN/SVN mapping support to navdump \ No newline at end of file +Fixes since v14.0.0 +-------------------- + * Fix expected time offset output. + * Fix WhereSat.cpp to no longer filter out almanac subframes when loading data allowing the use-alm flag to function properly \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index c563467cd..f27424ca4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +gnsstk-apps (14.1.0-1) focal; urgency=low + + * Updated to version 14.1.0 + * Fix expected time offset output. + * Fix deb11 optional pipeline jobs + * Fix WhereSat.cpp to no longer filter out almanac subframes when + loading data allowing the use-alm flag to function properly + * Update create debian/ubuntu major version coinstallable package + + -- David Barber Mon, 14 Aug 2023 12:45:12 -0500 + gnsstk-apps (14.0.0-1) stable; urgency=low * Updated to version 14.0.0 diff --git a/debian/control b/debian/control index d7a273331..a59579534 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: gnsstk-apps Priority: optional Maintainer: David Barber -Build-Depends: debhelper (>= 9), cmake, libgnsstk14 +Build-Depends: debhelper (>= 9), cmake, libgnsstk14 (>= 14.2.0) Standards-Version: 3.9.5 Section: libs Homepage: http://www.gnsstk.org/ @@ -10,7 +10,7 @@ Vcs-Browser: https://github.com/SGL-UT/GNSSTk.git Package: gnsstk14-apps Architecture: any -Depends: libgnsstk14, ${misc:Depends}, ${shlibs:Depends} +Depends: libgnsstk14 (>= 14.2.0), ${misc:Depends}, ${shlibs:Depends} Description: GNSS Toolkit (GNSSTk) - command line tools The GNSS Toolkit (GNSSTk) is an open-source (LGPL) project sponsored by the Space and Geophysics Laboratory (SGL), part of the Applied Research diff --git a/debian/control.in b/debian/control.in index 0a98fe949..1153ed3a1 100644 --- a/debian/control.in +++ b/debian/control.in @@ -1,7 +1,7 @@ Source: gnsstk-apps Priority: optional Maintainer: David Barber -Build-Depends: debhelper (>= 9), cmake, libgnsstk14 +Build-Depends: debhelper (>= 9), cmake, libgnsstk14 (>= 14.2.0) Standards-Version: 3.9.5 Section: libs Homepage: http://www.gnsstk.org/ @@ -10,7 +10,7 @@ Vcs-Browser: https://github.com/SGL-UT/GNSSTk.git Package: gnsstk__VER__-apps Architecture: any -Depends: libgnsstk14, ${misc:Depends}, ${shlibs:Depends} +Depends: libgnsstk14 (>= 14.2.0), ${misc:Depends}, ${shlibs:Depends} Description: GNSS Toolkit (GNSSTk) - command line tools The GNSS Toolkit (GNSSTk) is an open-source (LGPL) project sponsored by the Space and Geophysics Laboratory (SGL), part of the Applied Research diff --git a/rpm_files/SPECS/gnsstk-apps.spec b/rpm_files/SPECS/gnsstk-apps.spec index d69c4df2a..00725b41b 100644 --- a/rpm_files/SPECS/gnsstk-apps.spec +++ b/rpm_files/SPECS/gnsstk-apps.spec @@ -1,5 +1,5 @@ %define name gnsstk-apps -%define version 14.0.0 +%define version 14.1.0 %define release 1 Summary: GNSS Toolkit @@ -53,6 +53,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Aug 14 2023 David Barber +- Updated for v14.1.0 release +- Update create debian/ubuntu major version coinstallable package +- Fix WhereSat.cpp to no longer filter out almanac subframes when loading data allowing the use-alm flag to function properly +- Fix deb11 optional pipeline jobs +- Fix expected time offset output. * Thu Dec 22 2022 David Barber - Updated for v14.0.0 release - Update replaced hypen with underscore from cmake package name