[Pkg-xen-devel] [PATCH 9/9] Create 2 ocaml packages, libxen-ocaml-4.1 and libxen-ocaml-dev.
Jon Ludlam
jonathan.ludlam at eu.citrix.com
Tue Oct 25 12:37:29 UTC 2011
---
xen/debian/libxen-dev.install | 2 +
xen/debian/libxen-ocaml-dev.install | 2 +
xen/debian/libxen-ocaml.install | 3 ++
xen/debian/rules | 2 +-
xen/debian/rules.real | 36 ++++++++++++++++++++++++++++++++
xen/debian/templates/control.main.in | 18 ++++++++++++++++
xen/debian/templates/control.source.in | 5 +++-
7 files changed, 66 insertions(+), 2 deletions(-)
create mode 100644 xen/debian/libxen-ocaml-dev.install
create mode 100644 xen/debian/libxen-ocaml.install
diff --git a/xen/debian/libxen-dev.install b/xen/debian/libxen-dev.install
index 9d00a07..5e05540 100644
--- a/xen/debian/libxen-dev.install
+++ b/xen/debian/libxen-dev.install
@@ -2,4 +2,6 @@ usr/lib/{libxenctrl.a,libxenguest.a}
usr/lib/libxenstore.{a,so}
usr/include/{xenctrl.h,xenguest.h}
usr/include/{xs.h,xs_lib.h}
+usr/include/xentoollog.h
+usr/include/xenctrlosdep.h
usr/include/xen
diff --git a/xen/debian/libxen-ocaml-dev.install b/xen/debian/libxen-ocaml-dev.install
new file mode 100644
index 0000000..a9f22f6
--- /dev/null
+++ b/xen/debian/libxen-ocaml-dev.install
@@ -0,0 +1,2 @@
+/usr/lib/xen-4.1/lib/ocaml/{xenlight,xenbus,xenctrl,xenstore,xeneventchn,xenmmap}/*.cm{i,x,xa}
+/usr/lib/xen-4.1/lib/ocaml/{xenlight,xenbus,xenctrl,xenstore,xeneventchn,xenmmap}/*.a
diff --git a/xen/debian/libxen-ocaml.install b/xen/debian/libxen-ocaml.install
new file mode 100644
index 0000000..d7ec220
--- /dev/null
+++ b/xen/debian/libxen-ocaml.install
@@ -0,0 +1,3 @@
+/usr/lib/xen-*/lib/ocaml/stublibs/dll*_stubs.so*
+/usr/lib/xen-*/lib/ocaml/{xenlight,xenbus,xenctrl,xenstore,xeneventchn,xenmmap}/META
+/usr/lib/xen-*/lib/ocaml/{xenlight,xenbus,xenctrl,xenstore,xeneventchn,xenmmap}/*.cma
diff --git a/xen/debian/rules b/xen/debian/rules
index aade4fb..19d1f50 100755
--- a/xen/debian/rules
+++ b/xen/debian/rules
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DH_VERBOSE=1
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
diff --git a/xen/debian/rules.real b/xen/debian/rules.real
index 1252ec2..0711dad 100644
--- a/xen/debian/rules.real
+++ b/xen/debian/rules.real
@@ -1,7 +1,11 @@
+include /usr/share/ocaml/ocamlvars.mk
+
DEB_HOST_ARCH := $(shell dpkg-architecture -a$(ARCH) -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -a$(ARCH) -qDEB_HOST_GNU_TYPE)
DEB_BUILD_ARCH := $(shell dpkg-architecture -a$(ARCH) -qDEB_BUILD_ARCH)
+GENCONTROL_ARGS := -VF:OCamlABI="$(OCAML_ABI)"
+
export DH_OPTIONS
setup_env := env -u ARCH -u FLAVOUR -u VERSION -u MAKEFLAGS
@@ -17,6 +21,8 @@ binary-arch-arch: install-lib-dev_$(ARCH)
binary-arch-arch: install-libxenstore_$(ARCH)
binary-arch-arch: install-utils_$(ARCH)
binary-arch-arch: install-xenstore-utils_$(ARCH)
+binary-arch-arch: install-lib-ocaml-dev_$(ARCH)
+binary-arch-arch: install-lib-ocaml_$(ARCH)
binary-arch-flavour: install-hypervisor_$(ARCH)_$(FLAVOUR)
binary-indep: install-docs
@@ -70,6 +76,7 @@ $(STAMPS_DIR)/install-utils_$(ARCH): CONFIG = \
XEN_COMPILE_ARCH=$(XEN_ARCH) \
XEN_TARGET_ARCH=$(XEN_ARCH) \
XEN_VERSION=$(VERSION) \
+ OCAMLDESTDIR=$(CURDIR)/$(BUILD_DIR)/install-utils_$(ARCH)/usr/lib/xen-$(VERSION)/lib/ocaml \
PYTHON=$(shell pyversions -r)
$(STAMPS_DIR)/build-utils_$(ARCH): DIR=$(BUILD_DIR)/build-utils_$(ARCH)
@@ -81,6 +88,7 @@ $(STAMPS_DIR)/install-utils_$(ARCH): DIR = $(BUILD_DIR)/build-utils_$(ARCH)
$(STAMPS_DIR)/install-utils_$(ARCH): INSTALL_DIR = $(BUILD_DIR)/install-utils_$(ARCH)
$(STAMPS_DIR)/install-utils_$(ARCH): $(STAMPS_DIR)/build-utils_$(ARCH)
@rm -rf $(INSTALL_DIR)
+ mkdir -p $(INSTALL_DIR)/usr/lib/xen-$(VERSION)/lib/ocaml/stublibs
+$(MAKE_CLEAN) -C $(DIR)/tools install DESTDIR=$(CURDIR)/$(INSTALL_DIR) $(CONFIG)
# hvmloader
#strip --remove-section=.comment --remove-section=.note $(INSTALL_DIR)/usr/lib/xen*/boot/*
@@ -92,6 +100,7 @@ install-base:
dh_compress
dh_fixperms
dh_installdeb
+ dh_ocaml
dh_gencontrol -- $(GENCONTROL_ARGS)
dh_md5sums
dh_builddeb
@@ -131,6 +140,32 @@ install-lib-dev_$(ARCH): $(STAMPS_DIR)/install-utils_$(ARCH)
dh_shlibdeps
+$(MAKE_SELF) install-base
+install-lib-ocaml_$(ARCH): DIR = $(BUILD_DIR)/install-utils_$(ARCH)
+install-lib-ocaml_$(ARCH): PACKAGE_NAME = libxen-ocaml-4.1
+install-lib-ocaml_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
+install-lib-ocaml_$(ARCH): $(STAMPS_DIR)/install-utils_$(ARCH)
+ dh_testdir
+ dh_testroot
+ dh_prep
+ ln -sf libxen-ocaml.install debian/libxen-ocaml-$(VERSION).install
+ dh_install --sourcedir=$(DIR)
+ rm debian/libxen-ocaml-$(VERSION).install
+ dh_strip
+ dh_shlibdeps
+ +$(MAKE_SELF) install-base
+
+install-lib-ocaml-dev_$(ARCH): DIR = $(BUILD_DIR)/install-utils_$(ARCH)
+install-lib-ocaml-dev_$(ARCH): PACKAGE_NAME = libxen-ocaml-dev
+install-lib-ocaml-dev_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
+install-lib-ocaml-dev_$(ARCH): $(STAMPS_DIR)/install-utils_$(ARCH)
+ dh_testdir
+ dh_testroot
+ dh_prep
+ dh_install --sourcedir=$(DIR)
+ dh_strip
+ dh_shlibdeps
+ +$(MAKE_SELF) install-base
+
install-libxenstore_$(ARCH): DIR = $(BUILD_DIR)/install-utils_$(ARCH)
install-libxenstore_$(ARCH): PACKAGE_NAME = libxenstore3.0
install-libxenstore_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
@@ -157,6 +192,7 @@ install-utils_$(ARCH): $(STAMPS_DIR)/install-utils_$(ARCH) install-libxenstore_$
install -D -m644 debian/xen-utils.README.Debian $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/README.Debian
install -D -m644 debian/xen-utils-$(VERSION).lintian-overrides $(PACKAGE_DIR)/usr/share/lintian/overrides/$(PACKAGE_NAME)
dh_install --sourcedir=$(DIR) usr/lib/xen-$(VERSION)
+ rm -rf $(PACKAGE_DIR)/usr/lib/xen-4.1/lib/ocaml
dh_python2 -V$(shell pyversions -rv) /usr/lib/xen-$(VERSION)
dh_strip
dh_makeshlibs -V
diff --git a/xen/debian/templates/control.main.in b/xen/debian/templates/control.main.in
index 2dff1dd..423009d 100644
--- a/xen/debian/templates/control.main.in
+++ b/xen/debian/templates/control.main.in
@@ -30,3 +30,21 @@ Replaces: xen-utils-common (<= 3.1.0-1)
Description: Xenstore utilities for Xen
This package contains the Xenstore utilities.
+Package: libxen-ocaml- at version@
+Architecture: any
+Section: libs
+Depends: ocaml-base-nox-${F:OCamlABI}, ${shlibs:Depends}, ${misc:Depends}, ${ocaml:Depends}
+Provides: ${ocaml:Provides}
+Description: OCaml libraries for controlling Xen
+ This package contains the runtime libraries required for the ocaml bindings
+ to the Xen control libraries.
+
+Package: libxen-ocaml-dev
+Architecture: any
+Section: libdevel
+Depends: ocaml-nox-${F:OCamlABI}, libxen-ocaml- at version@ (= ${binary:Version}), ${shlibs:Depends}, ocaml-findlib (>= 1.1), ${misc:Depends}, ${ocaml:Depends}
+Provides: ${ocaml:Provides}
+Description: OCaml libraries for controlling Xen (devel package)
+ This package contains the ocaml findlib packages for compiling applications
+ that are designed to control the Xen hypervisor.
+
diff --git a/xen/debian/templates/control.source.in b/xen/debian/templates/control.source.in
index a7db0ff..481d41a 100644
--- a/xen/debian/templates/control.source.in
+++ b/xen/debian/templates/control.source.in
@@ -15,7 +15,10 @@ Build-Depends:
libncurses5-dev,
libpci-dev,
uuid-dev,
- zlib1g-dev
+ zlib1g-dev,
+ ocaml-nox (>= 3.11.1-3~),
+ dh-ocaml (>= 0.9~),
+ ocaml-findlib
Build-Depends-Indep:
graphviz,
ghostscript,
--
1.7.7
More information about the Pkg-xen-devel
mailing list