-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from MuonPi/v2.0.1
V2.0.1
- Loading branch information
Showing
33 changed files
with
313 additions
and
250 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,13 +27,12 @@ set(CMAKE_AUTORCC ON) | |
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_C_STANDARD_REQUIRED ON) | ||
|
||
set(Qt5_DIR "/usr/lib/x86_64-linux-gnu/cmake/Qt5/") | ||
|
||
find_package(Qt5 COMPONENTS Network SerialPort REQUIRED) | ||
|
||
if(NOT WIN32) # added to make program editable in qt-creator on windows | ||
|
||
find_library(PAHO_MQTT3C paho-mqtt3c REQUIRED) | ||
find_library(PAHO_MQTT3A paho-mqtt3a REQUIRED) | ||
find_library(PAHO_MQTT3CS paho-mqtt3cs REQUIRED) | ||
|
@@ -44,6 +43,9 @@ find_library(CRYPTOPP crypto++ REQUIRED) | |
find_library(CONFIGPP config++ REQUIRED) | ||
find_library(PIGPIOD_IF2 pigpiod_if2 REQUIRED) | ||
find_library(RT rt REQUIRED) | ||
|
||
endif() | ||
|
||
find_library(MUONDETECTOR_LIB NAMES muondetector HINTS "${CMAKE_CURRENT_BINARY_DIR}/../lib/" REQUIRED) | ||
|
||
add_compile_options( | ||
|
@@ -131,9 +133,12 @@ set(LOGIN_SOURCE_FILES | |
) | ||
|
||
set(LOGIN_INSTALL_FILES | ||
"${PROJECT_CONFIG_DIR}/muondetector-login-helper" | ||
"${PROJECT_CONFIG_DIR}/muondetector-login" | ||
) | ||
|
||
set(DAEMON_INSTALL_FILES | ||
"${PROJECT_CONFIG_DIR}/muondetector.conf" | ||
) | ||
|
||
configure_file( | ||
"${PROJECT_CONFIG_DIR}/muondetector-daemon.1" | ||
|
@@ -143,10 +148,6 @@ configure_file( | |
"${PROJECT_CONFIG_DIR}/muondetector-login.1" | ||
"${CMAKE_CURRENT_BINARY_DIR}/muondetector-login.1" | ||
) | ||
configure_file( | ||
"${PROJECT_CONFIG_DIR}/muondetector-login-helper.1" | ||
"${CMAKE_CURRENT_BINARY_DIR}/muondetector-login-helper.1" | ||
) | ||
|
||
|
||
add_executable(muondetector-login ${LOGIN_SOURCE_FILES}) | ||
|
@@ -188,12 +189,13 @@ target_link_libraries(muondetector-daemon | |
) | ||
|
||
|
||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") | ||
if (CMAKE_BUILD_TYPE STREQUAL Release) | ||
add_custom_command(TARGET muondetector-daemon POST_BUILD | ||
COMMAND ${CMAKE_STRIP} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/muondetector-daemon") | ||
add_custom_command(TARGET muondetector-login POST_BUILD | ||
COMMAND ${CMAKE_STRIP} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/muondetector-login") | ||
endif () | ||
|
||
set(DAEMON_INSTALL_FILES | ||
"${PROJECT_CONFIG_DIR}/muondetector.conf" | ||
) | ||
|
||
|
||
|
||
|
@@ -202,13 +204,12 @@ include(GNUInstallDirs) | |
add_custom_target(changelog ALL COMMAND gzip -cn9 "${PROJECT_CONFIG_DIR}/changelog" > "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz") | ||
add_custom_target(manpage ALL COMMAND gzip -cn9 "${CMAKE_CURRENT_BINARY_DIR}/muondetector-daemon.1" > "${CMAKE_CURRENT_BINARY_DIR}/muondetector-daemon.1.gz") | ||
add_custom_target(manpage-login ALL COMMAND gzip -cn9 "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login.1" > "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login.1.gz") | ||
add_custom_target(manpage-login-helper ALL COMMAND gzip -cn9 "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login-helper.1" > "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login-helper.1.gz") | ||
|
||
install(TARGETS muondetector-daemon muondetector-login DESTINATION bin COMPONENT daemon) | ||
install(TARGETS muondetector-daemon DESTINATION bin COMPONENT daemon) | ||
install(TARGETS muondetector-login DESTINATION lib/muondetector/bin COMPONENT daemon) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT daemon) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/muondetector-daemon.1.gz" DESTINATION "share/man/man1/" COMPONENT daemon) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login.1.gz" DESTINATION "share/man/man1/" COMPONENT daemon) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login-helper.1.gz" DESTINATION "share/man/man1/" COMPONENT daemon) | ||
install(FILES "${PROJECT_CONFIG_DIR}/copyright" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT daemon) | ||
install(FILES ${DAEMON_INSTALL_FILES} DESTINATION "/etc/muondetector/" COMPONENT daemon) | ||
install(FILES "${PROJECT_CONFIG_DIR}/muondetector-daemon.service" DESTINATION "/lib/systemd/system" COMPONENT daemon) | ||
|
@@ -218,6 +219,8 @@ install(PROGRAMS ${LOGIN_INSTALL_FILES} DESTINATION bin COMPONENT daemon) | |
|
||
|
||
set(CPACK_GENERATOR "DEB") | ||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "pigpiod, libpaho-mqttpp") | ||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_CONFIG_DIR}/license") | ||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_CONFIG_DIR}/preinst;${PROJECT_CONFIG_DIR}/postinst;${PROJECT_CONFIG_DIR}/prerm;${PROJECT_CONFIG_DIR}/conffiles") | ||
set(CPACK_PACKAGE_VENDOR "MuonPi.org") | ||
|
@@ -232,7 +235,6 @@ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION " It opens serial and i2c connections to th | |
It runs in the background and sends the data to the central server. | ||
It is licensed under the GNU Lesser General Public License version 3 (LGPL v3).") | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "MuonPi <[email protected]>") | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.28), libc++ (>=7), lftp (>=4.7), libcrypto++6, libqt5serialport5 (>= 5), libpaho-mqttpp (>=1.1.0), libconfig++-dev, pigpiod") | ||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../packages/") | ||
|
||
include(CPack) |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ muondetector-daemon (2.0.1) ; urgency=low | |
* Updates: | ||
- added configuration option for input polarity (input1_polarity/input2_polarity) in muondetector.conf file | ||
|
||
-- MuonPi <[email protected]> Wed, 16. Dec 2020 21:55:00 +0100 | ||
-- MuonPi <[email protected]> Fri, 29. Jan 2021 10:10:00 +0100 | ||
|
||
muondetector-daemon (2.0.0) ; urgency=low | ||
|
||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | |
#Source: https://github.com/marvin5300/muondetector | ||
|
||
Files: * | ||
Copyright: 2020 Marvin Peter <[email protected]> | ||
Copyright: 2020 MuonPi.org <[email protected]> | ||
License: GPL-3.0+ | ||
|
||
License: GPL-3.0+ | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.\" manpage for muondetector-daemon | ||
.\" Contact [email protected] to correct errors or typos | ||
.\" Contact [email protected] to correct errors or typos | ||
.TH "muondetector-daemon" "1" "@PROJECT_DATE_STRING@" "v @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" "muondetector manpage" | ||
.SH "NAME" | ||
muondetector-daemon - daemon for muondetector board | ||
|
@@ -111,7 +111,7 @@ Default | |
.SH "BUGS" | ||
No known bugs. | ||
.SH "AUTHOR" | ||
Marvin Peter <[email protected]> | ||
MuonPi.org <[email protected]> | ||
.SH "COPYRIGHT" | ||
License: GPL-3.0+ | ||
.PP | ||
|
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,2 @@ | ||
#!/bin/bash | ||
sudo runuser -u muonuser -- /usr/lib/muondetector/bin/muondetector-login |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
.\" Manpage for muondetector-login | ||
.\" Contact [email protected] to correct errors or typos. | ||
.TH "muondetector-login" "1" "@PROJECT_DATE_STRING@" "v @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" "muondetector manpage" | ||
.TH "muondetector-login" "1" "@PROJECT_DATE_STRING@" "v @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" "muondetector login manpage" | ||
.SH NAME | ||
muondetector-login \- Store login information for the muondetector daemon safely | ||
muondetector-login \- Wrapper to execute the muondetector-login as the correct user. | ||
.SH SYNOPSIS | ||
muondetector-login | ||
.SH DESCRIPTION | ||
The muondetector-login program asks for the login information for the muondetector-daemon and stores it safely instead of writing it to the configuration file in plain text. This program should be ran as the user 'muonuser'. There is a helper script available which sets the correct user. | ||
The muondetector-login script starts the program muondetector-login as the correct user to ensure proper execution. | ||
.SH OPTIONS | ||
The muondetector-login program does not take any options. All necessary information is asked for interactively. | ||
.SH SEE ALSO | ||
muondetector-login-helper(1), muondetector-daemon(1) | ||
muondetector-login(1), muondetector-daemon(1) | ||
.SH BUGS | ||
No known bugs. | ||
.SH AUTHOR | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash -e | ||
|
||
mkdir -p /var/muondetector | ||
useradd muonuser -g users -G dialout,pi,i2c,users -s /usr/sbin/nologin -r -N -M -b /var/muondetector | ||
useradd muonuser -g users -G dialout,pi,i2c,users -s /usr/sbin/nologin -r -N -M -b /var/muondetector || echo "User already exists" | ||
chown muonuser:users /var/muondetector | ||
chmod g+w /var/muondetector |
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
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
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
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ set(QWT_DIR "C:/Qwt-6.1.4") | |
set(OPENSSL_DIR "C:/Qt/Tools/OpenSSL/Win_x64") | ||
set(MQTT_CPP_DIR "C:/paho-mqtt-cpp-1.1.0-win64") | ||
set(MQTT_C_DIR "C:/eclipse-paho-mqtt-c-win64-1.3.6") | ||
set(CRYPTOPP_DIR "C:/cryptopp") | ||
list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.1/msvc2019_64/lib/cmake/Qt5QuickCompiler") | ||
list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.1/msvc2019_64/lib/cmake/Qt5") | ||
|
||
|
@@ -80,14 +81,18 @@ endif() | |
|
||
find_package(Qt5 COMPONENTS Network Svg Widgets Gui Quick QuickWidgets Qml REQUIRED) | ||
|
||
if(NOT WIN32) | ||
|
||
find_library(PAHO_MQTT3C paho-mqtt3c REQUIRED) | ||
find_library(PAHO_MQTT3A paho-mqtt3a REQUIRED) | ||
find_library(PAHO_MQTT3CS paho-mqtt3cs REQUIRED) | ||
find_library(PAHO_MQTT3AS paho-mqtt3as REQUIRED) | ||
find_library(PAHO_MQTTPP3 paho-mqttpp3 REQUIRED) | ||
|
||
find_library(CRYPTOPP crypto++ REQUIRED) | ||
find_library(QWT_QT5 qwt-qt5 REQUIRED) | ||
|
||
endif() | ||
|
||
find_library(MUONDETECTOR_LIB NAMES muondetector HINTS "${CMAKE_CURRENT_BINARY_DIR}/../lib/" REQUIRED) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
@@ -229,7 +234,10 @@ add_definitions(-DQWT_DLL) | |
|
||
target_include_directories(muondetector-gui PUBLIC | ||
${OPENSSL_DIR}/include/ | ||
$<BUILD_INTERFACE:${CRYPTOPP_DIR}/include> | ||
$<INSTALL_INTERFACE:${CRYPTOPP_DIR}/include> | ||
$<BUILD_INTERFACE:${QWT_DIR}/include> | ||
$<INSTALL_INTERFACE:${QWT_DIR}/include> | ||
$<BUILD_INTERFACE:${MQTT_C_DIR}/include> | ||
$<INSTALL_INTERFACE:${MQTT_C_DIR}/include> | ||
$<BUILD_INTERFACE:${MQTT_CPP_DIR}/include/mqtt> | ||
|
@@ -246,6 +254,7 @@ target_link_directories(muondetector-gui PUBLIC | |
"${MQTT_C_DIR}/lib/" | ||
"${QWT_DIR}/lib/" | ||
"${OPENSSL_DIR}/lib/" | ||
"${CRYPTOPP_DIR}/lib/" | ||
) | ||
|
||
target_link_libraries(muondetector-gui | ||
|
@@ -347,15 +356,16 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/muondetector-gui.1.gz" DESTINATION "s | |
install(FILES "${PROJECT_CONFIG_DIR}/copyright" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT gui) | ||
|
||
set(CPACK_GENERATOR "DEB") | ||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libpaho-mqttpp | paho-mqtt-cpp, qml-module-qtpositioning (>=5), qml-module-qtlocation (>=5), qml-module-qtquick2 (>=5), qml-module-qtquick-layouts (>=5), qml-module-qtquick-controls2 (>=5), qml-module-qtquick-controls (>=5), qml-module-qtquick-templates2 (>=5)") | ||
set(CPACK_DEBIAN_PACKAGE_SECTION "net") | ||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/MuonPi/muondetector") | ||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "It connects to muondetector-daemon via TCP. It is based on Qt and C++. | ||
It lets you change the settings for the muondetector hardware and | ||
uses qml for displaying the current position on the map if connected | ||
the muondetector-daemon. | ||
It is licensed under the GNU Lesser General Public License version 3 (LGPL v3).") | ||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION " It connects to muondetector-daemon via TCP. It is based on Qt and C++. | ||
It lets you change the settings for the muondetector hardware and | ||
uses qml for displaying the current position on the map if connected | ||
the muondetector-daemon. | ||
It is licensed under the GNU Lesser General Public License version 3 (LGPL v3).") | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "MuonPi <[email protected]>") | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.28), libc++ (>=7), libqt5gui5 (>=5), libqt5widgets5 (>=5), libqt5core5a (>=5), libqt5quickwidgets5 (>=5.3), libqt5network5 (>=5), qml-module-qtpositioning (>=5), qml-module-qtlocation (>=5), qml-module-qtquick2 (>=5), qml-module-qtquick-layouts (>=5), qml-module-qtquick-controls2 (>=5), qml-module-qtquick-controls (>=5), qml-module-qtquick-templates2 (>=5), libqwt-qt5-6 (>=6.1.2)") | ||
|
||
endif() | ||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_CONFIG_DIR}/license") | ||
|
Oops, something went wrong.