projects/xwrited

changeset 5:f0c7f45022c0

Add manpage
author Guido Berhoerster <guido+xwrited@berhoerster.name>
date Sun Apr 27 23:12:06 2014 +0200 (2014-04-27)
parents f219f96f07c2
children c2ddd2f977d1
files Makefile data/docbook-update-source-data.xsl data/xwrited.1.xml data/xwrited.desktop.in po/POTFILES.in po/de.po xwrited.desktop.in
line diff
     1.1 --- a/Makefile	Sun Apr 27 23:12:06 2014 +0200
     1.2 +++ b/Makefile	Sun Apr 27 23:12:06 2014 +0200
     1.3 @@ -42,11 +42,29 @@
     1.4  MSGFMT :=	msgfmt
     1.5  INTLTOOL_UPDATE := intltool-update
     1.6  INTLTOOL_MERGE := intltool-merge
     1.7 +XSLTPROC :=	xsltproc
     1.8 +DOCBOOK5_MANPAGES_STYLESHEET =	http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
     1.9 +
    1.10 +define generate-manpage-rule =
    1.11 +%.$(1): %.$(1).xml
    1.12 +	$$(XSLTPROC) \
    1.13 +	    --xinclude \
    1.14 +	    --stringparam package $$(PACKAGE) \
    1.15 +	    --stringparam version $$(VERSION)\
    1.16 +	    data/docbook-update-source-data.xsl $$< | \
    1.17 +	    $$(XSLTPROC) \
    1.18 +	    --xinclude \
    1.19 +	    $$(DOCBOOK5_MANPAGES_FLAGS) \
    1.20 +	    --output $$@ \
    1.21 +	    $$(DOCBOOK5_MANPAGES_STYLESHEET) \
    1.22 +	    -
    1.23 +endef
    1.24  
    1.25  DESTDIR ?=
    1.26  prefix ?=	/usr/local
    1.27  bindir ?=	$(prefix)/bin
    1.28  datadir ?=	$(prefix)/share
    1.29 +mandir ?=	$(datadir)/man
    1.30  localedir ?=	$(datadir)/locale
    1.31  sysconfdir ?=	/etc
    1.32  xdgautostartdir ?= $(sysconfdir)/xdg/autostart
    1.33 @@ -82,7 +100,8 @@
    1.34  endif
    1.35  
    1.36  OBJS =		main.o xwrited-debug.o xwrited-unique.o $(OBJS_UTMP)
    1.37 -AUTOSTART_FILE = $(PACKAGE).desktop
    1.38 +MANPAGES =	data/$(PACKAGE).1
    1.39 +AUTOSTART_FILE = data/$(PACKAGE).desktop
    1.40  MOFILES :=	$(patsubst %.po,%.mo,$(wildcard po/*.po))
    1.41  POTFILE =	po/$(PACKAGE).pot
    1.42  POSRCS :=	$(shell $(SED) -e 's/\#.*//' -e '/^[ \t]*$$/d' \
    1.43 @@ -97,12 +116,14 @@
    1.44  		-DG_LOG_DOMAIN=\"$(PACKAGE)\"
    1.45  LDLIBS :=	$(EXTRA_LIBS) \
    1.46  		$(shell pkg-config --libs $(PKGCONFIG_LIBS))
    1.47 +DOCBOOK5_MANPAGES_FLAGS = --stringparam man.authors.section.enabled 0 \
    1.48 +			  --stringparam man.copyright.section.enabled 0
    1.49  
    1.50  .DEFAULT_TARGET = all
    1.51  
    1.52  .PHONY: all clean clobber dist install
    1.53  
    1.54 -all: $(PACKAGE) $(MOFILES) $(AUTOSTART_FILE)
    1.55 +all: $(PACKAGE) $(MANPAGES) $(MOFILES) $(AUTOSTART_FILE)
    1.56  
    1.57  $(PACKAGE): $(OBJS)
    1.58  	$(LINK.o) $^ $(LDLIBS) -o $@
    1.59 @@ -122,6 +143,8 @@
    1.60  	$(MAKEDEPEND.c) $< | $(SED) -f deps.sed >$*.d
    1.61  	$(COMPILE.c) -o $@ $<
    1.62  
    1.63 +$(foreach section,1 2 3 4 5 6 7 8 9,$(eval $(call generate-manpage-rule,$(section))))
    1.64 +
    1.65  %.desktop: %.desktop.in $(MOFILES)
    1.66  	$(INTLTOOL_MERGE) --desktop-style --utf8 po $< $@
    1.67  
    1.68 @@ -136,9 +159,11 @@
    1.69  	done
    1.70  	$(INSTALL.data) $(AUTOSTART_FILE) \
    1.71  	        "$(DESTDIR)$(xdgautostartdir)/$(notdir $(AUTOSTART_FILE))"
    1.72 +	$(INSTALL.data) data/$(PACKAGE).1 \
    1.73 +	        "$(DESTDIR)$(mandir)/man1/$(PACKAGE).1"
    1.74  
    1.75  clean:
    1.76 -	rm -f $(PACKAGE) $(OBJS) $(POTFILE) $(MOFILES) $(AUTOSTART_FILE)
    1.77 +	rm -f $(PACKAGE) $(OBJS) $(POTFILE) $(MOFILES) $(MANPAGES) $(AUTOSTART_FILE)
    1.78  
    1.79  clobber: clean
    1.80  	rm -f $(patsubst %.o,%.d,$(OBJS))
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/data/docbook-update-source-data.xsl	Sun Apr 27 23:12:06 2014 +0200
     2.3 @@ -0,0 +1,29 @@
     2.4 +<?xml version="1.0"?>
     2.5 +<xsl:stylesheet
     2.6 +  version="1.0"
     2.7 +  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     2.8 +  xmlns:db="http://docbook.org/ns/docbook"
     2.9 +  xmlns="http://docbook.org/ns/docbook"
    2.10 +  exclude-result-prefixes="xsl db">
    2.11 +
    2.12 +  <xsl:param name="package" select="''" />
    2.13 +  <xsl:param name="version" select="''" />
    2.14 +
    2.15 +  <xsl:template match="db:refmeta/db:refmiscinfo[@class = 'source' or
    2.16 +    @class = 'version']"/>
    2.17 +
    2.18 +  <xsl:template match="db:refmeta">
    2.19 +    <xsl:copy>
    2.20 +      <xsl:apply-templates/>
    2.21 +      <refmiscinfo class="source"><xsl:value-of select="$package"/></refmiscinfo>
    2.22 +      <refmiscinfo class="version"><xsl:value-of select="$version"/></refmiscinfo>
    2.23 +    </xsl:copy>
    2.24 +  </xsl:template>
    2.25 +
    2.26 +  <xsl:template match="@*|node()">
    2.27 +    <xsl:copy>
    2.28 +      <xsl:apply-templates select="@*|node()"/>
    2.29 +    </xsl:copy>
    2.30 +  </xsl:template>
    2.31 +
    2.32 +</xsl:stylesheet>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/data/xwrited.1.xml	Sun Apr 27 23:12:06 2014 +0200
     3.3 @@ -0,0 +1,159 @@
     3.4 +<?xml version="1.0"?>
     3.5 +<!--
     3.6 +
     3.7 +Copyright (C) 2014 Guido Berhoerster <guido+xwrited@berhoerster.name>
     3.8 +
     3.9 +Permission is hereby granted, free of charge, to any person obtaining
    3.10 +a copy of this software and associated documentation files (the
    3.11 +"Software"), to deal in the Software without restriction, including
    3.12 +without limitation the rights to use, copy, modify, merge, publish,
    3.13 +distribute, sublicense, and/or sell copies of the Software, and to
    3.14 +permit persons to whom the Software is furnished to do so, subject to
    3.15 +the following conditions:
    3.16 +
    3.17 +The above copyright notice and this permission notice shall be included
    3.18 +in all copies or substantial portions of the Software.
    3.19 +
    3.20 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    3.21 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    3.22 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    3.23 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    3.24 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    3.25 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    3.26 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    3.27 +
    3.28 +-->
    3.29 +<refentry xmlns="http://docbook.org/ns/docbook" xml:lang="en">
    3.30 +  <info>
    3.31 +    <author>
    3.32 +      <personname>
    3.33 +        <firstname>Guido</firstname>
    3.34 +        <surname>Berhoerster</surname>
    3.35 +      </personname>
    3.36 +      <email>guido+xwrited@berhoerster.name</email>
    3.37 +      <personblurb/>
    3.38 +    </author>
    3.39 +    <date>27 April, 2014</date>
    3.40 +  </info>
    3.41 +  <refmeta>
    3.42 +    <refentrytitle>xwrited</refentrytitle>
    3.43 +    <manvolnum>1</manvolnum>
    3.44 +    <refmiscinfo class="source"/>
    3.45 +    <refmiscinfo class="version"/>
    3.46 +    <refmiscinfo class="manual">User Commands</refmiscinfo>
    3.47 +  </refmeta>
    3.48 +  <refnamediv>
    3.49 +    <refname>xwrited</refname>
    3.50 +    <refpurpose>display write and wall messages as desktop
    3.51 +    notifications</refpurpose>
    3.52 +  </refnamediv>
    3.53 +  <refsynopsisdiv>
    3.54 +    <cmdsynopsis>
    3.55 +      <command>sencrypt</command>
    3.56 +      <arg choice="opt">
    3.57 +        <option>-d</option>
    3.58 +      </arg>
    3.59 +      <arg choice="opt">
    3.60 +        <option>-h</option>
    3.61 +      </arg>
    3.62 +      <arg choice="opt">
    3.63 +        <option>-V</option>
    3.64 +      </arg>
    3.65 +      <arg choice="opt">
    3.66 +        <option>-?</option>
    3.67 +      </arg>
    3.68 +      <arg choice="opt">
    3.69 +        <option>--debug</option>
    3.70 +      </arg>
    3.71 +      <arg choice="opt">
    3.72 +        <option>--help</option>
    3.73 +      </arg>
    3.74 +      <arg choice="opt">
    3.75 +        <option>--version</option>
    3.76 +      </arg>
    3.77 +    </cmdsynopsis>
    3.78 +  </refsynopsisdiv>
    3.79 +  <refsect1>
    3.80 +    <title>Description</title>
    3.81 +    <para>The <command>xwrited</command> utility displays
    3.82 +    <citerefentry><refentrytitle>write</refentrytitle><manvolnum>1</manvolnum>
    3.83 +    </citerefentry> and
    3.84 +    <citerefentry><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum>
    3.85 +    </citerefentry> messages as desktop notifications. A notification daemon
    3.86 +    compliant to the freedesktop.org Desktop Notification Specification draft
    3.87 +    needs to be running in order to display the notifications.</para>
    3.88 +  </refsect1>
    3.89 +  <refsect1>
    3.90 +    <title>Options</title>
    3.91 +    <para>The following options are supported:</para>
    3.92 +    <variablelist>
    3.93 +      <varlistentry>
    3.94 +        <term>
    3.95 +          <option>-h</option>
    3.96 +        </term>
    3.97 +        <term>
    3.98 +          <option>-?</option>
    3.99 +        </term>
   3.100 +        <term>
   3.101 +          <option>--help</option>
   3.102 +        </term>
   3.103 +        <listitem>
   3.104 +          <para>Print a summary of all command line options and exit.</para>
   3.105 +        </listitem>
   3.106 +      </varlistentry>
   3.107 +      <varlistentry>
   3.108 +        <term>
   3.109 +          <option>-d</option>
   3.110 +        </term>
   3.111 +        <term>
   3.112 +          <option>--debug</option>
   3.113 +        </term>
   3.114 +        <listitem>
   3.115 +          <para>Enable debugging output.</para>
   3.116 +        </listitem>
   3.117 +      </varlistentry>
   3.118 +      <varlistentry>
   3.119 +        <term>
   3.120 +          <option>-V</option>
   3.121 +        </term>
   3.122 +        <term>
   3.123 +          <option>--version</option>
   3.124 +        </term>
   3.125 +        <listitem>
   3.126 +          <para>Print the version number and exit.</para>
   3.127 +        </listitem>
   3.128 +      </varlistentry>
   3.129 +    </variablelist>
   3.130 +  </refsect1>
   3.131 +  <refsect1>
   3.132 +    <title>Exit Status</title>
   3.133 +    <para>The following exit values are returned:</para>
   3.134 +    <variablelist>
   3.135 +      <varlistentry>
   3.136 +        <term>0</term>
   3.137 +        <listitem>
   3.138 +          <para>Command successfully executed.</para>
   3.139 +        </listitem>
   3.140 +      </varlistentry>
   3.141 +      <varlistentry>
   3.142 +        <term>&gt; 0</term>
   3.143 +        <listitem>
   3.144 +          <para>An error has occured.</para>
   3.145 +        </listitem>
   3.146 +      </varlistentry>
   3.147 +    </variablelist>
   3.148 +  </refsect1>
   3.149 +  <refsect1>
   3.150 +    <title>See Also</title>
   3.151 +    <para><citerefentry><refentrytitle>write</refentrytitle>
   3.152 +    <manvolnum>1</manvolnum></citerefentry>,
   3.153 +    <citerefentry> <refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum>
   3.154 +    </citerefentry></para>
   3.155 +  </refsect1>
   3.156 +  <refsect1>
   3.157 +    <title>Notes</title>
   3.158 +    <para>xwrited assumes that messages are encoded in UTF-8 because there is
   3.159 +    no way for it to determine the character set encoding of the received
   3.160 +    data.</para>
   3.161 +  </refsect1>
   3.162 +</refentry>
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/data/xwrited.desktop.in	Sun Apr 27 23:12:06 2014 +0200
     4.3 @@ -0,0 +1,8 @@
     4.4 +[Desktop Entry]
     4.5 +Encoding=UTF-8
     4.6 +_Name=xwrited
     4.7 +_Comment=Display write and wall messages as desktop notifications
     4.8 +Exec=xwrited
     4.9 +Terminal=false
    4.10 +Type=Application
    4.11 +Categories=System;Monitor;
     5.1 --- a/po/POTFILES.in	Sun Apr 27 23:12:06 2014 +0200
     5.2 +++ b/po/POTFILES.in	Sun Apr 27 23:12:06 2014 +0200
     5.3 @@ -1,4 +1,4 @@
     5.4 -xwrited.desktop.in
     5.5 +data/xwrited.desktop.in
     5.6  main.c
     5.7  xwrited-debug.c
     5.8  xwrited-unique.c
     6.1 --- a/po/de.po	Sun Apr 27 23:12:06 2014 +0200
     6.2 +++ b/po/de.po	Sun Apr 27 23:12:06 2014 +0200
     6.3 @@ -18,11 +18,11 @@
     6.4  "Content-Transfer-Encoding: 8bit\n"
     6.5  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
     6.6  
     6.7 -#: ../xwrited.desktop.in.h:1
     6.8 +#: ../data/xwrited.desktop.in.h:1
     6.9  msgid "xwrited"
    6.10  msgstr "xwrited"
    6.11  
    6.12 -#: ../xwrited.desktop.in.h:2
    6.13 +#: ../data/xwrited.desktop.in.h:2
    6.14  msgid "Display write and wall messages as desktop notifications"
    6.15  msgstr "Zeigt write und wall Nachrichten as Desktop-Benachrichtigungen an"
    6.16  
     7.1 --- a/xwrited.desktop.in	Sun Apr 27 23:12:06 2014 +0200
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,8 +0,0 @@
     7.4 -[Desktop Entry]
     7.5 -Encoding=UTF-8
     7.6 -_Name=xwrited
     7.7 -_Comment=Display write and wall messages as desktop notifications
     7.8 -Exec=xwrited
     7.9 -Terminal=false
    7.10 -Type=Application
    7.11 -Categories=System;Monitor;