# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
-# $Id: ocaml-vars.mk 3889 2007-07-04 10:48:53Z zack $
+# $Id: ocaml-vars.mk 4191 2007-08-25 18:29:47Z zack $
_cdbs_scripts_path ?= /usr/lib/cdbs
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
OCAML_TEAM += Sylvain Le Gall <gildor@debian.org>
# no trailing "," (comma) on the last name
+# space separated list of packages matching the naming convention for OCaml
+# libraries, i.e. libXXX-ocaml-dev.
+# For debian/rules writers
+OCAML_DEV_PACKAGES := $(filter lib%-ocaml-dev,$(DEB_PACKAGES))
+
+# space separated list of packages on which ocamldoc usage is required. For
+# each package listed here will have ocamldoc invoked on all *.ml/*.mli files
+# installed under $(OCAML_STDLIB_DIR) to generated html documentation which
+# will be shipped in /usr/share/doc/PACKAGE/html/*.
+# Typical usage is OCAML_OCAMLDOC_PACKAGES = $(OCAML_DEV_PACKAGES).
+# For debian/rules writers
+OCAML_OCAMLDOC_PACKAGES =
+#OCAML_OCAMLDOC_PACKAGES = $(OCAML_DEV_PACKAGES) # more "aggressive" default
+
+# flags to be passed to ocamldoc (in addition to -html and -d DESTDIR).
+# For debian/rules writers
+OCAML_OCAMLDOC_FLAGS = -stars
+
endif
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
-# $Id: ocaml.mk 3889 2007-07-04 10:48:53Z zack $
+# $Id: ocaml.mk 4191 2007-08-25 18:29:47Z zack $
_cdbs_scripts_path ?= /usr/lib/cdbs
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
# import OCAML_* make variables
include $(_cdbs_class_path)/ocaml-vars.mk$(_cdbs_makefile_suffix)
-# ensure dpkg-gencontrol will fill F:OCamlABI fields with the proper value
ifdef _cdbs_rules_debhelper
+
+# ensure dpkg-gencontrol will fill F:OCamlABI fields with the proper value
DEB_DH_GENCONTROL_ARGS += -- -VF:OCamlABI="$(OCAML_ABI)"
DEB_DH_GENCONTROL_ARGS += -VF:OCamlNativeArchs="$(OCAML_NATIVE_ARCHS)"
+
endif
+# post-install hooks for invoking ocamldoc on OCAML_OCAMLDOC_PACKAGES packages
+$(patsubst %,install/%,$(DEB_PACKAGES))::
+ @if (echo $(OCAML_OCAMLDOC_PACKAGES) | grep -w '$(cdbs_curpkg)' > /dev/null) ; then \
+ echo 'mkdir -p debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/html' ; \
+ mkdir -p debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/html ; \
+ echo 'invoking ocamldoc on debian/$(cdbs_curpkg)$(OCAML_STDLIB_DIR)/ ...' ; \
+ find debian/$(cdbs_curpkg)$(OCAML_STDLIB_DIR)/ \
+ -type f -name '*.mli' -or -name '*.ml' \
+ | xargs ocamldoc $(OCAML_OCAMLDOC_FLAGS) -html \
+ -d debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/html ; \
+ fi
+
# generate .in files counterpars before building, substituting @OCamlABI@
# markers with the proper value; clean stamps after building
pre-build:: ocamlinit
[ Stefano Zacchiroli ]
* debian/ocaml-nox.dirs.in
- avoid creating empty /usr/include/ocaml/* directory (closes: #439017)
+ * CDBS class
+ - add support for automatic ocamldoc HTML documentation generation
- -- Stefano Zacchiroli <zack@debian.org> Tue, 21 Aug 2007 18:55:16 +0200
+ -- Stefano Zacchiroli <zack@debian.org> Sat, 25 Aug 2007 20:28:29 +0200
ocaml (3.10.0-5) experimental; urgency=low