Skip to content

Commit 84a0e3f

Browse files
committed
docs: properly geneate man page
* Makefile.am (INSTALL_SCRIPT): Re-define to our wrapper. * auxdir/our-install-sh: New wrapper around 'install -c'. * doc/Makefile.inc: Ensure manpage source is referenced with leading $(builddir) variable. * postgresql-setup.in: Add build-time only function which translates install-time dirs into source dirs.
1 parent 029b10e commit 84a0e3f

File tree

5 files changed

+61
-3
lines changed

5 files changed

+61
-3
lines changed

Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ readme_dist_m4 = README.rpm-dist.m4
2121
readme_dist_sed = README.rpm-dist.sed
2222
readme_template = README.rpm-dist.template
2323

24-
EXTRA_DIST =
24+
INSTALL_SCRIPT = $(top_srcdir)/auxdir/our-install-sh
25+
EXTRA_DIST = $(INSTALL_SCRIPT)
2526
INTERMEDIATE_FILES =
2627
GENERATED_FILES =
2728
CLEANFILES =

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Bugfixes in 5.1 version
66

77
* the sysvinit/systemd systems are now detected
88

9+
* properly generate manpage with help2man
10+
911
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1012

1113
Bugfixes in 5.0 version

auxdir/our-install-sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#! /bin/sh
2+
3+
/usr/bin/install -c "$@" || exit $?
4+
5+
edit_installed ()
6+
{
7+
file=$1
8+
9+
cp "$file" "$file"~
10+
11+
awk '
12+
BEGIN { matched = 0 ; }
13+
14+
/^builddir_source \(\)/ { matched = 1 ; }
15+
16+
/^}$/ {
17+
if (matched)
18+
matched = 0;
19+
else
20+
print;
21+
next;
22+
}
23+
24+
/^builddir_source "/ {
25+
$1 = "." ;
26+
print ;
27+
next;
28+
}
29+
30+
{ if (!matched) print ; }
31+
32+
' > "$file" < "$file"~
33+
34+
rm "$file"~
35+
}
36+
37+
for arg in "$@"
38+
do
39+
last=$arg
40+
done
41+
42+
prev=$1
43+
shift
44+
45+
for arg in "$@"
46+
do
47+
edit_installed "$last/$(basename "$prev")"
48+
done

doc/Makefile.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ setup_man = %D%/$(NAME_BINARYBASE)-setup.1
2626
dist_man_MANS = $(setup_man)
2727

2828
$(setup_man): $(NAME_BINARYBASE)-setup
29-
$(AM_V_GEN)export input=$(NAME_BINARYBASE)-setup ; \
29+
$(AM_V_GEN)export input=$(builddir)/$(NAME_BINARYBASE)-setup ; \
3030
$(HELP2MAN_RUN)
3131

3232
DISTCLEANFILES += $(setup_man)

postgresql-setup.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ SU_POSTGRES="@SU_POSTGRES@"
2121
# The where PostgreSQL server listens by default
2222
PGPORT_DEF=5432
2323

24-
. "@rawpkgdatadir@/library.sh"
24+
builddir_source ()
25+
{
26+
# To simplify manpage generator. Build-time-only.
27+
file=$(echo "$1" | sed -e "s|@rawpkgdatadir@|share/postgresql-setup|")
28+
. "@abs_top_builddir@/$file"
29+
}
30+
31+
builddir_source "@rawpkgdatadir@/library.sh"
2532

2633
@SCL_SOURCE@
2734

0 commit comments

Comments
 (0)