Blame common/upload-doc.mak

Packit 971217
# this snippet is to be included by both our docbook manuals
Packit 971217
# and gtk-doc API references
Packit 971217
Packit 971217
# it adds an upload target to each of these dir's Makefiles
Packit 971217
Packit 971217
# each Makefile.am should define the following variables:
Packit 971217
# - DOC: the base name of the documentation
Packit 971217
#        (faq, manual, pwg, gstreamer, gstreamer-libs)
Packit 971217
# - FORMATS: the formats in which DOC is output
Packit 971217
#            (html ps pdf)
Packit 971217
Packit 971217
# if you want to use it, make sure your $HOME/.ssh/config file contains the
Packit 971217
# correct User entry for the Host entry for the DOC_SERVER
Packit 971217
Packit 971217
# these variables define the location of the online docs
Packit 971217
DOC_SERVER = gstreamer.freedesktop.org
Packit 971217
DOC_BASE = /srv/gstreamer.freedesktop.org/www/data/doc
Packit 971217
DOC_URL = $(DOC_SERVER):$(DOC_BASE)
Packit 971217
Packit 971217
upload: $(FORMATS)
Packit 971217
	@if echo $(FORMATS) | grep html > /dev/null; then \
Packit 971217
	  echo "Preparing docs for upload (rebasing cross-references) ..." ; \
Packit 971217
	  if test x$(builddir) != x$(srcdir); then \
Packit 971217
	    echo "make upload can only be used if srcdir == builddir"; \
Packit 971217
	    exit 1; \
Packit 971217
	  fi; \
Packit 971217
	  # gtkdoc-rebase sometimes gets confused, so reset everything to \
Packit 971217
	  # local links before rebasing to online links                   \
Packit 971217
	  gtkdoc-rebase --html-dir=$(builddir)/html 2>/dev/null 2>/dev/null ; \
Packit 971217
	  rebase=`gtkdoc-rebase --verbose --online --html-dir=$(builddir)/html` ; \
Packit 971217
	  echo "$$rebase" | grep -e "On-*line"; \
Packit 971217
	  for req in glib gobject gstreamer gstreamer-libs gst-plugins-base-libs; do \
Packit 971217
	    if ! ( echo "$$rebase" | grep -i -e "On-*line.*/$$req/" ); then \
Packit 971217
	      echo "===============================================================================" ; \
Packit 971217
	      echo " Could not determine online location for $$req docs. Cross-referencing will be " ; \
Packit 971217
	      echo " broken, so not uploading. Make sure the library's gtk-doc documentation is    " ; \
Packit 971217
	      echo " installed somewhere in /usr/share/gtk-doc.                                    " ; \
Packit 971217
	      echo "===============================================================================" ; \
Packit 971217
	      exit 1; \
Packit 971217
	    fi; \
Packit 971217
	  done; \
Packit 971217
	  export SRC="$$SRC html"; \
Packit 971217
	fi; \
Packit 971217
	if echo $(FORMATS) | grep ps > /dev/null; then export SRC="$$SRC $(DOC).ps"; fi; \
Packit 971217
	if echo $(FORMATS) | grep pdf > /dev/null; then export SRC="$$SRC $(DOC).pdf"; fi; \
Packit 971217
	\
Packit 971217
	# upload releases to both X.Y/ and head/ subdirectories \
Packit 971217
	export DIR=$(DOC_BASE)/gstreamer/$(PACKAGE_VERSION_MAJOR).$(PACKAGE_VERSION_MINOR)/$(DOC); \
Packit 971217
	echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \
Packit 971217
	ssh $(DOC_SERVER) mkdir -p $$DIR; \
Packit 971217
	rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \
Packit 971217
	ssh $(DOC_SERVER) chmod -R g+w $$DIR; \
Packit 971217
	\
Packit 971217
	export DIR=$(DOC_BASE)/gstreamer/head/$(DOC); \
Packit 971217
	echo Uploading $$SRC to $(DOC_SERVER):$$DIR; \
Packit 971217
	ssh $(DOC_SERVER) mkdir -p $$DIR; \
Packit 971217
	rsync -rv -e ssh --delete $$SRC $(DOC_SERVER):$$DIR; \
Packit 971217
	ssh $(DOC_SERVER) chmod -R g+w $$DIR; \
Packit 971217
	\
Packit 971217
	if echo $(FORMATS) | grep html > /dev/null; then \
Packit 971217
	  echo "Un-preparing docs for upload (rebasing cross-references) ..." ; \
Packit 971217
	  gtkdoc-rebase --html-dir=$(builddir)/html ; \
Packit 971217
	fi; \
Packit 971217
	echo Done