File: upstream-autotools-help2man.patch

package info (click to toggle)
singular 1:4.1.1-p2+ds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 35,860 kB
  • sloc: cpp: 288,280; ansic: 17,387; lisp: 4,242; yacc: 1,654; python: 1,608; makefile: 1,424; lex: 1,387; perl: 632; sh: 567; xml: 182
file content (158 lines) | stat: -rw-r--r-- 4,864 bytes parent folder | download
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
Description: autotools: help2man
 Implement the generation of the manpages for the front-end
 programs and development tools with help2man(1);
 meant to be submitted to the upstream maintainer.
Origin: vendor, Debian
Forwarded: https://github.com/Singular/Sources/pull/695
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2016-08-21

--- a/configure.ac
+++ b/configure.ac
@@ -43,6 +43,7 @@
 
 AC_CHECK_FUNCS(readlink getcwd getwd setenv putenv qsort_r)
 
+AC_PATH_PROG([HELP2MAN],[help2man])
 AC_CHECK_PROGS([DOXYGEN], [doxygen])
 if test -z "$DOXYGEN";
    then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
@@ -254,7 +255,8 @@
 
 AC_CONFIG_FILES([IntegerProgramming/Makefile])
 
-AC_CONFIG_FILES([libsingular-config Singular.pc])
+AC_CONFIG_FILES([Singular.pc])
+AC_CONFIG_FILES([libsingular-config], [chmod a+x libsingular-config])
 
 AC_CONFIG_FILES([emacs/Makefile])
 
--- a/Singular/Makefile.am
+++ b/Singular/Makefile.am
@@ -166,6 +166,20 @@
 
 bin_PROGRAMS = Singular ESingular TSingular $(optional_Singular_programs)
 
+man_MANS = Singular.1 ESingular.1 TSingular.1
+
+AM_H2MFLAGS = \
+	--manual="CAS Singular" \
+	--version-option="--dump-versiontuple" \
+	--source="Singular" \
+	--libtool \
+	--no-info
+
+## short descriptions for manpages
+Singular_DESCRIPTION =  "Computer Algebra System for Polynomial Computations -- command-line interface"
+ESingular_DESCRIPTION = "Computer Algebra System for Polynomial Computations -- command-line interface within emacs"
+TSingular_DESCRIPTION = "Computer Algebra System for Polynomial Computations -- command-line interface within a new terminal"
+
 Singular_SOURCES = tesths.cc fegetopt.c fegetopt.h utils.cc  utils.h
 
 Singular_LDADD = libSingular.la ${BUILTIN_FLAGS}
@@ -210,6 +224,15 @@
 libparse_LDADD = ${top_builddir}/omalloc/libomalloc.la
 libparse_LDFLAGS = -static ${AM_LDFLAGS}
 
+%.1: %
+	$(HELP2MAN) \
+			-s 1 \
+			$(AM_H2MFLAGS) \
+			-I $(top_srcdir)/Singular/man/$*.h2m \
+			-n $(if $($(subst -,_,$*)_DESCRIPTION), $($(subst -,_,$*)_DESCRIPTION), "manual page for $*") \
+			-o $@ \
+		$(abs_top_builddir)/Singular/$<
+
 #########################################################
 # the Singular library (*.lib files)
 
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,6 +13,17 @@
 
 bin_SCRIPTS = libsingular-config
 
+man_MANS = libsingular-config.1
+
+AM_H2MFLAGS = \
+	--manual="CAS Singular" \
+	--source="Singular" \
+	--libtool \
+	--no-info
+
+## short descriptions for manpages
+libsingular_config_DESCRIPTION = "get information about installed Singular library"
+
 dist-hook:
 	$(srcdir)/git-version-gen $(srcdir)/.tarball-git-version > $(distdir)/.tarball-git-version
 
@@ -32,7 +43,14 @@
 nodist_configheader_HEADERS = singularconfig.h
 DISTCLEANFILES = $(nodist_configheader_HEADERS)
 
-dist_man1_MANS = doc/Singular.man doc/ESingular.man doc/TSingular.man
-
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = Singular.pc
+
+%.1: %
+	$(HELP2MAN) \
+			-s 1 \
+			$(AM_H2MFLAGS) \
+			-I $(top_srcdir)/man/$*.h2m \
+			-n $(if $($(subst -,_,$*)_DESCRIPTION), $($(subst -,_,$*)_DESCRIPTION), "manual page for $*") \
+			-o $@ \
+		$(abs_top_builddir)/$<
--- a/libpolys/configure.ac
+++ b/libpolys/configure.ac
@@ -35,6 +35,9 @@
 
 SING_WIN_FLAGS
 
+# Checks for programs.
+AC_PATH_PROG([HELP2MAN],[help2man])
+
 # Checks for libraries.
 LB_CHECK_GMP(3.1.1,,AC_MSG_ERROR([Unable to find GMP on your machine: please use --with-gmp=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
 LB_CHECK_NTL(5.0,,AC_MSG_WARN([Unable to find NTL (which is strongly recommended) on your machine: please use --with-ntl=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
@@ -150,5 +153,6 @@
 AC_CONFIG_FILES([coeffs/Makefile])
 AC_CONFIG_FILES([polys/Makefile])
 AC_CONFIG_FILES([tests/Makefile])
-AC_CONFIG_FILES([libpolys-config libpolys.pc])
+AC_CONFIG_FILES([libpolys.pc])
+AC_CONFIG_FILES([libpolys-config], [chmod a+x libpolys-config])
 AC_OUTPUT
--- a/libpolys/Makefile.am
+++ b/libpolys/Makefile.am
@@ -2,6 +2,17 @@
 
 bin_SCRIPTS = libpolys-config
 
+man_MANS = libpolys-config.1
+
+AM_H2MFLAGS = \
+	--manual="CAS Singular" \
+	--source="Singular" \
+	--libtool \
+	--no-info
+
+## short descriptions for manpages
+libpolys_config_DESCRIPTION = "get information about installed Singular polynomial library"
+
 SUBDIRS=misc reporter coeffs polys tests
 
 configheaderdir = ${includedir}/singular
@@ -10,3 +21,12 @@
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libpolys.pc
+
+%.1: %
+	$(HELP2MAN) \
+			-s 1 \
+			$(AM_H2MFLAGS) \
+			-I $(top_srcdir)/man/$*.h2m \
+			-n $(if $($(subst -,_,$*)_DESCRIPTION), $($(subst -,_,$*)_DESCRIPTION), "manual page for $*") \
+			-o $@ \
+		$(abs_top_builddir)/$<