diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a774cb4..20f0c31 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,13 +29,13 @@ target_link_libraries(syslog-bulk-uploader slbu-lib ) -install(TARGETS syslog-bulk-uploader DESTINATION bin ) +install(TARGETS syslog-bulk-uploader DESTINATION bin) ## ## Installers configuration ## include(InstallRequiredSystemLibraries) -set(CPACK_GENERATOR "RPM;DEB") +set(CPACK_GENERATOR "RPM;DEB;TGZ") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${VER_NAME}") set(CPACK_PACKAGE_VENDOR "Marko Zivanovic ") set(CPACK_PACKAGE_CONTACT "${CPACK_PACKAGE_VENDOR}") @@ -46,4 +46,30 @@ set(CPACK_PACKAGE_VERSION "${SLBU_VER}") set(CPACK_SOURCE_STRIP_FILES TRUE) set(CPACK_STRIP_FILES TRUE) set(CPACK_RPM_PACKAGE_LICENSE "MIT") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE) +set(CPACK_DEBIAN_PACKAGE_SECTION "net") +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/zmarko/syslog-bulk-uploader") include(CPack) + +## +## Generate documentation +## +find_program(A2X_EXECUTABLE NAMES a2x) +set(A2X_OPTS --doctype manpage --format manpage -D ${CMAKE_CURRENT_BINARY_DIR}) + +set(MAN_NAMES syslog-bulk-uploader.1) +set(MAN_FILES) +foreach(m IN LISTS MAN_NAMES) + set(mf ${CMAKE_CURRENT_BINARY_DIR}/${m}) + set(ms ${CMAKE_CURRENT_SOURCE_DIR}/${m}.txt) + add_custom_command(OUTPUT ${mf} + COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS} ${ms} + DEPENDS ${ms} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Building manpage ${mf}" + VERBATIM) + list(APPEND MAN_FILES ${mf}) +endforeach() + +add_custom_target(man ALL DEPENDS ${MAN_FILES}) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syslog-bulk-uploader.1 DESTINATION man/man1/) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 80c9a59..b63c268 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) { ("mps,m", po::value(&mps)->default_value(1000), "send messages at specified rate per second") ("dest,d", po::value(&dest), "destination host name") ("port,p", po::value(&port)->default_value(514), "destination port") - ("files,f", po::value> (&files), "input file(s)") + ("file,f", po::value> (&files), "input file(s)") ; po::positional_options_description pos; pos.add("files", -1); diff --git a/src/syslog-bulk-uploader.1.txt b/src/syslog-bulk-uploader.1.txt new file mode 100644 index 0000000..065bb36 --- /dev/null +++ b/src/syslog-bulk-uploader.1.txt @@ -0,0 +1,71 @@ +SYSLOG-BULK-UPLOADER(1) +======================= +Marko Živanović + +NAME +---- +syslog-bulk-uploader - utility to send syslog records from file to remote syslog server + +SYNOPSIS +-------- +syslog-bulk-uploader [option]... [file]... + +DESCRIPTION +----------- +syslog-bulk-uploader is non-interactive utility designed to read syslog records from one or more files and send them +to remote syslog server. The format of syslog records in input files is: + +---- + +---- + +Field separator is one or more space (ASCII 32) or tab (ASCII 9) characters. All whitespace characters in the _message_ +field will be interpreted as part of the message, not as separators. + +Fields of the record are: + +*timestamp*:: in format YYYY-MM-DD HH:MM:SS +*facility*:: one of: kern,user,mail,daemon,auth,syslog,lpr,news,uucp,clock,authpriv,ftp,ntp,logaudit,logalert,cron,local0,local1,local2,local3,local4,local5,local6,local7 +*severity*:: one of: emergency,alert,critical,error,warning,notice,informational,debug +*source*:: IP address or host name of message source +*message*:: the text of the message itself + +OPTIONS +------- +*-h --help*:: display help message, then exit +*v --version*:: display version information, then exit +*-m --mps* num:: send messages at specified rate per second; default, if not specified, is 1000 +*-d --dest* dest:: destination host name +*-p --port* arg:: destination port; default, if not specified, is 514 +*[-f --files]* filename:: one or more input files; option name (-f or --file) is optional, i.e. all non-named arguments will be interpreted as filenames + +SEE ALSO +-------- +Project home page with source code, documentation, etc is at https://github.com/zmarko/syslog-bulk-uploader. + +BUGS +---- +The up-to-date list of current and historical issues is located at https://github.com/zmarko/syslog-bulk-uploader/issues. + +COPYRIGHT +--------- +Copyright (c) 2015 Marko Živanović. + +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. +