cmake: metafile aggregation fixtures

fixed aggregation of
 - doc/mbusd.8.in and
 - systemd-units/mbusd@.servvice.in
This commit is contained in:
Nick 2017-11-29 22:34:32 +01:00
parent cae88552d3
commit 14fa5a4c51
4 changed files with 19 additions and 16 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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