Browse Source

Enhanced doxygen support + manpage generation

Yann Weber 4 years ago
parent
commit
9586473f69
7 changed files with 865 additions and 6 deletions
  1. 8
    0
      Makefile.am
  2. 12
    0
      configure.ac
  3. 6
    6
      docs/Doxyfile.in
  4. 26
    0
      docs/Makefile.am
  5. 553
    0
      docs/Makefile.in
  6. 154
    0
      docs/man/man1/pyfcgi.1
  7. 106
    0
      src/main.c

+ 8
- 0
Makefile.am View File

@@ -1 +1,9 @@
1 1
 SUBDIRS = src tests
2
+
3
+if HAVE_DOXYGEN
4
+SUBDIRS += docs
5
+
6
+docs:
7
+	-cd docs; rm doxyfile.stamp; make doxyfile.stamp
8
+.PHONY: docs
9
+endif

+ 12
- 0
configure.ac View File

@@ -42,6 +42,13 @@ fi
42 42
 AC_PROG_CC
43 43
 AC_PROG_RANLIB
44 44
 
45
+AC_CHECK_PROGS([DOXYGEN], [doxygen])
46
+if test -z "$DOXYGEN";
47
+then
48
+	AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
49
+fi
50
+
51
+
45 52
 AC_ENABLE_SHARED
46 53
 AC_DISABLE_STATIC
47 54
 AC_PROG_LIBTOOL
@@ -75,4 +82,9 @@ AC_CONFIG_FILES([Makefile
75 82
                  src/Makefile
76 83
 		 tests/Makefile
77 84
 ])
85
+
86
+AM_CONDITIONAL([HAVE_DOXYGEN],
87
+[test -n "$DOXYGEN"])AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([docs/Doxyfile
88
+docs/Makefile])])
89
+
78 90
 AC_OUTPUT

Doxyfile → docs/Doxyfile.in View File

@@ -32,13 +32,13 @@ DOXYFILE_ENCODING      = UTF-8
32 32
 # title of most generated pages and in a few other places.
33 33
 # The default value is: My Project.
34 34
 
35
-PROJECT_NAME           = PyFCGI
35
+PROJECT_NAME           = @PACKAGE_NAME@
36 36
 
37 37
 # The PROJECT_NUMBER tag can be used to enter a project or revision number. This
38 38
 # could be handy for archiving the generated documentation or if some version
39 39
 # control system is used.
40 40
 
41
-PROJECT_NUMBER         = 
41
+PROJECT_NUMBER         = @PACKAGE_VERSION@
42 42
 
43 43
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
44 44
 # for a project that appears at the top of each page and should give viewer a
@@ -58,7 +58,7 @@ PROJECT_LOGO           =
58 58
 # entered, it will be relative to the location where doxygen was started. If
59 59
 # left blank the current directory will be used.
60 60
 
61
-OUTPUT_DIRECTORY       = doc
61
+OUTPUT_DIRECTORY       = @top_srcdir@/docs
62 62
 
63 63
 # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
64 64
 # directories (in 2 levels) under the output directory of each output format and
@@ -690,7 +690,7 @@ SHOW_NAMESPACES        = YES
690 690
 # by doxygen. Whatever the program writes to standard output is used as the file
691 691
 # version. For an example see the documentation.
692 692
 
693
-FILE_VERSION_FILTER    = 
693
+FILE_VERSION_FILTER    = @DOXYFILE_FILE_VERSION_FILTER@
694 694
 
695 695
 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
696 696
 # by doxygen. The layout file controls the global structure of the generated
@@ -724,7 +724,7 @@ CITE_BIB_FILES         =
724 724
 # messages are off.
725 725
 # The default value is: NO.
726 726
 
727
-QUIET                  = NO
727
+QUIET                  = YES
728 728
 
729 729
 # The WARNINGS tag can be used to turn on/off the warning messages that are
730 730
 # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
@@ -790,7 +790,7 @@ WARN_LOGFILE           =
790 790
 # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
791 791
 # Note: If this tag is empty the current directory is searched.
792 792
 
793
-INPUT                  = src include
793
+INPUT                  = @top_builddir@/src @top_builddir@/include
794 794
 
795 795
 # This tag can be used to specify the character encoding of the source files
796 796
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

+ 26
- 0
docs/Makefile.am View File

@@ -0,0 +1,26 @@
1
+dist_man_MANS=
2
+
3
+if HAVE_DOXYGEN
4
+dist_man_MANS+=$(top_srcdir)/docs/man/man1/pyfcgi.1
5
+CLEANFILES = doxyfile.stamp
6
+
7
+doxyfile.stamp:
8
+	$(DOXYGEN) Doxyfile; \
9
+	echo Timestamp > doxyfile.stamp; \
10
+	make manpage
11
+
12
+
13
+html-local: doxyfile.stamp
14
+
15
+$(top_srcdir)/docs/man/man1/pyfcgi.1: doxyfile.stamp
16
+
17
+manpage:
18
+	-mkdir -p $(top_srcdir)/docs/man/man1;\
19
+	cp $(top_srcdir)/docs/man/man3/pyfcgi.3 $(top_srcdir)/docs/man/man1/pyfcgi.1;\
20
+	sed -i 's/^.TH "pyfcgi" 3/.TH "pyfcgi" 1/' $(top_srcdir)/docs/man/man1/pyfcgi.1;
21
+
22
+clean-local:
23
+	-rm -rf $(top_srcdir)/docs/html $(top_srcdir)/docs/latex $(top_srcdir)/docs/man/man3 $(top_srcdir)/docs/man/man3 $(top_srcdir)/docs/doxygen_sqlite3.db
24
+
25
+endif
26
+

+ 553
- 0
docs/Makefile.in View File

@@ -0,0 +1,553 @@
1
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
2
+# @configure_input@
3
+
4
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
5
+
6
+# This Makefile.in is free software; the Free Software Foundation
7
+# gives unlimited permission to copy and/or distribute it,
8
+# with or without modifications, as long as this notice is preserved.
9
+
10
+# This program is distributed in the hope that it will be useful,
11
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
+# PARTICULAR PURPOSE.
14
+
15
+@SET_MAKE@
16
+VPATH = @srcdir@
17
+am__is_gnu_make = { \
18
+  if test -z '$(MAKELEVEL)'; then \
19
+    false; \
20
+  elif test -n '$(MAKE_HOST)'; then \
21
+    true; \
22
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
23
+    true; \
24
+  else \
25
+    false; \
26
+  fi; \
27
+}
28
+am__make_running_with_option = \
29
+  case $${target_option-} in \
30
+      ?) ;; \
31
+      *) echo "am__make_running_with_option: internal error: invalid" \
32
+              "target option '$${target_option-}' specified" >&2; \
33
+         exit 1;; \
34
+  esac; \
35
+  has_opt=no; \
36
+  sane_makeflags=$$MAKEFLAGS; \
37
+  if $(am__is_gnu_make); then \
38
+    sane_makeflags=$$MFLAGS; \
39
+  else \
40
+    case $$MAKEFLAGS in \
41
+      *\\[\ \	]*) \
42
+        bs=\\; \
43
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
44
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
45
+    esac; \
46
+  fi; \
47
+  skip_next=no; \
48
+  strip_trailopt () \
49
+  { \
50
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
51
+  }; \
52
+  for flg in $$sane_makeflags; do \
53
+    test $$skip_next = yes && { skip_next=no; continue; }; \
54
+    case $$flg in \
55
+      *=*|--*) continue;; \
56
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
57
+      -*I?*) strip_trailopt 'I';; \
58
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
59
+      -*O?*) strip_trailopt 'O';; \
60
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
61
+      -*l?*) strip_trailopt 'l';; \
62
+      -[dEDm]) skip_next=yes;; \
63
+      -[JT]) skip_next=yes;; \
64
+    esac; \
65
+    case $$flg in \
66
+      *$$target_option*) has_opt=yes; break;; \
67
+    esac; \
68
+  done; \
69
+  test $$has_opt = yes
70
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
71
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
72
+pkgdatadir = $(datadir)/@PACKAGE@
73
+pkgincludedir = $(includedir)/@PACKAGE@
74
+pkglibdir = $(libdir)/@PACKAGE@
75
+pkglibexecdir = $(libexecdir)/@PACKAGE@
76
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
77
+install_sh_DATA = $(install_sh) -c -m 644
78
+install_sh_PROGRAM = $(install_sh) -c
79
+install_sh_SCRIPT = $(install_sh) -c
80
+INSTALL_HEADER = $(INSTALL_DATA)
81
+transform = $(program_transform_name)
82
+NORMAL_INSTALL = :
83
+PRE_INSTALL = :
84
+POST_INSTALL = :
85
+NORMAL_UNINSTALL = :
86
+PRE_UNINSTALL = :
87
+POST_UNINSTALL = :
88
+build_triplet = @build@
89
+host_triplet = @host@
90
+@HAVE_DOXYGEN_TRUE@am__append_1 = $(top_srcdir)/docs/man/man1/pyfcgi.1
91
+subdir = docs
92
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
94
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95
+	$(ACLOCAL_M4)
96
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
97
+mkinstalldirs = $(install_sh) -d
98
+CONFIG_HEADER = $(top_builddir)/include/config.h
99
+CONFIG_CLEAN_FILES = Doxyfile
100
+CONFIG_CLEAN_VPATH_FILES =
101
+AM_V_P = $(am__v_P_@AM_V@)
102
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
103
+am__v_P_0 = false
104
+am__v_P_1 = :
105
+AM_V_GEN = $(am__v_GEN_@AM_V@)
106
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
107
+am__v_GEN_0 = @echo "  GEN     " $@;
108
+am__v_GEN_1 = 
109
+AM_V_at = $(am__v_at_@AM_V@)
110
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
111
+am__v_at_0 = @
112
+am__v_at_1 = 
113
+SOURCES =
114
+DIST_SOURCES =
115
+am__can_run_installinfo = \
116
+  case $$AM_UPDATE_INFO_DIR in \
117
+    n|no|NO) false;; \
118
+    *) (install-info --version) >/dev/null 2>&1;; \
119
+  esac
120
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
121
+am__vpath_adj = case $$p in \
122
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
123
+    *) f=$$p;; \
124
+  esac;
125
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
126
+am__install_max = 40
127
+am__nobase_strip_setup = \
128
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
129
+am__nobase_strip = \
130
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
131
+am__nobase_list = $(am__nobase_strip_setup); \
132
+  for p in $$list; do echo "$$p $$p"; done | \
133
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
134
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
135
+    if (++n[$$2] == $(am__install_max)) \
136
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
137
+    END { for (dir in files) print dir, files[dir] }'
138
+am__base_list = \
139
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
140
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
141
+am__uninstall_files_from_dir = { \
142
+  test -z "$$files" \
143
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
144
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
145
+         $(am__cd) "$$dir" && rm -f $$files; }; \
146
+  }
147
+man1dir = $(mandir)/man1
148
+am__installdirs = "$(DESTDIR)$(man1dir)"
149
+NROFF = nroff
150
+MANS = $(dist_man_MANS)
151
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
152
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Doxyfile.in \
153
+	$(srcdir)/Makefile.in
154
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
155
+ACLOCAL = @ACLOCAL@
156
+AMTAR = @AMTAR@
157
+AM_CFLAGS = @AM_CFLAGS@
158
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
159
+AR = @AR@
160
+AUTOCONF = @AUTOCONF@
161
+AUTOHEADER = @AUTOHEADER@
162
+AUTOMAKE = @AUTOMAKE@
163
+AWK = @AWK@
164
+CC = @CC@
165
+CCDEPMODE = @CCDEPMODE@
166
+CFLAGS = @CFLAGS@
167
+CHECK_CFLAGS = @CHECK_CFLAGS@
168
+CHECK_LIBS = @CHECK_LIBS@
169
+CPP = @CPP@
170
+CPPFLAGS = @CPPFLAGS@
171
+CYGPATH_W = @CYGPATH_W@
172
+DEFS = @DEFS@
173
+DEPDIR = @DEPDIR@
174
+DLLTOOL = @DLLTOOL@
175
+DOXYGEN = @DOXYGEN@
176
+DSYMUTIL = @DSYMUTIL@
177
+DUMPBIN = @DUMPBIN@
178
+ECHO_C = @ECHO_C@
179
+ECHO_N = @ECHO_N@
180
+ECHO_T = @ECHO_T@
181
+EGREP = @EGREP@
182
+EXEEXT = @EXEEXT@
183
+FGREP = @FGREP@
184
+GREP = @GREP@
185
+INSTALL = @INSTALL@
186
+INSTALL_DATA = @INSTALL_DATA@
187
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
188
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
189
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
190
+LD = @LD@
191
+LDFLAGS = @LDFLAGS@
192
+LIBOBJS = @LIBOBJS@
193
+LIBS = @LIBS@
194
+LIBTOOL = @LIBTOOL@
195
+LIPO = @LIPO@
196
+LN_S = @LN_S@
197
+LTLIBOBJS = @LTLIBOBJS@
198
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
199
+MAKEINFO = @MAKEINFO@
200
+MANIFEST_TOOL = @MANIFEST_TOOL@
201
+MKDIR_P = @MKDIR_P@
202
+NM = @NM@
203
+NMEDIT = @NMEDIT@
204
+OBJDUMP = @OBJDUMP@
205
+OBJEXT = @OBJEXT@
206
+OTOOL = @OTOOL@
207
+OTOOL64 = @OTOOL64@
208
+PACKAGE = @PACKAGE@
209
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
210
+PACKAGE_NAME = @PACKAGE_NAME@
211
+PACKAGE_STRING = @PACKAGE_STRING@
212
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
213
+PACKAGE_URL = @PACKAGE_URL@
214
+PACKAGE_VERSION = @PACKAGE_VERSION@
215
+PATH_SEPARATOR = @PATH_SEPARATOR@
216
+PKG_CONFIG = @PKG_CONFIG@
217
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
218
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
219
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
220
+PYTHON_CONFIG_PATH = @PYTHON_CONFIG_PATH@
221
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
222
+PYTHON_SO_CFLAGS = @PYTHON_SO_CFLAGS@
223
+PYTHON_SO_LDFLAGS = @PYTHON_SO_LDFLAGS@
224
+RANLIB = @RANLIB@
225
+SED = @SED@
226
+SET_MAKE = @SET_MAKE@
227
+SHELL = @SHELL@
228
+STRIP = @STRIP@
229
+VERSION = @VERSION@
230
+abs_builddir = @abs_builddir@
231
+abs_srcdir = @abs_srcdir@
232
+abs_top_builddir = @abs_top_builddir@
233
+abs_top_srcdir = @abs_top_srcdir@
234
+ac_ct_AR = @ac_ct_AR@
235
+ac_ct_CC = @ac_ct_CC@
236
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
237
+am__include = @am__include@
238
+am__leading_dot = @am__leading_dot@
239
+am__quote = @am__quote@
240
+am__tar = @am__tar@
241
+am__untar = @am__untar@
242
+bindir = @bindir@
243
+build = @build@
244
+build_alias = @build_alias@
245
+build_cpu = @build_cpu@
246
+build_os = @build_os@
247
+build_vendor = @build_vendor@
248
+builddir = @builddir@
249
+datadir = @datadir@
250
+datarootdir = @datarootdir@
251
+docdir = @docdir@
252
+dvidir = @dvidir@
253
+exec_prefix = @exec_prefix@
254
+host = @host@
255
+host_alias = @host_alias@
256
+host_cpu = @host_cpu@
257
+host_os = @host_os@
258
+host_vendor = @host_vendor@
259
+htmldir = @htmldir@
260
+includedir = @includedir@
261
+infodir = @infodir@
262
+install_sh = @install_sh@
263
+libdir = @libdir@
264
+libexecdir = @libexecdir@
265
+localedir = @localedir@
266
+localstatedir = @localstatedir@
267
+mandir = @mandir@
268
+mkdir_p = @mkdir_p@
269
+oldincludedir = @oldincludedir@
270
+pdfdir = @pdfdir@
271
+prefix = @prefix@
272
+program_transform_name = @program_transform_name@
273
+psdir = @psdir@
274
+runstatedir = @runstatedir@
275
+sbindir = @sbindir@
276
+sharedstatedir = @sharedstatedir@
277
+srcdir = @srcdir@
278
+sysconfdir = @sysconfdir@
279
+target_alias = @target_alias@
280
+top_build_prefix = @top_build_prefix@
281
+top_builddir = @top_builddir@
282
+top_srcdir = @top_srcdir@
283
+dist_man_MANS = $(am__append_1)
284
+@HAVE_DOXYGEN_TRUE@CLEANFILES = doxyfile.stamp
285
+all: all-am
286
+
287
+.SUFFIXES:
288
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
289
+	@for dep in $?; do \
290
+	  case '$(am__configure_deps)' in \
291
+	    *$$dep*) \
292
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
293
+	        && { if test -f $@; then exit 0; else break; fi; }; \
294
+	      exit 1;; \
295
+	  esac; \
296
+	done; \
297
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \
298
+	$(am__cd) $(top_srcdir) && \
299
+	  $(AUTOMAKE) --gnu docs/Makefile
300
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
301
+	@case '$?' in \
302
+	  *config.status*) \
303
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
304
+	  *) \
305
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
306
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
307
+	esac;
308
+
309
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
310
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
311
+
312
+$(top_srcdir)/configure:  $(am__configure_deps)
313
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
314
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
315
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
316
+$(am__aclocal_m4_deps):
317
+@HAVE_DOXYGEN_TRUE@Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
318
+@HAVE_DOXYGEN_TRUE@	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
319
+
320
+mostlyclean-libtool:
321
+	-rm -f *.lo
322
+
323
+clean-libtool:
324
+	-rm -rf .libs _libs
325
+install-man1: $(dist_man_MANS)
326
+	@$(NORMAL_INSTALL)
327
+	@list1=''; \
328
+	list2='$(dist_man_MANS)'; \
329
+	test -n "$(man1dir)" \
330
+	  && test -n "`echo $$list1$$list2`" \
331
+	  || exit 0; \
332
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
333
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
334
+	{ for i in $$list1; do echo "$$i"; done;  \
335
+	if test -n "$$list2"; then \
336
+	  for i in $$list2; do echo "$$i"; done \
337
+	    | sed -n '/\.1[a-z]*$$/p'; \
338
+	fi; \
339
+	} | while read p; do \
340
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
341
+	  echo "$$d$$p"; echo "$$p"; \
342
+	done | \
343
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
344
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
345
+	sed 'N;N;s,\n, ,g' | { \
346
+	list=; while read file base inst; do \
347
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
348
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
349
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
350
+	  fi; \
351
+	done; \
352
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
353
+	while read files; do \
354
+	  test -z "$$files" || { \
355
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
356
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
357
+	done; }
358
+
359
+uninstall-man1:
360
+	@$(NORMAL_UNINSTALL)
361
+	@list=''; test -n "$(man1dir)" || exit 0; \
362
+	files=`{ for i in $$list; do echo "$$i"; done; \
363
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
364
+	  sed -n '/\.1[a-z]*$$/p'; \
365
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
366
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
367
+	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
368
+tags TAGS:
369
+
370
+ctags CTAGS:
371
+
372
+cscope cscopelist:
373
+
374
+
375
+distdir: $(BUILT_SOURCES)
376
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
377
+
378
+distdir-am: $(DISTFILES)
379
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
380
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
381
+	list='$(DISTFILES)'; \
382
+	  dist_files=`for file in $$list; do echo $$file; done | \
383
+	  sed -e "s|^$$srcdirstrip/||;t" \
384
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
385
+	case $$dist_files in \
386
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
387
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
388
+			   sort -u` ;; \
389
+	esac; \
390
+	for file in $$dist_files; do \
391
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
392
+	  if test -d $$d/$$file; then \
393
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
394
+	    if test -d "$(distdir)/$$file"; then \
395
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
396
+	    fi; \
397
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
398
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
399
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
400
+	    fi; \
401
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
402
+	  else \
403
+	    test -f "$(distdir)/$$file" \
404
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
405
+	    || exit 1; \
406
+	  fi; \
407
+	done
408
+check-am: all-am
409
+check: check-am
410
+all-am: Makefile $(MANS)
411
+installdirs:
412
+	for dir in "$(DESTDIR)$(man1dir)"; do \
413
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
414
+	done
415
+install: install-am
416
+install-exec: install-exec-am
417
+install-data: install-data-am
418
+uninstall: uninstall-am
419
+
420
+install-am: all-am
421
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
422
+
423
+installcheck: installcheck-am
424
+install-strip:
425
+	if test -z '$(STRIP)'; then \
426
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
427
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
428
+	      install; \
429
+	else \
430
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
431
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
432
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
433
+	fi
434
+mostlyclean-generic:
435
+
436
+clean-generic:
437
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
438
+
439
+distclean-generic:
440
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
441
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
442
+
443
+maintainer-clean-generic:
444
+	@echo "This command is intended for maintainers to use"
445
+	@echo "it deletes files that may require special tools to rebuild."
446
+@HAVE_DOXYGEN_FALSE@html-local:
447
+@HAVE_DOXYGEN_FALSE@clean-local:
448
+clean: clean-am
449
+
450
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
451
+
452
+distclean: distclean-am
453
+	-rm -f Makefile
454
+distclean-am: clean-am distclean-generic
455
+
456
+dvi: dvi-am
457
+
458
+dvi-am:
459
+
460
+html: html-am
461
+
462
+html-am: html-local
463
+
464
+info: info-am
465
+
466
+info-am:
467
+
468
+install-data-am: install-man
469
+
470
+install-dvi: install-dvi-am
471
+
472
+install-dvi-am:
473
+
474
+install-exec-am:
475
+
476
+install-html: install-html-am
477
+
478
+install-html-am:
479
+
480
+install-info: install-info-am
481
+
482
+install-info-am:
483
+
484
+install-man: install-man1
485
+
486
+install-pdf: install-pdf-am
487
+
488
+install-pdf-am:
489
+
490
+install-ps: install-ps-am
491
+
492
+install-ps-am:
493
+
494
+installcheck-am:
495
+
496
+maintainer-clean: maintainer-clean-am
497
+	-rm -f Makefile
498
+maintainer-clean-am: distclean-am maintainer-clean-generic
499
+
500
+mostlyclean: mostlyclean-am
501
+
502
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
503
+
504
+pdf: pdf-am
505
+
506
+pdf-am:
507
+
508
+ps: ps-am
509
+
510
+ps-am:
511
+
512
+uninstall-am: uninstall-man
513
+
514
+uninstall-man: uninstall-man1
515
+
516
+.MAKE: install-am install-strip
517
+
518
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
519
+	clean-local cscopelist-am ctags-am distclean distclean-generic \
520
+	distclean-libtool distdir dvi dvi-am html html-am html-local \
521
+	info info-am install install-am install-data install-data-am \
522
+	install-dvi install-dvi-am install-exec install-exec-am \
523
+	install-html install-html-am install-info install-info-am \
524
+	install-man install-man1 install-pdf install-pdf-am install-ps \
525
+	install-ps-am install-strip installcheck installcheck-am \
526
+	installdirs maintainer-clean maintainer-clean-generic \
527
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
528
+	ps ps-am tags-am uninstall uninstall-am uninstall-man \
529
+	uninstall-man1
530
+
531
+.PRECIOUS: Makefile
532
+
533
+
534
+@HAVE_DOXYGEN_TRUE@doxyfile.stamp:
535
+@HAVE_DOXYGEN_TRUE@	$(DOXYGEN) Doxyfile; \
536
+@HAVE_DOXYGEN_TRUE@	echo Timestamp > doxyfile.stamp; \
537
+@HAVE_DOXYGEN_TRUE@	make manpage
538
+
539
+@HAVE_DOXYGEN_TRUE@html-local: doxyfile.stamp
540
+
541
+@HAVE_DOXYGEN_TRUE@$(top_srcdir)/docs/man/man1/pyfcgi.1: doxyfile.stamp
542
+
543
+@HAVE_DOXYGEN_TRUE@manpage:
544
+@HAVE_DOXYGEN_TRUE@	-mkdir -p $(top_srcdir)/docs/man/man1;\
545
+@HAVE_DOXYGEN_TRUE@	cp $(top_srcdir)/docs/man/man3/pyfcgi.3 $(top_srcdir)/docs/man/man1/pyfcgi.1;\
546
+@HAVE_DOXYGEN_TRUE@	sed -i 's/^.TH "pyfcgi" 3/.TH "pyfcgi" 1/' $(top_srcdir)/docs/man/man1/pyfcgi.1;
547
+
548
+@HAVE_DOXYGEN_TRUE@clean-local:
549
+@HAVE_DOXYGEN_TRUE@	-rm -rf $(top_srcdir)/docs/html $(top_srcdir)/docs/latex $(top_srcdir)/docs/man/man3 $(top_srcdir)/docs/man/man3 $(top_srcdir)/docs/doxygen_sqlite3.db
550
+
551
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
552
+# Otherwise a system limit (for SysV at least) may be exceeded.
553
+.NOEXPORT:

+ 154
- 0
docs/man/man1/pyfcgi.1 View File

@@ -0,0 +1,154 @@
1
+.TH "pyfcgi" 1 "Sat Aug 24 2019" "Version 0.0.1" "PyFCGI" \" -*- nroff -*-
2
+.ad l
3
+.nh
4
+.SH NAME
5
+pyfcgi \- Python Fast CGI runner
6
+.SH "SYNOPSIS"
7
+.PP
8
+spawn-fcgi [OPTS] -- pyfcgi [OPTIONS] 
9
+.SH "DESCRIPTION"
10
+.PP
11
+Run WSGI python application in a pool of worker\&.
12
+.SH "OPTIONS"
13
+.PP
14
+.SS "spawn-fcgi OPTIONS"
15
+OPTS are \fBspawn-fcgi(1)\fP options\&.
16
+.SS "General OPTIONS"
17
+\fB-h --help\fP
18
+.RS 4
19
+Display help and exit 
20
+.RE
21
+.PP
22
+\fB-V --version\fP
23
+.RS 4
24
+Display pyfcgi and Python version and exit 
25
+.RE
26
+.PP
27
+\fB-c --config=FILE\fP
28
+.RS 4
29
+load a configuration file 
30
+.RE
31
+.PP
32
+\fB-e --pymodule=MODULE_NAME\fP
33
+.RS 4
34
+python entrypoint module name 
35
+.RE
36
+.PP
37
+\fB-E --pyapp=FUNC_NAME\fP
38
+.RS 4
39
+python entrypoint function name 
40
+.RE
41
+.PP
42
+\fB-A --alt-io\fP
43
+.RS 4
44
+use stdout to communicate with web server instead of entrypoint return as specified in PEP333 
45
+.RE
46
+.PP
47
+\fB-P --pid-file=PATH\fP
48
+.RS 4
49
+Create a pidfile with master process PID
50
+.RE
51
+.PP
52
+.SS "Worker pool OPTIONS"
53
+\fB-w --min-worker\fP
54
+.RS 4
55
+minimum worker in the pool 
56
+.RE
57
+.PP
58
+\fB-W --max-worker\fP
59
+.RS 4
60
+maximum worker in the pool 
61
+.RE
62
+.PP
63
+\fB-f --fast-spawn\fP
64
+.RS 4
65
+If not given there is at least 1s between two child creation\&. When given childs may be spawned in small burst\&. 
66
+.RE
67
+.PP
68
+\fB-t --timeout=SECONDS\fP
69
+.RS 4
70
+Request timeout\&. If the timeout expires the worker process is restarted\&.
71
+.RE
72
+.PP
73
+.SS "Logging & monitoring OPTIONS"
74
+\fB-L --log=LOGGERSPEC\fP
75
+.RS 4
76
+Add a logfile using syntax 'LOGFILE[;FILT][;FMT]' See \fBLogfile format\fP 
77
+.RE
78
+.PP
79
+\fB-S --syslog\fP
80
+.RS 4
81
+Use syslog for logging 
82
+.RE
83
+.PP
84
+\fB-v --verbose\fP
85
+.RS 4
86
+Send all loglines on STDERR 
87
+.RE
88
+.PP
89
+\fB-s --socket-server=SOCKURL\fP
90
+.RS 4
91
+Indicate a socket like 'tcp://localhost:8765' to listen on, replying status and statistics\&. See \fBStatistics socket URL format\fP
92
+.RE
93
+.PP
94
+.SH "Logfile format"
95
+.PP
96
+A logger specification use the following format : LOGILE[;FILT][;FMT] with
97
+.IP "\(bu" 2
98
+LOGFILE the logfile name
99
+.IP "\(bu" 2
100
+FILT a number (in decimal or hex 0xHH) indicating wich facility/level to log
101
+.IP "\(bu" 2
102
+FMT the logline format, following the markup format described bellow 
103
+.PP
104
+.SS "Logline format"
105
+Logline's format is indicated using a simple format using fields between '{' and '}'\&. Supported fields are :
106
+.IP "\(bu" 2
107
+{datetime} {datetime:SIZE} {datetime:SIZE:FMT} defines a format and a constant length for a datetime field\&. Default : {datetime:25:F Tz}
108
+.IP "\(bu" 2
109
+{level} the loglevel
110
+.IP "\(bu" 2
111
+{facility} the log facility
112
+.IP "\(bu" 2
113
+{pid} the process PID
114
+.IP "\(bu" 2
115
+{ident} the process ident (friendly name)
116
+.IP "\(bu" 2
117
+{msg} the log message (can appear only once)
118
+.PP
119
+.PP
120
+Specials chars '{' & '}' can be escpaed using '{{' and '}}', and all field names can be abreviated to one character\&.
121
+.SH "Statistics socket URL format"
122
+.PP
123
+Statistics server listen on a socket specified by an URL like :
124
+.PP
125
+PROT://HOST:[PORT] with PROT one of :
126
+.IP "\(bu" 2
127
+tcp with HOST a valid INET address
128
+.IP "\(bu" 2
129
+udp with HOST a valid INET address
130
+.IP "\(bu" 2
131
+unix with HOST a valid PATH
132
+.PP
133
+.SH "EXAMPLES"
134
+.PP
135
+To run foo_pep333\&.entrypoint() PEP333 application :
136
+.PP
137
+spawn-fcgi -d \&. -n -p 9000 -a 127\&.0\&.0\&.1 -- src/pyfcgi -S \\ -e foo_pep333 -E entrypoint
138
+.PP
139
+Logfile example :
140
+.PP
141
+spawn-fcgi -d \&. -n -p 9000 -a 127\&.0\&.0\&.1 -- src/pyfcgi -S \\ -e foo_pep333 -E entrypoint \\ -L '/tmp/foo\&.log;0xff;{datetime} {msg} {ident}'
142
+.SH "AUTHOR"
143
+.PP
144
+Written by Yann Weber <yann.weber@member.fsf.org>
145
+.SH "COPYRIGHT"
146
+.PP
147
+Copyright @ 2019 Yann Weber License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licences/gpl.html>\&.
148
+.PP
149
+This is free software: you are free to change and redistribute it\&. There is NO WARRANTY, to extent permitted by law\&.
150
+.SH "See Also"
151
+.PP
152
+\fBspawn-fcgi(1)\fP
153
+.PP
154
+PyFCGI git repositorie <https://git.yannweb.net/yannweb/pyfcgi> 

+ 106
- 0
src/main.c View File

@@ -346,3 +346,109 @@ if ($programname contains 'pyfcgi') then {
346 346
  *
347 347
  */
348 348
 
349
+/**@page pyfcgi
350
+ * @brief Python Fast CGI runner
351
+ * @section man_syn SYNOPSIS
352
+ * spawn-fcgi [OPTS] -- pyfcgi [OPTIONS]
353
+ * @section man_desc DESCRIPTION
354
+ * Run WSGI python application in a pool of worker.
355
+ *
356
+ * @section man_opt OPTIONS
357
+ * @subsection man_opt_spawn spawn-fcgi OPTIONS
358
+ * OPTS are @ref spawn-fcgi(1) options.
359
+ *
360
+ * @subsection man_opt_gen General OPTIONS
361
+ * @par -h --help
362
+ * Display help and exit
363
+ * @par -V --version
364
+ * Display pyfcgi and Python version and exit
365
+ * @par -c --config=FILE
366
+ * load a configuration file
367
+ * @par -e --pymodule=MODULE_NAME
368
+ * python entrypoint module name
369
+ * @par -E --pyapp=FUNC_NAME
370
+ * python entrypoint function name
371
+ * @par -A --alt-io
372
+ * use stdout to communicate with web server instead of entrypoint return as
373
+ * specified in PEP333
374
+ * @par -P --pid-file=PATH
375
+ * Create a pidfile with master process PID
376
+ *
377
+ * @subsection man_opt_pool Worker pool OPTIONS
378
+ * @par -w --min-worker
379
+ * minimum worker in the pool
380
+ * @par -W --max-worker
381
+ * maximum worker in the pool
382
+ * @par -f --fast-spawn
383
+ * If not given there is at least 1s between two child creation. When given
384
+ * childs may be spawned in small burst.
385
+ * @par -t --timeout=SECONDS
386
+ * Request timeout. If the timeout expires the worker process is restarted.
387
+ *
388
+ * @subsection man_opt_log Logging & monitoring OPTIONS
389
+ * @par -L --log=LOGGERSPEC
390
+ * Add a logfile using syntax "LOGFILE[;FILT][;FMT]" See @ref man_logger_specs
391
+ * @par -S --syslog
392
+ * Use syslog for logging
393
+ * @par -v --verbose
394
+ * Send all loglines on STDERR
395
+ * @par -s --socket-server=SOCKURL
396
+ * Indicate a socket like "tcp://localhost:8765" to listen on, replying status
397
+ * and statistics. See @ref man_url_spec
398
+ *
399
+ * @section man_logger_specs Logfile format
400
+ * A logger specification use the following format : LOGILE[;FILT][;FMT] with
401
+ * - LOGFILE the logfile name
402
+ * - FILT a number (in decimal or hex 0xHH) indicating wich facility/level to
403
+ * log
404
+ * - FMT the logline format, following the markup format described bellow
405
+ * @subsection man_logger_fmt Logline format
406
+ * Logline's format is indicated using a simple format using fields between
407
+ * '{' and '}'. Supported fields are : 
408
+ * - {datetime} {datetime:SIZE} {datetime:SIZE:FMT} defines a format and a
409
+ * constant length for a datetime field. Default : {datetime:25:%F %T%z}
410
+ * - {level} the loglevel
411
+ * - {facility} the log facility
412
+ * - {pid} the process PID
413
+ * - {ident} the process ident (friendly name)
414
+ * - {msg} the log message (can appear only once)
415
+ *
416
+ * Specials chars '{' & '}' can be escpaed using "{{" and "}}", and all field
417
+ * names can be abreviated to one character.
418
+ * 
419
+ * @section man_url_spec Statistics socket URL format
420
+ * Statistics server listen on a socket specified by an URL like : 
421
+ *
422
+ * PROT://HOST:[PORT] with PROT one of :
423
+ * - tcp with HOST a valid INET address
424
+ * - udp with HOST a valid INET address
425
+ * - unix with HOST a valid PATH
426
+ *
427
+ * @section EXAMPLES 
428
+ * To run foo_pep333.entrypoint() PEP333 application :
429
+ * 
430
+ * spawn-fcgi -d . -n -p 9000 -a 127.0.0.1 -- src/pyfcgi -S \
431
+ * -e foo_pep333 -E entrypoint
432
+ *
433
+ * Logfile example :
434
+ *
435
+ * spawn-fcgi -d . -n -p 9000 -a 127.0.0.1 -- src/pyfcgi -S \
436
+ * -e foo_pep333 -E entrypoint \
437
+ * -L '/tmp/foo.log;0xff;{datetime} {msg} {ident}'
438
+ *
439
+ * @section AUTHOR
440
+ * Written by Yann Weber &lt;yann.weber@member.fsf.org>
441
+ *
442
+ * @section COPYRIGHT
443
+ * Copyright @ 2019 Yann Weber License GPLv3+: GNU GPL version 3 or later
444
+ * &lt;http://gnu.org/licences/gpl.html>.
445
+ *
446
+ * This is free software: you are free to change and redistribute it.
447
+ * There is NO WARRANTY, to extent permitted by law.
448
+ *
449
+ * @section man_see_also See Also
450
+ * @ref spawn-fcgi(1)
451
+ *
452
+ * PyFCGI git repositorie &lt;https://git.yannweb.net/yannweb/pyfcgi>
453
+ *
454
+ */

Loading…
Cancel
Save