From b755a2ef9e53b666fa944cc535b563876556d565 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Fri, 27 Nov 2020 21:25:48 +1300 Subject: [PATCH] edit manpages and cmakeize them so that they will be installed in the correct place as part of a normal build or packaging process. --- CMakeLists.txt | 13 +++++++ debian/laminarc.1 | 64 ---------------------------------- debian/laminarc.manpages | 1 - debian/laminard.manpages | 1 - etc/laminarc.1 | 71 ++++++++++++++++++++++++++++++++++++++ {debian => etc}/laminard.8 | 12 +++---- 6 files changed, 90 insertions(+), 72 deletions(-) delete mode 100644 debian/laminarc.1 delete mode 100644 debian/laminarc.manpages delete mode 100644 debian/laminard.manpages create mode 100644 etc/laminarc.1 rename {debian => etc}/laminard.8 (82%) diff --git a/CMakeLists.txt b/CMakeLists.txt index eddc0d7..19e5443 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,19 @@ target_link_libraries(laminard capnp-rpc capnp kj-http kj-async kj pthread sqlit add_executable(laminarc src/client.cpp src/version.cpp laminar.capnp.c++) target_link_libraries(laminarc capnp-rpc capnp kj-async kj pthread) +## Manpages +macro(gzip SOURCE) + get_filename_component(OUT_FILE ${SOURCE} NAME) + add_custom_command(OUTPUT ${OUT_FILE}.gz + COMMAND gzip < ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE} > ${OUT_FILE}.gz + DEPENDS ${SOURCE}) +endmacro() +add_custom_target(laminar-manpages ALL DEPENDS laminard.8.gz laminarc.1.gz) +gzip(etc/laminard.8) +gzip(etc/laminarc.1) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/laminard.8.gz DESTINATION share/man/man8) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/laminarc.1.gz DESTINATION share/man/man1) + ## Tests set(BUILD_TESTS FALSE CACHE BOOL "Build tests") if(BUILD_TESTS) diff --git a/debian/laminarc.1 b/debian/laminarc.1 deleted file mode 100644 index f08818f..0000000 --- a/debian/laminarc.1 +++ /dev/null @@ -1,64 +0,0 @@ -.Dd Apr 04, 2019 -.Dt LAMINARC 1 -.Sh NAME -.Nm laminarc -client to laminar continous integration server -.Sh SYNOPSIS -.Nm laminarc Li queue Ar job Op Ar params ... -.Nm laminarc Li start Ar job Op Ar params ... -.Nm laminarc Li run Ar job Op Ar params ... -.Nm laminarc Li set Op var=value ... -.Nm laminarc Li show-jobs -.Nm laminarc Li show-running -.Nm laminarc Li show-queued -.Nm laminarc Li abort Ar job Ar number -.Sh DESCRIPTION -The -.Nm laminarc -program connects to server and perform one of following operations. -.Bl -tag -.It Sy queue -add job to the queue with optional parameters, return immediately. -.It Sy start -add job to the queue with optional parameters, return when the jobs -begin execution. -.It Sy set -set one or more variables to be exported in subsequent scripts -for the run identified by the `$JOB` and `$RUN` environment variables. -.It Sy show-jobs -show jobs, known to the server. -.It Sy show-running -show the currently running jobs with their numbers. -.It Sy show-queued -show the names of the jobs waiting in the queue. -.It Sy abort -manually abort a currently running job by name and number. -.El -.Pp -If neither -.Ev LAMINAR_HOST -nor -.Ev LAMINAR_BIND_RPC -variables are set, -.Nm laminarc -assumes default host of -.Ad unix-abstract:laminar. -.Sh ENVIRONMENT -.Bl -tag -.It Ev LAMINAR_HOST -address of server to connect. May be of the form -.Ad IP:PORT, -.Ad unix:PATH/TO/SOCKET or -.Ad unix-abstract:NAME -.It Ev LAMINAR_BIND_RPC -fallback server address variable. It is set by -.Nm laminard -during execution of scripts. -.Sh SEE ALSO -.Xr laminard 8 -.Sh AUTHORS -.An Oliver Giles -created Laminar continous integration system. -.An Dmitry Bogatov -created this manual page for Debian project (but it can be used -by others). diff --git a/debian/laminarc.manpages b/debian/laminarc.manpages deleted file mode 100644 index f724991..0000000 --- a/debian/laminarc.manpages +++ /dev/null @@ -1 +0,0 @@ -debian/laminarc.1 diff --git a/debian/laminard.manpages b/debian/laminard.manpages deleted file mode 100644 index f6c59b2..0000000 --- a/debian/laminard.manpages +++ /dev/null @@ -1 +0,0 @@ -debian/laminard.8 diff --git a/etc/laminarc.1 b/etc/laminarc.1 new file mode 100644 index 0000000..196977a --- /dev/null +++ b/etc/laminarc.1 @@ -0,0 +1,71 @@ +.Dd Apr 04, 2019 +.Dt LAMINARC 1 +.Sh NAME +.Nm laminarc +\- +Laminar CI client application +.Sh SYNOPSIS +.Nm laminarc Li queue \fIJOB\fR [\fIPARAM=VALUE...\fR] ... +.Nm laminarc Li queue \fIJOB\fR [\fIPARAM=VALUE...\fR] ... +.Nm laminarc Li queue \fIJOB\fR [\fIPARAM=VALUE...\fR] ... +.Nm laminarc Li set \fIPARAM=VALUE...\fR +.Nm laminarc Li show-jobs +.Nm laminarc Li show-running +.Nm laminarc Li show-queued +.Nm laminarc Li abort \fIJOB\fR \fINUMBER\fR +.Sh DESCRIPTION +The +.Nm laminarc +program connects to a Laminar server and perform one of following operations: +.Bl -tag +.It Sy queue +adds job(s) (with optional parameters) to the queue and returns immediately. +.It Sy start +adds job(s) (with optional parameters) to the queue and returns when the jobs +begin execution. +.It Sy run +adds job(s) (with optional parameters) to the queue and returns when the jobs +complete execution. The exit code will be non-zero if any of the runs does +not complete successfully. +.It Sy set +sets one or more parameters to be exported as environment variables in subsequent +scripts for the run identified by the $JOB and $RUN environment variables. +This is primarily intended for use from within a job execution, where those +variables are already set by the server. +.It Sy show-jobs +list jobs known to the server. +.It Sy show-running +list the currently running jobs with their numbers. +.It Sy show-queued +list the names and numbers of the jobs waiting in the queue. +.It Sy abort +manually abort a currently running job by name and number. +.El +.Pp +The laminar server to connect to is read from the +.Ev LAMINAR_HOST +environment variable. If empty, it falls back to +.Ev LAMINAR_BIND_RPC +and finally defaults to +.Ad +unix-abstract:laminar. +.Sh ENVIRONMENT +.Bl -tag +.It Ev LAMINAR_HOST +address of server to connect. May be of the form +.Ad IP:PORT, +.Ad unix:PATH/TO/SOCKET or +.Ad unix-abstract:NAME +.It Ev LAMINAR_BIND_RPC +fallback server address variable. It is set by +.Nm laminard +during execution of scripts. +.El +.Sh SEE ALSO +.Xr laminard 8 +.Sh AUTHORS +.An Oliver Giles +created Laminar CI. +.An Dmitry Bogatov +created this manual page for the Debian project (but it can be used +by others). diff --git a/debian/laminard.8 b/etc/laminard.8 similarity index 82% rename from debian/laminard.8 rename to etc/laminard.8 index 86ca767..34c7dc2 100644 --- a/debian/laminard.8 +++ b/etc/laminard.8 @@ -3,14 +3,14 @@ .Sh NAME .Nm laminard \- -continuous integration server +Laminar CI server .Sh SYNOPSIS .Nm laminard Op Fl v .Sh DESCRIPTION -Start laminar continuous integration server in foreground. If option +Start Laminar CI server in the foreground. If option .Fl v is specified, verbose logging is enabled. Other aspects of -operation are configured with environment variables. +operation are controlled by environment variables. .Sh ENVIRONMENT .Bl -tag .It Ev LAMINAR_HOME @@ -45,12 +45,12 @@ requests. .Sh FILES .Bl -tag .It Pa /etc/laminar.conf -On Debian systems, variable assignments in this file are used by -system-wide installation of Laminar. +Variable assignments in this file are exported by systemd or other +init system before launching the system-wide installation of Laminar. .El .Sh AUTHORS .An Oliver Giles -created Laminar continuous integration system. +created Laminar CI. .An Dmitry Bogatov created this manual page for Debian project (but it can be used by others).