summarylogtreecommitdiffstats
path: root/use-asciidoc-for-manpages.patch
blob: e988d252bb51a1a8a3ebbaed7ed9a850aef1d3b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 10c2b82..6be47d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,28 +37,6 @@ set_package_properties(Icecream PROPERTIES
   URL "http://en.opensuse.org/Icecream"
   TYPE REQUIRED
 )
-find_package(Docbook2X)
-set_package_properties(Docbook2X PROPERTIES
-  DESCRIPTION "docbook2X converts DocBook documents into the traditional Unix man page format"
-  PURPOSE "Required for man-page generation"
-  URL "http://docbook2x.sourceforge.net/"
-)
-
-# add a target to generate API documentation with Doxygen
-find_package(Doxygen)
-set_package_properties(Doxygen PROPERTIES
-  TYPE OPTIONAL
-  DESCRIPTION "Doxygen documentation generator"
-  PURPOSE "Needed for generating API documentation (make doc)"
-)
-if(DOXYGEN_FOUND)
-  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
-  add_custom_target(doc
-    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-    COMMENT "Generating API documentation with Doxygen" VERBATIM
-  )
-endif()
 
 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
diff --git a/cmake/modules/FindDocbook2X.cmake b/cmake/modules/FindDocbook2X.cmake
deleted file mode 100644
index 81d9f7a..0000000
--- a/cmake/modules/FindDocbook2X.cmake
+++ /dev/null
@@ -1,97 +0,0 @@
-# Attempt to find docbook-to-man binary from docbook2x package
-#
-# This module defines:
-# - DOCBOOK_TO_MAN_EXECUTABLE, path to docbook2x-man binary
-#
-# Note that the binary docbook-to-man in debian systems is a different application
-# than in other distributions.
-#
-# Debian systems
-# * docbook-to-man comes from the package docbook-to-man
-# * docbook2man comes from the package docbook-utils
-# * docbook2x-man comes from the package docbook2x
-# Suse
-# * docbook-to-man comes from the package docbook2x
-# * docbook2man comes from the package docbook-utils-minimal
-# ArchLinux
-# * docbook-to-man comes from the package docbook-to-man
-# * docbook2man comes from the package docbook2x
-#
-# We actually want the binary from docbook2x, which supports XML
-
-#=============================================================================
-# Copyright 2013 Kevin Funk <kfunk@kde.org>
-# Copyright 2015 Alex Merry <alexmerry@kde.org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-macro(_check_docbook2x_executable)
-    if (DOCBOOK_TO_MAN_EXECUTABLE)
-        execute_process(
-            COMMAND ${DOCBOOK_TO_MAN_EXECUTABLE} --version
-            OUTPUT_VARIABLE _output
-            ERROR_QUIET
-        )
-        if("${_output}" MATCHES "docbook2X ([0-9]+\\.[0-9]+\\.[0-9]+)")
-            set(DOCBOOK_TO_MAN_EXECUTABLE ${_docbook_to_man_executable})
-            set(Docbook2X_VERSION ${CMAKE_MATCH_1})
-        else()
-            unset(DOCBOOK_TO_MAN_EXECUTABLE)
-            unset(DOCBOOK_TO_MAN_EXECUTABLE CACHE)
-        endif()
-    endif()
-endmacro()
-
-if (DOCBOOK_TO_MAN_EXECUTABLE)
-    _check_docbook2x_executable()
-else()
-    foreach(test_exec docbook2x-man docbook-to-man db2x_docbook2man docbook2man)
-        find_program(DOCBOOK_TO_MAN_EXECUTABLE
-            NAMES ${test_exec}
-        )
-        _check_docbook2x_executable()
-        if (DOCBOOK_TO_MAN_EXECUTABLE)
-            break()
-        endif()
-    endforeach()
-endif()
-
-include(FindPackageHandleStandardArgs)
-
-find_package_handle_standard_args(Docbook2X
-# TODO: Use FOUND_VAR when requiring CMake 2.8.11
-#    FOUND_VAR Docbook2X_FOUND
-    REQUIRED_VARS DOCBOOK_TO_MAN_EXECUTABLE
-    VERSION_VAR Docbook2X_VERSION
-)
-set(Docbook2X_FOUND DOCBOOK2X_FOUND)
-
-if (Docbook2X_FOUND)
-    macro(install_docbook_man_page name section)
-        set(inputfn "man-${name}.${section}.xml")
-        set(input "${CMAKE_CURRENT_SOURCE_DIR}/${inputfn}")
-        set(outputfn "${name}.${section}")
-        set(output "${CMAKE_CURRENT_BINARY_DIR}/${outputfn}")
-        set(target "manpage-${outputfn}")
-
-        add_custom_command(
-            OUTPUT ${output}
-            COMMAND ${DOCBOOK_TO_MAN_EXECUTABLE} ${input}
-            DEPENDS ${input}
-            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-        )
-        add_custom_target(${target} ALL
-            DEPENDS "${output}"
-        )
-        install(
-            FILES ${output}
-            DESTINATION ${CMAKE_INSTALL_MANDIR}/man${section}
-        )
-    endmacro()
-endif()
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 4e83c15..8138dfe 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,6 +1,27 @@
 # It's not possible to install the docbook right now (Qt-only project)
 #add_subdirectory(icemon)
 
-if(DOCBOOK_TO_MAN_EXECUTABLE)
-  install_docbook_man_page(icemon 1)
+find_program(ASCIIDOC asciidoc)
+find_program(A2X a2x)
+
+if(NOT ASCIIDOC OR NOT A2X)
+    message(WARNING "Could not find asciidoc or a2x, manual page will not be generated.")
+else()
+    add_custom_target(manpage ALL)
+    add_custom_command(
+        TARGET manpage
+        COMMAND ${ASCIIDOC} -a revnumber=${PROJECT_VERSION} -d manpage -b docbook
+            -o ${CMAKE_CURRENT_BINARY_DIR}/icemon.xml ${CMAKE_CURRENT_SOURCE_DIR}/icemon.adoc
+        MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/icemon.adoc
+        BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/icemon.xml)
+    add_custom_command(
+        TARGET manpage
+        COMMAND ${A2X} --doctype manpage --format manpage
+             ${CMAKE_CURRENT_BINARY_DIR}/icemon.xml
+        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+        MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/icemon.xml
+        BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/icemon.1)
+    install(
+        FILES ${CMAKE_CURRENT_BINARY_DIR}/icemon.1
+        DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif()
diff --git a/doc/icemon.adoc b/doc/icemon.adoc
new file mode 100644
index 0000000..7a23389
--- /dev/null
+++ b/doc/icemon.adoc
@@ -0,0 +1,54 @@
+ICEMON(1)
+=========
+:doctype: manpage
+:man source: icemon
+:man version: {revnumber}
+:man manual: Icemon User's Manual
+
+
+Name
+----
+icemon - Icecream network monitor
+
+
+Synopsis
+--------
+*icemon* _OPTION_
+
+
+Description
+-----------
+Icemon is a graphical application to view an Icecream compile network and monitor its traffic.
+
+
+
+Options
+-------
+
+*-h, --help*::
+    Print help message and exit.
+
+*-n, --netname* _net-name_::
+    The name of the Icecream network `icemon` should connect to.
+
+*-s, --scheduler* _host-name_::
+    The hostname of the Icecream scheduler `icemon` should connect to.
+
+
+
+See Also
+--------
+ifdef::env-github[]
+link:https://github.com/icecc/icecream/tree/master/doc/icecream.adoc[icecream(7)]
+link:https://github.com/icecc/icecream/tree/master/doc/icecc-scheduler.adoc[icecc-scheduler(1)]
+link:https://github.com/icecc/icecream/tree/master/doc/iceccd.adoc[iceccd(1)]
+endif::[]
+
+ifndef::env-github[]
+icecream(7), icecc-scheduler(1), iceccd(1)
+endif::[]
+
+
+Website
+-------
+Project home: https://github.com/icecc/icemon
diff --git a/doc/man-icemon.1.xml b/doc/man-icemon.1.xml
deleted file mode 100644
index 66cb6d8..0000000
--- a/doc/man-icemon.1.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" ?>
-<!-- vim:set ts=4 noet syntax=xml: -->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[
-  <!ENTITY icemon "<application>icemon</application>">
-]>
-
-<refentry id="icemon">
-
-<refentryinfo>
-  <title>Icecream User's Manual</title>
-  <author>
-    <personname>
-      <firstname>Pino</firstname>
-      <surname>Toscano</surname>
-    </personname>
-  </author>
-  <date>June 12th, 2013</date>
-  <productname>Icecream</productname>
-</refentryinfo>
-
-<refmeta>
-  <refentrytitle>icemon</refentrytitle>
-  <manvolnum>1</manvolnum>
-</refmeta>
-
-<refnamediv>
-  <refname>icemon</refname>
-  <refpurpose>Icecream network monitor</refpurpose>
-</refnamediv>
-
-<refsynopsisdiv>
-<cmdsynopsis>
-<command>icemon</command>
-<arg><replaceable>OPTION</replaceable></arg>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-<refsect1>
-<title>Description</title>
-<para>&icemon; is a graphical application to view an Icecream compile
-network and monitor its traffic.</para>
-</refsect1>
-
-<refsect1>
-<title>Options</title>
-
-<variablelist>
-
-<varlistentry>
-<term><option>-h</option>, <option>--help</option></term>
-<listitem><para>Print help message and exit.</para></listitem>
-</varlistentry>
-
-<varlistentry>
-<term><option>-n</option>, <option>--netname</option>
-<parameter>net-name</parameter></term>
-<listitem><para>The name of the Icecream network &icemon; should connect to.
-</para></listitem>
-</varlistentry>
-
-
-<varlistentry>
-<term><option>-s</option>, <option>--scheduler</option>
-<parameter>host-name</parameter></term>
-<listitem><para>The hostname of the Icecream scheduler &icemon; should connect to.
-</para></listitem>
-</varlistentry>
-
-</variablelist>
-
-</refsect1>
-
-
-<refsect1>
-<title>See Also</title>
-<para>icecream(7), icecc-scheduler(1), iceccd(1)</para>
-</refsect1>
-
-<refsect1>
-<title>Maintainers</title>
-<simplelist>
-<member>Daniel Molkentin &lt;molkentin@kde.org&gt;</member>
-<member>Kevin Funk &lt;kfunk@kde.org&gt;</member>
-</simplelist>
-</refsect1>
-
-<refsect1>
-<title>Website</title>
-<para>Project home: https://github.com/icecc/icemon</para>
-</refsect1>
-
-</refentry>