-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Krzysztow:master' into master
- Loading branch information
Showing
9 changed files
with
329 additions
and
26 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
%define unpackaged_files_terminate_build 1 | ||
|
||
Name: modbus-utils | ||
Version: 1.0.0 | ||
Release: alt1 | ||
|
||
Summary: CLI utilities to work with Modbus devices | ||
License: %mit | ||
Group: Other | ||
Url: https://github.com/Krzysztow/modbus-utils | ||
Source0: %name-%version.tar | ||
|
||
BuildRequires(pre): rpm-build-licenses | ||
BuildRequires(pre): rpm-macros-cmake | ||
BuildRequires: cmake | ||
BuildRequires: libmodbus-devel | ||
|
||
%description | ||
Client and server CLI utilities to work with Modbus devices | ||
|
||
%prep | ||
%setup -q | ||
|
||
%build | ||
%cmake | ||
%install | ||
%cmakeinstall_std | ||
%files | ||
%_bindir/modbus_client | ||
%_bindir/modbus_server | ||
|
||
%changelog | ||
* Tue Aug 10 2021 Aleksey Saprunov <[email protected]> 1.0.0-alt1 | ||
- Initial release | ||
|
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 @@ | ||
spec: .gear/modbus-utils.spec | ||
tar: . |
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,18 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(modbus-utils VERSION 1.0.0 LANGUAGES C) | ||
|
||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(MODBUS REQUIRED IMPORTED_TARGET libmodbus) | ||
|
||
add_executable(modbus_client "${CMAKE_CURRENT_SOURCE_DIR}/modbus_client/modbus_client.c") | ||
target_link_libraries(modbus_client PkgConfig::MODBUS) | ||
target_include_directories(modbus_client PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/common" "${MODBUS_INCLUDE_DIRS}") | ||
|
||
add_executable(modbus_server "${CMAKE_CURRENT_SOURCE_DIR}/modbus_server/modbus_server.c") | ||
target_link_libraries(modbus_server PkgConfig::MODBUS) | ||
target_include_directories(modbus_server PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/common" "${MODBUS_INCLUDE_DIRS}") | ||
|
||
install(TARGETS modbus_server modbus_client DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
RUNTIME DESTINATION bin | ||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
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,25 @@ | ||
The MIT License (MIT) | ||
===================== | ||
|
||
Copyright © `2013` `Krzysztow` | ||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the “Software”), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
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
Oops, something went wrong.