From: Aki Tuomi Date: Thu, 17 Nov 2022 19:53:01 +0000 (+0200) Subject: doc: Use html and man pages from doc.dovecot.org X-Git-Tag: 2.4.0~3402 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ac0836da4704c8bc4e54bcea232730158a38643;p=thirdparty%2Fdovecot%2Fcore.git doc: Use html and man pages from doc.dovecot.org --- diff --git a/configure.ac b/configure.ac index 19b620f486..d83e44d14c 100644 --- a/configure.ac +++ b/configure.ac @@ -221,8 +221,6 @@ DOVECOT_WANT_SYSTEMD dovecot_moduledir="$libdir/dovecot" DC_DOVECOT_MODULEDIR -DOVECOT_CHECK_PYTHON_VENV - AC_ARG_WITH(docs, AS_HELP_STRING([--with-docs], [Install documentation (default)]), if test x$withval = xno; then @@ -243,7 +241,8 @@ AC_PROG_CPP AC_PROG_CXX # lucene plugin needs this AC_CHECK_TOOL([FLEX],[flex],[:]) AC_CHECK_TOOL([BISON],[bison],[:]) -AC_PATH_TOOL([WGET], [wget], [missing]) +AM_MISSING_PROG([WGET], [wget]) + AS_IF([test "$BISON" = ":" && test ! -e "$srcdir/src/lib/event-filter-parser.h"], AC_MSG_ERROR([Bison is required when building from git]) ]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 2a57e552a0..85ec538ea0 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -11,92 +11,47 @@ docfiles = \ solr-schema-7.7.0.xml \ solr-config-7.7.0.xml +DOCS_URL=https://doc.dovecot.org/assets/3.0/docs.txz +MAN_URL=https://doc.dovecot.org/assets/3.0/man.txz + AM_V_Q = $(am__v_Q_$(V)) am__v_Q_ = $(am__v_Q_$(AM_DEFAULT_VERBOSITY)) am__v_Q_0 = -q am__v_Q_1 = +AM_V_DL_DOCS = $(am__v_DL_DOCS_$(V)) +am__v_DL_DOCS_ = $(am__v_DL_DOCS_$(AM_DEFAULT_VERBOSITY)) +am__v_DL_DOCS_0 = @echo " DL " $(DOCS_URL); +am__v_DL_DOCS_1 = + +AM_V_DL_MAN = $(am__v_DL_MAN_$(V)) +am__v_DL_MAN_ = $(am__v_DL_MAN_$(AM_DEFAULT_VERBOSITY)) +am__v_DL_MAN_0 = @echo " DL " $(MAN_URL); +am__v_DL_MAN_1 = + if INSTALL_DOCS SUBDIRS += man DOCDIRS += html +endif -if HAVE_VENV -BUILT_SOURCES = html mans -extra_dist_extra += html man -documentation_sources = $(top_srcdir)/doc/documentation-main - -.PHONY: mans prep-mans - -# extracting the documentation tarball from github yields the -# "documentation-main" directory -documentation-main: - $(AM_V_GEN)$(WGET) $(AM_V_Q) -O - \ - https://github.com/dovecot/documentation/archive/refs/heads/main.tar.gz | \ - gunzip | $(am__untar) - -$(documentation_sources)/requirements.txt: documentation-main - -venv: $(documentation_sources)/requirements.txt - $(AM_V_GEN)$(PYTHON) -m venv venv && \ - venv/bin/pip $(AM_V_Q) install wheel && \ - venv/bin/pip $(AM_V_Q) install -r "$(documentation_sources)/requirements.txt" - -prep-mans: venv - -$(AM_V_at)$(MAKE) -C $(documentation_sources)/source/man \ - V=$(V) pkgsysconfdir=$(sysconfdir) \ - rundir=$(rundir) \ - pkglibexecdir=$(pkglibexecdir) \ - AM_DEFAULT_VERBOSITY=$(AM_DEFAULT_VERBOSITY) - -man/dovecot.1: - $(MAKE) prep-mans +extra_dist_extra += html -mans: man/dovecot.1 - $(AM_V_GEN)test -f man/dovecot.1 || venv/bin/python -msphinx $(AM_V_Q) \ - -b man $(documentation_sources)/source man +html-dl: + $(AM_V_DL_DOCS)$(WGET) $(AM_V_Q) -O- $(DOCS_URL) | xz -d | $(am__untar) -html: man/dovecot.1 - $(AM_V_GEN)test -f html/index.html || venv/bin/python -msphinx $(AM_V_Q) \ - -b html $(documentation_sources)/source html +man-dl: + $(AM_V_DL_MAN)$(WGET) $(AM_V_Q) -O- $(MAN_URL) | xz -d | $(am__untar) -else # if HAVE_VENV +all-local: html -html: - if [ ! -e html/index.html ]; then \ - echo "Building html documentation needs python installed"; \ +html-local: + $(AM_V_at)if [ ! -e html/index.html ]; then \ + $(MAKE) html-dl; \ fi - -mans: - if [ ! -e man/dovecot.1 ]; then \ - echo "Building manpages needs python installed"; \ + $(AM_V_at)if [ ! -e man/dovecot.1 ]; then \ + $(MAKE) man-dl; \ fi -endif # if HAVE_VENV - -# explicit hook for make dist -# remove all the build artifacts before packaging -# NB: this is ran too late to build anything here. -dist-hook: - -rm -rf $(distdir)/html/.buildinfo - -rm -rf $(distdir)/html/.doctrees - -rm -rf $(distdir)/html/_sources - -rm -rf $(distdir)/html/objects.inv - -rm -rf $(distdir)/man/.doctrees - -clean-local: - -rm -rf venv - -rm -rf $(documentation_sources) - -rebuild: - -rm -rf html - $(MAKE) -C man $@ - -distclean-local: clean-local rebuild - -maintainer-clean: distclean-local - -endif # if INSTALL_DOCS - install-data-local: $(MKDIR_P) $(DESTDIR)$(docdir); \ for dir in $(DOCDIRS); do \ diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 7d656c28ce..bb2a7052ca 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -6,15 +6,12 @@ static_mans = \ doveadm-reload.1 \ doveadm-stop.1 -dist_man1_MANS = $(wildcard *.1) +dist_man1_MANS := $(wildcard *.1) +dist_man7_MANS := $(wildcard *.7) -dist_man7_MANS = $(wildcard *.7) - -rebuild: +distclean-local: for page in *.1 *.7; do \ if ! echo "$(static_mans)" | grep -qF "$$page"; then \ rm -f $$page; \ fi \ done - -distclean-local: rebuild diff --git a/m4/check_python_venv.m4 b/m4/check_python_venv.m4 deleted file mode 100644 index d9b5291e6a..0000000000 --- a/m4/check_python_venv.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl Define DOVECOT_CHECK_PYTHON_VENV function to be used in configure.ac -dnl Provide HAVE_VENV if we can access a virtual python environment, -dnl which might be necessary to build the documentation if so desired. - -AC_DEFUN([DOVECOT_CHECK_PYTHON_VENV], [ - AM_PATH_PYTHON([3.6],,[:]) - AS_IF([test "${PYTHON}" != ":"], [ - AX_PYTHON_MODULE([venv],[]) - ]) - AM_CONDITIONAL([HAVE_VENV], [test "x${HAVE_PYMOD_VENV}" = "xyes"]) -])