summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-12-13 11:02:59 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-12-13 20:18:09 +0100
commitad35a6ba74f2c8b0f15b36277bce43adf2a20b84 (patch)
tree0105015c42e958bfebe2bb1540486c9e913b42e3 /Makefile.am
parent86e03eccf9352c6990cd7151f8145cb603b45e14 (diff)
downloadautomake-ad35a6ba74f2c8b0f15b36277bce43adf2a20b84.tar.gz
release: automate uploading of web manuals in CVS
This is partly inspired to the 'gnu-web-doc-update' script from gnulib. Unfortunately, we can't use that script directly, because as of now it assumes a build system integrated with gnulib. * Makefile.am (upload-web-manuals): New .PHONY rule. (RSYNC, CVS, CVSU, CVS_USER, WEBCVS_ROOT): New variables, used by the new rule. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
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
## ------------------------------------------------ ##