Re: [RFC 8/8] doc: Move man pages under automake

2015-10-20 Thread Patrik Flykt

Hi,

On Mon, 2015-10-19 at 13:50 +0300, Jaakko Hannikainen wrote:
> This change prettifies man pages with  and /var/lib
> so that it will show the actual value connman was compiled with,
> rather than just hinting at some magical compile time variable.
> ---
>  .gitignore  |  8 ++--
>  Makefile.am | 17 
> -
>  ...man-service.config.5 => connman-service.config.5.in} |  8 
>  ...ovider.config.5 => connman-vpn-provider.config.5.in} |  6 +++---
>  doc/{connman-vpn.8 => connman-vpn.8.in} |  3 +--
>  doc/{connman-vpn.conf.5 => connman-vpn.conf.5.in}   |  8 +---
>  doc/{connman.8 => connman.8.in} |  3 +--
>  doc/{connman.conf.5 => connman.conf.5.in}   |  8 +---
>  doc/{connmanctl.1 => connmanctl.1.in}   |  0
>  9 files changed, 33 insertions(+), 28 deletions(-)
>  rename doc/{connman-service.config.5 => connman-service.config.5.in} (96%)
>  rename doc/{connman-vpn-provider.config.5 => 
> connman-vpn-provider.config.5.in} (98%)
>  rename doc/{connman-vpn.8 => connman-vpn.8.in} (93%)
>  rename doc/{connman-vpn.conf.5 => connman-vpn.conf.5.in} (90%)
>  rename doc/{connman.8 => connman.8.in} (95%)
>  rename doc/{connman.conf.5 => connman.conf.5.in} (97%)
>  rename doc/{connmanctl.1 => connmanctl.1.in} (100%)
> 
> diff --git a/.gitignore b/.gitignore
> index 9c22e4a..bbb44c3 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -64,8 +64,12 @@ unit/test-nat
>  doc/*.bak
>  doc/*.stamp
>  doc/connman.*
> -!doc/connman.8
> -!doc/connman.conf.5
> +doc/*.1
> +doc/*.5
> +doc/*.8
> +!doc/*.1.in
> +!doc/*.5.in
> +!doc/*.8.in
>  doc/connman-*.txt
>  
>  vpn/builtin.h
> diff --git a/Makefile.am b/Makefile.am
> index 8312a66..0887831 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -390,6 +390,21 @@ EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
>  EXTRA_DIST += src/main.conf \
>   src/eduroam.config
>  
> +%.1 : %.1.in
> + sed -e 's||$(sysconfdir)|' \
> + -e 's||$(storagedir)|' \
> + -e 's||$(vpn_storagedir)|' $< > $@
> +
> +%.5 : %.5.in
> + sed -e 's||$(sysconfdir)|' \
> + -e 's||$(storagedir)|' \
> + -e 's||$(vpn_storagedir)|' $< > $@
> +
> +%.8 : %.8.in
> + sed -e 's||$(sysconfdir)|' \
> + -e 's||$(storagedir)|' \
> + -e 's||$(vpn_storagedir)|' $< > $@
> +

As this is a .in file, I'd rather like @sysconfdir@ etc. being used
since @variablename@ is the common syntax here. At the bottom of
Makefile.am, there is do_subst that does the same thing.

>  dist_man_MANS = $(MANUAL_PAGES)
>  
>  pkgconfigdir = $(libdir)/pkgconfig
> @@ -471,4 +486,4 @@ include/connman/%.h: $(abs_top_srcdir)/include/%.h
>   $(AM_V_GEN)$(LN_S) $< $@
>  
>  clean-local:
> - @$(RM) -rf include/connman
> + @$(RM) -rf include/connman $(MANUAL_PAGES)
> diff --git a/doc/connman-service.config.5 b/doc/connman-service.config.5.in
> similarity index 96%
> rename from doc/connman-service.config.5
> rename to doc/connman-service.config.5.in
> index e1ee753..e932fe7 100644
> --- a/doc/connman-service.config.5
> +++ b/doc/connman-service.config.5.in
> @@ -6,11 +6,11 @@
>  .SH NAME
>  service-name.config \- ConnMan service provisioning file
>  .SH SYNOPSIS
> -.B /var/lib/connman/\fIservice-name\fB.config
> +.B /\fIservice-name\fB.config
>  .SH DESCRIPTION
>  .P
>  \fIConnMan\fP's services are configured with so called
> -"\fBprovisioning files\fP" which reside under \fI/var/lib/connman/\fP.
> +"\fBprovisioning files\fP" which reside under \fI/\fP.
>  The files can be named anything, as long as they end in \fB.config\fP.
>  The provisioning files can be used to configure for example secured
>  wireless access points which need complex authentication, for example
> @@ -125,7 +125,7 @@ method (should only be used with \fBEAP=ttls\fP).
>  .SH "EXAMPLE"
>  .SS Eduroam
>  This is a configuration file for eduroam networks. This file could for
> -example be in /var/lib/connman/eduroam.config. Your university's exact
> +example be in /eduroam.config. Your university's exact
>  settings might be different.
>  .PP
>  .nf
> @@ -139,7 +139,7 @@ CACertFile = /home/user/UNIV_CA.crt
>  .SS Complex networking
>  This is a configuration file for a network providing EAP-TLS, EAP-TTLS and
>  EAP-PEAP services. The respective SSIDs are tls_ssid, ttls_ssid and peap_ssid
> -and the file name is /var/lib/connman/example.config.
> +and the file name is /example.config.
>  .PP
>  Please note that the SSID entry is for hexadecimal encoded SSID (e.g. "SSID =
>  746c735f73736964"). If your SSID does not contain any exotic character then
> diff --git a/doc/connman-vpn-provider.config.5 
> b/doc/connman-vpn-provider.config.5.in
> similarity index 98%
> rename from doc/connman-vpn-provider.config.5
> rename to doc/connman-vpn-provider.config.5.in
> index 615b4c4..71e958c 100644
> --- a/doc/connman-vpn-pro

[RFC 8/8] doc: Move man pages under automake

2015-10-19 Thread Jaakko Hannikainen
This change prettifies man pages with  and /var/lib
so that it will show the actual value connman was compiled with,
rather than just hinting at some magical compile time variable.
---
 .gitignore  |  8 ++--
 Makefile.am | 17 -
 ...man-service.config.5 => connman-service.config.5.in} |  8 
 ...ovider.config.5 => connman-vpn-provider.config.5.in} |  6 +++---
 doc/{connman-vpn.8 => connman-vpn.8.in} |  3 +--
 doc/{connman-vpn.conf.5 => connman-vpn.conf.5.in}   |  8 +---
 doc/{connman.8 => connman.8.in} |  3 +--
 doc/{connman.conf.5 => connman.conf.5.in}   |  8 +---
 doc/{connmanctl.1 => connmanctl.1.in}   |  0
 9 files changed, 33 insertions(+), 28 deletions(-)
 rename doc/{connman-service.config.5 => connman-service.config.5.in} (96%)
 rename doc/{connman-vpn-provider.config.5 => connman-vpn-provider.config.5.in} 
(98%)
 rename doc/{connman-vpn.8 => connman-vpn.8.in} (93%)
 rename doc/{connman-vpn.conf.5 => connman-vpn.conf.5.in} (90%)
 rename doc/{connman.8 => connman.8.in} (95%)
 rename doc/{connman.conf.5 => connman.conf.5.in} (97%)
 rename doc/{connmanctl.1 => connmanctl.1.in} (100%)

diff --git a/.gitignore b/.gitignore
index 9c22e4a..bbb44c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,8 +64,12 @@ unit/test-nat
 doc/*.bak
 doc/*.stamp
 doc/connman.*
-!doc/connman.8
-!doc/connman.conf.5
+doc/*.1
+doc/*.5
+doc/*.8
+!doc/*.1.in
+!doc/*.5.in
+!doc/*.8.in
 doc/connman-*.txt
 
 vpn/builtin.h
diff --git a/Makefile.am b/Makefile.am
index 8312a66..0887831 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -390,6 +390,21 @@ EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
 EXTRA_DIST += src/main.conf \
src/eduroam.config
 
+%.1 : %.1.in
+   sed -e 's||$(sysconfdir)|' \
+   -e 's||$(storagedir)|' \
+   -e 's||$(vpn_storagedir)|' $< > $@
+
+%.5 : %.5.in
+   sed -e 's||$(sysconfdir)|' \
+   -e 's||$(storagedir)|' \
+   -e 's||$(vpn_storagedir)|' $< > $@
+
+%.8 : %.8.in
+   sed -e 's||$(sysconfdir)|' \
+   -e 's||$(storagedir)|' \
+   -e 's||$(vpn_storagedir)|' $< > $@
+
 dist_man_MANS = $(MANUAL_PAGES)
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -471,4 +486,4 @@ include/connman/%.h: $(abs_top_srcdir)/include/%.h
$(AM_V_GEN)$(LN_S) $< $@
 
 clean-local:
-   @$(RM) -rf include/connman
+   @$(RM) -rf include/connman $(MANUAL_PAGES)
diff --git a/doc/connman-service.config.5 b/doc/connman-service.config.5.in
similarity index 96%
rename from doc/connman-service.config.5
rename to doc/connman-service.config.5.in
index e1ee753..e932fe7 100644
--- a/doc/connman-service.config.5
+++ b/doc/connman-service.config.5.in
@@ -6,11 +6,11 @@
 .SH NAME
 service-name.config \- ConnMan service provisioning file
 .SH SYNOPSIS
-.B /var/lib/connman/\fIservice-name\fB.config
+.B /\fIservice-name\fB.config
 .SH DESCRIPTION
 .P
 \fIConnMan\fP's services are configured with so called
-"\fBprovisioning files\fP" which reside under \fI/var/lib/connman/\fP.
+"\fBprovisioning files\fP" which reside under \fI/\fP.
 The files can be named anything, as long as they end in \fB.config\fP.
 The provisioning files can be used to configure for example secured
 wireless access points which need complex authentication, for example
@@ -125,7 +125,7 @@ method (should only be used with \fBEAP=ttls\fP).
 .SH "EXAMPLE"
 .SS Eduroam
 This is a configuration file for eduroam networks. This file could for
-example be in /var/lib/connman/eduroam.config. Your university's exact
+example be in /eduroam.config. Your university's exact
 settings might be different.
 .PP
 .nf
@@ -139,7 +139,7 @@ CACertFile = /home/user/UNIV_CA.crt
 .SS Complex networking
 This is a configuration file for a network providing EAP-TLS, EAP-TTLS and
 EAP-PEAP services. The respective SSIDs are tls_ssid, ttls_ssid and peap_ssid
-and the file name is /var/lib/connman/example.config.
+and the file name is /example.config.
 .PP
 Please note that the SSID entry is for hexadecimal encoded SSID (e.g. "SSID =
 746c735f73736964"). If your SSID does not contain any exotic character then
diff --git a/doc/connman-vpn-provider.config.5 
b/doc/connman-vpn-provider.config.5.in
similarity index 98%
rename from doc/connman-vpn-provider.config.5
rename to doc/connman-vpn-provider.config.5.in
index 615b4c4..71e958c 100644
--- a/doc/connman-vpn-provider.config.5
+++ b/doc/connman-vpn-provider.config.5.in
@@ -6,11 +6,11 @@
 .SH NAME
 connection_name.config \- ConnMan vpn connection provisioning file
 .SH SYNOPSIS
-.B /var/lib/connman-vpn/\fIconnection-name\fB.config
+.B /\fIconnection-name\fB.config
 .SH DESCRIPTION
 .P
 \fIConnMan\fP's vpn connections are configured with so called
-"\fBprovisioning files\fP" which reside under \fI/var/lib/connman-vpn/\fP.
+"\fBprovisioning files\fP" which reside under \fI/\fP.
 The files c