automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/8] release: automate uploading of web manuals in CVS


From: Stefano Lattarini
Subject: [PATCH 1/8] release: automate uploading of web manuals in CVS
Date: Thu, 13 Dec 2012 16:17:43 +0100

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 <address@hidden>
---
 Makefile.am | 45 ++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 42 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 22a8fbd..a573ff2 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 \
+         && address@hidden \
+         && 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
 
 ## ------------------------------------------------ ##
-- 
1.8.0.1.347.gf94c325




reply via email to

[Prev in Thread] Current Thread [Next in Thread]