summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am45
1 files changed, 42 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 22a8fbd14..a573ff2a1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -993,9 +993,9 @@ fetch:
$(AM_V_at)rm -rf Fetchdir
.PHONY: fetch
-## --------------------------------------------------------------------- ##
-## Generate manuals in several formats, for upload on the GNU website. ##
-## --------------------------------------------------------------------- ##
+## ---------------------------------------------------------------------- ##
+## Generate and upload manuals in several formats, for the GNU website. ##
+## ---------------------------------------------------------------------- ##
# The gendocs.sh script sadly leaves TeX and Texinfo auxiliary files
# in the directory where it's invoked.
@@ -1026,6 +1026,45 @@ web-manuals:
$(AM_V_at)if $(AM_V_P); then ls -l doc/web-manuals; else :; fi
.PHONY: web-manuals
+RSYNC = rsync
+CVS = cvs
+CVSU = cvsu
+CVS_USER = $${USER}
+WEBCVS_ROOT = cvs.savannah.gnu.org:/web
+
+upload-web-manuals:
+ $(AM_V_at)fatal () { echo "$@: $$*" >&2; exit 1; }; \
+ $(determine_release_type); \
+ case $$release_type in \
+ [Mm]ajor\ release|[Mm]inor\ release);; \
+ *) echo "Cannot upload manuals from a \"$$release_type\"" >&2; \
+ exit 1;; \
+ esac
+ $(AM_V_at)test -f $(srcdir)/doc/web-manuals/$(PACKAGE).html || { \
+ echo 'You have to run "$(MAKE) web-manuals" before' \
+ 'invoking "$(MAKE) $@"' >&2; \
+ exit 1; \
+ }
+ $(AM_V_GEN): \
+ && CVS_RSH=ssh && export CVS_RSH=ssh \
+ && tmp=$@.dir \
+ && rm -rf $$tmp \
+ && mkdir $$tmp \
+ && $(am__cd) $$tmp \
+ && $(CVS) -z3 -d :ext:$(CVS_USER)@$(WEBCVS_ROOT)/$(PACKAGE) \
+ co $(PACKAGE) \
+ && cd .. \
+ && $(RSYNC) -avP $(srcdir)/doc/web-manuals/ $$tmp/$(PACKAGE)/manual \
+ && ( \
+ cd $$tmp/$(PACKAGE)/manual \
+ && new_files=`$(CVSU) --types='?'` \
+ && new_files=`echo "$$new_files" | sed s/^..//` \
+ && { test -z "$$new_files" || $(CVS) add -ko $$new_files; } \
+ && $(CVS) ci -m $(VERSION) \
+ ) \
+ && rm -rf $$tmp
+.PHONY: upload-web-manuals
+
EXTRA_DIST += lib/gendocs.sh lib/gendocs_template
## ------------------------------------------------ ##