From 6f596f1dcbee812dd7feff1bc6664cdc7944f2a3 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Mon, 3 Jul 2023 08:53:20 +0200 Subject: Move project version to file, add xS manual page So far Go applications remain independent to handle Nix's inability to easily combine them with the CMake part. There is also no "install" target, because any packagers will want to adjust installation paths manually, and there is no configure step. --- xS/.gitignore | 1 + xS/Makefile | 13 ++++++------ xS/xS-gen-version.awk | 14 ------------- xS/xS.adoc | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ xS/xS.go | 2 ++ 5 files changed, 66 insertions(+), 21 deletions(-) delete mode 100644 xS/xS-gen-version.awk create mode 100644 xS/xS.adoc (limited to 'xS') diff --git a/xS/.gitignore b/xS/.gitignore index 4f7b84d..c07d73d 100644 --- a/xS/.gitignore +++ b/xS/.gitignore @@ -1,2 +1,3 @@ /xS /xS-replies.go +/xS.1 diff --git a/xS/Makefile b/xS/Makefile index f0f662d..92716ac 100644 --- a/xS/Makefile +++ b/xS/Makefile @@ -2,16 +2,15 @@ .SUFFIXES: AWK = env LC_ALL=C awk -outputs = xS xS-version.go xS-replies.go +outputs = xS xS-replies.go xS.1 all: $(outputs) -xS: xS.go xS-version.go xS-replies.go - go build -o $@ -xS-version.go: ../liberty/tools/cmake-parser.awk \ - xS-gen-version.awk ../CMakeLists.txt - $(AWK) -f ../liberty/tools/cmake-parser.awk \ - -f xS-gen-version.awk ../CMakeLists.txt > $@ +xS: xS.go ../xK-version xS-replies.go + go build -ldflags "-X 'main.projectVersion=$$(cat ../xK-version)'" -o $@ xS-replies.go: xS-gen-replies.awk xS-replies $(AWK) -f xS-gen-replies.awk xS-replies > $@ +xS.1: ../xK-version ../liberty/tools/asciiman.awk xS.adoc + env "asciidoc-release-version=$$(cat ../xK-version)" \ + $(AWK) -f ../liberty/tools/asciiman.awk xS.adoc > $@ clean: rm -f $(outputs) diff --git a/xS/xS-gen-version.awk b/xS/xS-gen-version.awk deleted file mode 100644 index 1312a63..0000000 --- a/xS/xS-gen-version.awk +++ /dev/null @@ -1,14 +0,0 @@ -# xS-gen-version.awk: extract version information from the CMake script -# -# Copyright (c) 2022, Přemysl Eric Janouch
-# SPDX-License-Identifier: 0BSD - -Command == "project" { - for (i = 2; i in Args; i++) - if (Args[i] == "VERSION") { - print "package main" - print "" - print "const projectVersion = `" Args[++i] "`" - exit - } -} diff --git a/xS/xS.adoc b/xS/xS.adoc new file mode 100644 index 0000000..c2154f4 --- /dev/null +++ b/xS/xS.adoc @@ -0,0 +1,57 @@ +xS(1) +===== +:doctype: manpage +:manmanual: xK Manual +:mansource: xK {release-version} + +Name +---- +xS - IRC daemon + +Synopsis +-------- +*xS* [_OPTION_]... + +Description +----------- +*xS* is a basic IRC daemon for single-server networks, suitable for testing +and private use. When run without a configuration file, it will start listening +on the standard port 6667 and the "any" address. + +Options +------- +*-debug*:: + Do not daemonize, print more information on the standard error stream + to help debug various issues. + +*-systemd*:: + Log using the format specified in *sd-daemon*(3). + +*-h*, *-help*:: + Display a help message and exit. + +*-version*:: + Output version information and exit. + +*-writedefaultcfg*:: + Write a configuration file with defaults, show its path and exit. ++ +The file will be appropriately commented. + +Files +----- +*xS* follows the XDG Base Directory Specification. + +_~/.config/xS/xS.conf_:: +_/etc/xdg/xS/xS.conf_:: + The daemon's configuration file. Use the *-writedefaultcfg* option + to create a new one for editing. + +Reporting bugs +-------------- +Use https://git.janouch.name/p/xK to report bugs, request features, +or submit pull requests. + +See also +-------- +*sd-daemon*(3) diff --git a/xS/xS.go b/xS/xS.go index feefb5c..25db005 100644 --- a/xS/xS.go +++ b/xS/xS.go @@ -42,6 +42,8 @@ import ( const projectName = "xS" +var projectVersion = "?" + var debugMode = false // --- Logging ----------------------------------------------------------------- -- cgit v1.2.3-70-g09d2