summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-11-16 22:28:17 +0100
committerJens Georg <mail@jensge.org>2022-11-16 22:37:33 +0100
commit1970906319eefa0bf48553e60ee67b5a75b9e1c5 (patch)
tree24872a42c3fca0e4cb6458cafaed9a5b9f03cb56
parente0b477c37c18b0de50cc62a549e639c7527bba25 (diff)
downloadgssdp-1970906319eefa0bf48553e60ee67b5a75b9e1c5.tar.gz
doc,build: Add manpage for sniffer
-rw-r--r--doc/gssdp-device-sniffer.md30
-rw-r--r--doc/gssdp.toml.in4
-rw-r--r--doc/meson.build76
-rw-r--r--doc/metadata.yml5
-rw-r--r--meson.build4
-rw-r--r--meson_options.txt1
6 files changed, 90 insertions, 30 deletions
diff --git a/doc/gssdp-device-sniffer.md b/doc/gssdp-device-sniffer.md
new file mode 100644
index 0000000..1c6dcc8
--- /dev/null
+++ b/doc/gssdp-device-sniffer.md
@@ -0,0 +1,30 @@
+---
+Title: Manpage for gssdp-device-sniffer
+---
+
+# NAME
+
+gssdp-device-sniffer - display SSDP packets on your network
+
+# SYNOPSIS
+
+**gssdp-device-sniffer** [**-i**] [**-6**]
+
+# DESCRIPTION
+
+gssdp-device-sniffer is a tool that will listen for SSDP announcements that happen
+on your network.
+
+In addition to recording the SSDP packets and providing raw display, it will also
+keep track of the devices it has seen.
+
+# OPTIONS
+
+**-h**, **--help**
+: Display help
+
+**-i**, **--interface**
+: Name of the network interface the sniffer will listen on
+
+**-6**, **--prefer-v6**
+: Listen on IPv6 for SSDP announcements
diff --git a/doc/gssdp.toml.in b/doc/gssdp.toml.in
index d46edea..9b6076c 100644
--- a/doc/gssdp.toml.in
+++ b/doc/gssdp.toml.in
@@ -39,4 +39,8 @@ content_images = [
"images/gupnp-logo-short.svg"
]
+content_files = [
+ "gssdp-device-sniffer.md"
+]
+
urlmap_file = "urlmap.js"
diff --git a/doc/meson.build b/doc/meson.build
index c091cd4..f8640ab 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,34 +1,56 @@
-entities = configuration_data()
-entities.set('VERSION', meson.project_version())
+if get_option('gtk_doc')
+ entities = configuration_data()
+ entities.set('VERSION', meson.project_version())
-gidocgen = find_program('gi-docgen', required: true)
+ gidocgen = find_program('gi-docgen', required: true)
-gssdp_toml = configure_file (
- input: 'gssdp.toml.in',
- output: 'gssdp.toml',
- configuration: entities
-)
+ gssdp_toml = configure_file (
+ input: 'gssdp.toml.in',
+ output: 'gssdp.toml',
+ configuration: entities
+ )
-docs_dir = join_paths(get_option('prefix'), get_option('datadir'), 'doc')
+ docs_dir = join_paths(get_option('prefix'), get_option('datadir'), 'doc')
-custom_target(
- 'gssdp-doc',
- input: [ gssdp_toml, gir[0] ],
- output: GSSDP_API_NAME,
- command : [
- gidocgen,
- 'generate',
- '--quiet',
- '--add-include-path=@0@'.format(meson.current_build_dir() / '../libgssdp'),
- '--config', gssdp_toml,
- '--output-dir=@OUTPUT@',
- '--no-namespace-dir',
- '--content-dir=@0@'.format(meson.current_source_dir()),
- '@INPUT1@',
+ custom_target(
+ 'gssdp-doc',
+ input: [ gssdp_toml, gir[0] ],
+ output: GSSDP_API_NAME,
+ command : [
+ gidocgen,
+ 'generate',
+ '--quiet',
+ '--add-include-path=@0@'.format(meson.current_build_dir() / '../libgssdp'),
+ '--config', gssdp_toml,
+ '--output-dir=@OUTPUT@',
+ '--no-namespace-dir',
+ '--content-dir=@0@'.format(meson.current_source_dir()),
+ '@INPUT1@',
+ ],
+ depend_files : [gssdp_toml, files('gssdp-device-sniffer.md')],
+ build_by_default: true,
+ install: true,
+ install_dir : docs_dir,
+ )
+endif
+
+if get_option('manpages')
+ pandoc = find_program('pandoc', required: true)
+ custom_target(
+ 'manpages',
+ input: files('gssdp-device-sniffer.md'),
+ output: 'gssdp-device-sniffer.1',
+ command: [
+ pandoc,
+ '@INPUT@',
+ meson.current_source_dir() / 'metadata.yml',
+ '-s',
+ '-t', 'man',
+ '-o', '@OUTPUT@'
],
- depend_files : gssdp_toml,
+ depend_files : files('gssdp-device-sniffer.md', 'metadata.yml'),
build_by_default: true,
install: true,
- install_dir : docs_dir,
-)
-
+ install_dir: join_paths(get_option('prefix'), get_option('mandir'), 'man1'),
+ )
+endif
diff --git a/doc/metadata.yml b/doc/metadata.yml
new file mode 100644
index 0000000..a8d65fc
--- /dev/null
+++ b/doc/metadata.yml
@@ -0,0 +1,5 @@
+---
+title: GSSDP-DEVICE-SNIFFER(1)
+author: Jens Georg
+date: November 2022
+---
diff --git a/meson.build b/meson.build
index ad68ef0..ac24c17 100644
--- a/meson.build
+++ b/meson.build
@@ -97,9 +97,7 @@ gidocgen_dep = dependency('gi-docgen', version: '>= 2021.1',
required: get_option('gtk_doc') and get_option('introspection')
)
-if get_option('gtk_doc')
- subdir('doc')
-endif
+subdir('doc')
if get_option('examples')
subdir('examples')
diff --git a/meson_options.txt b/meson_options.txt
index ab1f0bd..5f85187 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,3 +3,4 @@ option('sniffer', type: 'boolean', value: true, description: 'Compile graphical
option('introspection', type: 'boolean', value : true, description: 'Enable or disable GObject Introspection')
option('vapi', type: 'boolean', value: true, description: 'Enable or disable generation of Vala vapi file')
option('examples', type: 'boolean', value: true, description : 'Enable or disable examples')
+option('manpages', type: 'boolean', value: true, description : 'Generate man page for tools')