From 4a9591c2b6ca40ebdb69baa10880bcd5a1f6b9fc Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Wed, 22 Mar 2023 16:56:59 -0400 Subject: [PATCH] file cleanups; file naming cleanup (these particular files shouldn't be labeled as example and should be used as working files); adjust CMakeLists.txt for /usr/local installation, correct debian package post install; --- AUTHORS.md | 2 ++ CMakeLists.txt | 29 +++++++++---------- README.md | 4 +-- configs/{RSSI.example.dat => RSSI.dat} | 0 ...{iden_table.example.dat => iden_table.dat} | 0 debian/postinst | 16 ++++++---- 6 files changed, 29 insertions(+), 22 deletions(-) rename configs/{RSSI.example.dat => RSSI.dat} (100%) rename configs/{iden_table.example.dat => iden_table.dat} (100%) diff --git a/AUTHORS.md b/AUTHORS.md index 0050b977..32f1ade0 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -12,9 +12,11 @@ - Build Chain and Helper Tools - K4YT3X (https://github.com/k4yt3x) + - Documentation Team - Charles Bricker (https://github.com/ceb515) - Connor Lovell (https://github.com/DevRanger) + - Community Support Team - Steven Jennison (https://github.com/sjennison) - Charles Bricker (https://github.com/ceb515) diff --git a/CMakeLists.txt b/CMakeLists.txt index a35a1c1a..8bac6425 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -346,7 +346,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -O3 -Wall -std=c++11 set(CMAKE_BUILD_TYPE "RelWithDebInfo") -set(CMAKE_INSTALL_PREFIX "/opt/dvm") +set(CMAKE_INSTALL_PREFIX "/usr/local") set(CMAKE_INSTALL_PREFIX_TARBALL "tar_build") set(GIT_VER "") @@ -374,7 +374,7 @@ target_include_directories(dvmhost PRIVATE src) target_link_libraries(dvmhost PRIVATE asio::asio Threads::Threads util) set(CPACK_SET_DESTDIR true) -set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/dvm") +set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") set(CPACK_GENERATOR "DEB") set(CPACK_PACKAGE_NAME "dvmhost") @@ -384,7 +384,7 @@ set(CPACK_PACKAGE_VENDOR "DVMProject") set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "The DVM Host software provides the host computer implementation of a mixed-mode DMR, P25 and/or NXDN or dedicated-mode DMR, P25 or NXDN repeater system that talks to the actual modem hardware. The host software; is the portion of a complete Over-The-Air modem implementation that performs the data processing, decision making and FEC correction for a digital repeater.") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DVMProject Authors") -set(CPACK_DEBIAN_PACKAGE_VERSION "3.00") +set(CPACK_DEBIAN_PACKAGE_VERSION "3.0.0") set(CPACK_DEBIAN_PACKAGE_RELEASE "0") set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/dvmproject") @@ -440,14 +440,13 @@ endif (ENABLE_TESTS) # dvmhost/dvmcmd install install(TARGETS dvmhost DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install(TARGETS dvmcmd DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -install(FILES config.example.yml iden_table.dat RSSI.dat rid_acl.example.dat tg_acl.example.dat DESTINATION ${CMAKE_INSTALL_PREFIX}) -install(PROGRAMS start-dvm.sh stop-dvm.sh dvm-watchdog.sh stop-watchdog.sh DESTINATION ${CMAKE_INSTALL_PREFIX}) -install(CODE "execute_process(COMMAND mkdir -p /opt/dvm/log)") -install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/filePath: ./filePath: \\\\/opt\\\\/dvm\\\\/log\\\\//' /opt/dvm/config.example.yml\")") -install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/activityFilePath: ./activityFilePath: \\\\/opt\\\\/dvm\\\\/log\\\\//' /opt/dvm/config.example.yml\")") -install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/file: iden_table.dat/file: \\\\/opt\\\\/dvm\\\\/iden_table.dat/' /opt/dvm/config.example.yml\")") -install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/file: rid_acl.dat/file: \\\\/opt\\\\/dvm\\\\/rid_acl.dat/' /opt/dvm/config.example.yml\")") -install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/file: tg_acl.dat/file: \\\\/opt\\\\/dvm\\\\/tg_acl.dat/' /opt/dvm/config.example.yml\")") +install(FILES configs/config.example.yml configs/iden_table.dat configs/RSSI.dat configs/rid_acl.example.dat configs/tg_acl.example.dat DESTINATION ${CMAKE_INSTALL_PREFIX}/etc) +install(PROGRAMS tools/start-dvm.sh tools/stop-dvm.sh tools/dvm-watchdog.sh tools/stop-watchdog.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/filePath: ./filePath: \\\\/var\\\\/log\\\\//' /usr/local/etc/config.example.yml\")") +install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/activityFilePath: ./activityFilePath: \\\\/var\\\\/log\\\\//' /usr/local/etc/config.example.yml\")") +install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/file: iden_table.dat/file: \\\\/usr\\\\/local\\\\/etc\\\\/iden_table.dat/' /usr/local/etc/config.example.yml\")") +install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/file: rid_acl.dat/file: \\\\/usr\\\\/local\\\\/etc\\\\/rid_acl.dat/' /usr/local/etc/config.example.yml\")") +install(CODE "execute_process(COMMAND bash \"-c\" \"sed -i 's/file: tg_acl.dat/file: \\\\/usr\\\\/local\\\\/etc\\\\/tg_acl.dat/' /usr/local/etc/config.example.yml\")") # custom target to generate a tarball add_custom_target(tarball @@ -457,9 +456,9 @@ add_custom_target(tarball COMMAND touch ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm/log/INCLUDE_DRIECTORY COMMAND cp -v dvmhost ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm/bin COMMAND cp -v dvmcmd ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm/bin - COMMAND cp ../*.sh ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm + COMMAND cp ../tools/*.sh ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm COMMAND chmod +x ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm/*.sh - COMMAND cp -v ../config*.yml ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm - COMMAND cp -v ../*.dat ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm - COMMAND cd ${CMAKE_INSTALL_PREFIX_TARBALL} && tar czvf ../dvmhost_1.0.0_${ARCH}.tar.gz * + COMMAND cp -v ../configs/config*.yml ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm + COMMAND cp -v ../configs/*.dat ${CMAKE_INSTALL_PREFIX_TARBALL}/dvm + COMMAND cd ${CMAKE_INSTALL_PREFIX_TARBALL} && tar czvf ../dvmhost_${CPACK_DEBIAN_PACKAGE_VERSION}_${ARCH}.tar.gz * COMMAND rm -rf ${CMAKE_INSTALL_PREFIX_TARBALL}) diff --git a/README.md b/README.md index 2e56dfef..0e461372 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Please feel free to reach out to us for help, comments or otherwise, on our Disc This project utilizes CMake for its build system. (All following information assumes familiarity with the standard Linux make system.) -The DVM Host software does not have any specific library dependancies and is written to be as library-free as possible. A basic GCC/G++ install is usually all thats needed to compile. +The DVM Host software requires the library dependancies below. Generally, the software attempts to be as portable as possible and as library-free as possible. A basic GCC/G++ install is usually all thats needed to compile. ### Dependencies @@ -144,4 +144,4 @@ All thats being done is to remove the `console=serial0,115200` part. Do not chan ## License -This project is licensed under the GPLv2 License - see the [LICENSE.md](LICENSE.md) file for details. Use of this project is intended, for amateur and/or educational use ONLY. Any other use is at the risk of user and all commercial purposes is strictly discouraged. +This project is licensed under the GPLv2 License - see the [LICENSE](LICENSE) file for details. Use of this project is intended, for amateur and/or educational use ONLY. Any other use is at the risk of user and all commercial purposes is strictly discouraged. diff --git a/configs/RSSI.example.dat b/configs/RSSI.dat similarity index 100% rename from configs/RSSI.example.dat rename to configs/RSSI.dat diff --git a/configs/iden_table.example.dat b/configs/iden_table.dat similarity index 100% rename from configs/iden_table.example.dat rename to configs/iden_table.dat diff --git a/debian/postinst b/debian/postinst index 027d5520..1e54ec1d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -3,11 +3,17 @@ set -e if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then useradd --user-group -M --system dvmhost --shell /bin/false || true usermod --groups dialout --append dvmhost || true - chown dvmhost:dvmhost /opt/dvm/config.yml - chown dvmhost:dvmhost /opt/dvm/iden_table.dat - chown dvmhost:dvmhost /opt/dvm/rid_acl.dat - chown dvmhost:dvmhost /opt/dvm/tg_acl.dat - chown dvmhost:dvmhost /opt/dvm/log + chown dvmhost:dvmhost /usr/local/etc/config.yml + chown dvmhost:dvmhost /usr/local/etc/iden_table.dat + chown dvmhost:dvmhost /usr/local/etc/rid_acl.dat + chown dvmhost:dvmhost /usr/local/etc/tg_acl.dat + chown dvmhost:dvmhost /usr/local/etc/log + + sed -i 's/filePath: ./filePath: \\\\/var\\\\/log\\\\//' /usr/local/etc/config.example.yml\" + sed -i 's/activityFilePath: ./activityFilePath: \\\\/var\\\\/log\\\\//' /usr/local/etc/config.example.yml\" + sed -i 's/file: iden_table.dat/file: \\\\/usr\\\\/local\\\\/etc\\\\/iden_table.dat/' /usr/local/etc/config.example.yml\" + sed -i 's/file: rid_acl.dat/file: \\\\/usr\\\\/local\\\\/etc\\\\/rid_acl.dat/' /usr/local/etc/config.example.yml\" + sed -i 's/file: tg_acl.dat/file: \\\\/usr\\\\/local\\\\/etc\\\\/tg_acl.dat/' /usr/local/etc/config.example.yml\" # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'dvmhost.service' >/dev/null || true