mirror of
https://github.com/3cky/mbusd.git
synced 2025-01-26 21:41:29 +01:00
cmake: metafile aggregation fixtures
fixed aggregation of - doc/mbusd.8.in and - systemd-units/mbusd@.servvice.in
This commit is contained in:
parent
cae88552d3
commit
14fa5a4c51
@ -11,8 +11,9 @@ stages:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- output.dir/mbusd
|
||||
- doc/mbusd.8
|
||||
- output.dir/mbusd.8
|
||||
- conf/mbusd.conf.example
|
||||
- output.dir/mbusd@.service
|
||||
|
||||
build:linux_armhf:
|
||||
<<: *mbusd_job_template
|
||||
|
@ -53,16 +53,7 @@ if(LIB_UTIL AND HAVE_TTY_GET_NAME AND HAVE_UU_LOCK)
|
||||
add_definitions(-DHAVE_LIBUTIL)
|
||||
endif()
|
||||
|
||||
find_program(HAVE_SYSTEMD NAMES systemd)
|
||||
if(HAVE_SYSTEMD)
|
||||
set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/systemd-units/mbusd@.service.in mbusd@service)
|
||||
|
||||
install(FILES mbusd.service DESTINATION /lib/systemd/system)
|
||||
#TODO install a default ${CMAKE_CURRENT_SOURCE_DIR}/conf/mbusd.conf ??
|
||||
endif()
|
||||
|
||||
|
||||
# add the main application
|
||||
set(mbusd_SOURCES
|
||||
src/main.c
|
||||
src/tty.c
|
||||
@ -77,11 +68,22 @@ set(mbusd_SOURCES
|
||||
src/sock.c
|
||||
)
|
||||
add_executable(mbusd ${mbusd_SOURCES})
|
||||
|
||||
# add make install capabilites
|
||||
install(TARGETS mbusd DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}/)
|
||||
install(FILES doc/mbusd.8 DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man8/)
|
||||
|
||||
# aggregate the man page template
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/mbusd.8.in mbusd.8)
|
||||
install(FILES mbusd.8 DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man8/)
|
||||
|
||||
# aggregate mbusd@.service from its template
|
||||
find_program(HAVE_SYSTEMD NAMES systemd)
|
||||
if(HAVE_SYSTEMD)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/systemd-units/mbusd@.service.in mbusd@.service)
|
||||
|
||||
install(FILES mbusd@.service DESTINATION /lib/systemd/system/)
|
||||
#TODO install a default ${CMAKE_CURRENT_SOURCE_DIR}/conf/mbusd.conf ??
|
||||
endif()
|
||||
|
||||
# unittest target
|
||||
option(TESTS "Enable unittests" OFF)
|
||||
if(TESTS)
|
||||
add_executable(test_basic tests/test_basics.c)
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH "mbusd" 8 "25 Apr 2016" "mbusd @VERSION@"
|
||||
.TH "mbusd" 8 "25 Apr 2016" "mbusd @PROJECT_VERSION@"
|
||||
.SH NAME
|
||||
mbusd \- MODBUS/TCP to MODBUS/RTU gateway.
|
||||
.SH SYNOPSIS
|
||||
|
@ -3,7 +3,7 @@ Description=Modbus TCP to Modbus RTU (RS-232/485) gateway.
|
||||
Requires=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@bindir@/mbusd -d -v2 -L - -c /etc/mbusd/mbusd-%i.conf -p /dev/%i
|
||||
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/mbusd -d -v2 -L - -c /etc/mbusd/mbusd-%i.conf -p /dev/%i
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
StandardOutput=journal
|
||||
|
Loading…
Reference in New Issue
Block a user