From fac5bd700ad7d7e60ff796a730d82186fc642fa3 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 20 Jan 2019 23:31:58 +0100 Subject: [PATCH] Added manpage. --- CMakeLists.txt | 13 ++++++++++++- README.md | 4 +++- build_manpage.sh | 10 ++++++++++ whyblocked.1.adoc | 25 +++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100755 build_manpage.sh create mode 100644 whyblocked.1.adoc diff --git a/CMakeLists.txt b/CMakeLists.txt index d69604b..a41346a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,12 @@ add_executable(whyblocked-gui target_link_libraries(whyblocked-gui ${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp Qt5::Widgets ${LIBCONFIG_LIBRARIES} stdc++fs) +set(WITH_MAN "YES") +if(WITH_MAN) + add_custom_command(TARGET whyblocked-gui POST_BUILD + COMMAND ${CMAKE_SOURCE_DIR}/build_manpage.sh + ARGS ${CMAKE_VERSION}) +endif() install(TARGETS whyblocked-gui DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES de.tastytea.Whyblocked.desktop DESTINATION @@ -55,8 +61,13 @@ install(FILES de.tastytea.Whyblocked.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo) install(FILES de.tastytea.Whyblocked.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps) +if(WITH_MAN) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/whyblocked.1 DESTINATION + ${CMAKE_INSTALL_MANDIR}/man1) +endif() -if(NOT WITHOUT_TRANSLATIONS) +set(WITH_TRANSLATIONS, "YES") +if(WITH_TRANSLATIONS) add_subdirectory(translations) endif() diff --git a/README.md b/README.md index f72a3e5..406ebdc 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Gentoo ebuilds are available via my * [libconfig++](https://github.com/hyperrealm/libconfig) (tested: 1.5) * Optional * Translations: [lupdate & lrelease](http://doc.qt.io/qt-5/linguist-manager.html) (tested: 5.11/5.5) + * Manpage: [asciidoc](http://asciidoc.org/) (tested: 8.6) #### Get sourcecode @@ -62,7 +63,8 @@ make install cmake options: * `-DCMAKE_BUILD_TYPE=Debug` for a debug build -* `-DWITHOUT_TRANSLATIONS=YES` to not compile translations +* `-DWITH_TRANSLATIONS=NO` to not compile translations +* `-DWITH_MAN=NO` to not compile the manpage * One of: * `-DWITH_DEB=YES` if you want to be able to generate a deb-package * `-DWITH_RPM=YES` if you want to be able to generate an rpm-package diff --git a/build_manpage.sh b/build_manpage.sh new file mode 100755 index 0000000..7914fc2 --- /dev/null +++ b/build_manpage.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +if [[ -n "${1}" ]]; then + dir="$(dirname ${0})" + cp -vf ${dir}/whyblocked.1.adoc . + sed -Ei "s/(Revision: +)[0-9]+\.[0-9]\.[0-9]/\1${1}/" whyblocked.1.adoc + a2x --doctype manpage --format manpage --no-xmllint whyblocked.1.adoc +else + echo "usage: ${0} VERSION" >&2 +fi diff --git a/whyblocked.1.adoc b/whyblocked.1.adoc new file mode 100644 index 0000000..7d7b052 --- /dev/null +++ b/whyblocked.1.adoc @@ -0,0 +1,25 @@ += whyblocked(1) +:Author: tastytea +:Email: tasttytea@tastytea.de +:Date: 2019-01-20 +:Revision: 0.0.0 +:man source: Whyblocked +:man version: {revision} +:man manual: General Commands Manual + +== NAME + +whyblocked - reminds you why you blocked someone. + +== SYNOPSIS + +*whyblocked* + +== DESCRIPTION + +Whyblocked allows you to store the reason why you blocked someone, along with +"receipts", URLs to the posts that led you to block them. + +== REPORTING BUGS + +Bugtracker: https://schlomp.space/tastytea/whyblocked/issues