Skip to content

Commit

Permalink
Install xenstore_watch as an ocamlfindable package
Browse files Browse the repository at this point in the history
This enables it to be used by the rrdd plugins, for which the code lives in a different repository.
  • Loading branch information
jjd27 committed Apr 3, 2013
1 parent dc787f7 commit 8463b12
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ ocaml/xstest/xscheckperms
js
ocaml/idl/META
ocaml/idl/ocaml_backend/META
ocaml/xenops/META
ocaml/xapi/rrddump
ocaml/xapi/sparse_dd
ocaml/license/v6d
Expand Down
5 changes: 5 additions & 0 deletions ocaml/xenops/META.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version = "@VERSION@"
description = "xenstore watching library"
requires = "stdext,xenstore,log"
archive(byte) = "xenstore_watch.cma"
archive(native) = "xenstore_watch.cmxa"
26 changes: 25 additions & 1 deletion ocaml/xenops/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ OCamlDocLibrary(xenops, $(LIBFILES))

OCamlLibrary(xenops_client, xenops_interface device_number memory xenops_client ionice)
OCamlLibrary(memory_client, memory_interface memory_client)
OCamlLibrary(xenstore_watch, xenstore_watch xenops_helpers)

XENSTORE_WATCH_OBJS=xenstore_watch xenops_helpers
XENSTORE_WATCH_LIBNAME=xenstore_watch
OCamlLibrary($(XENSTORE_WATCH_LIBNAME), $(XENSTORE_WATCH_OBJS))

OCAML_LIBS += ../util/version ../idl/ocaml_backend/common xenops

Expand Down Expand Up @@ -95,3 +98,24 @@ sdk-install: install
.PHONY: clean
clean:
rm -f *.cmi *.cmx *.cmo *.a *.cma *.cmxa *.o *.annot *.run *.opt $(DEBUG_PROGS) $(BIN_PROGS) $(SYMLINK_PROGS) $(OTHER_PROGS)

if $(defined-env DESTDIR)
INSTALL_PATH = $(DESTDIR)/$(shell ocamlfind printconf destdir)
export
else
INSTALL_PATH = $(shell ocamlfind printconf destdir)
export

XENSTORE_WATCH_PACKNAME=xenstore-watch

META: META.in
sed 's/@VERSION@/$(PRODUCT_VERSION)/g' < $< > $@

.PHONY: lib-install
lib-install: META
mkdir -p $(INSTALL_PATH)
ocamlfind install -destdir $(INSTALL_PATH) -ldconf ignore $(XENSTORE_WATCH_PACKNAME) META $(addsuffixes .cmi,$(XENSTORE_WATCH_OBJS)) $(if $(BYTE_ENABLED), $(XENSTORE_WATCH_LIBNAME).cma) $(if $(NATIVE_ENABLED), $(XENSTORE_WATCH_LIBNAME).cmxa $(XENSTORE_WATCH_LIBNAME).a $(addsuffixes .cmx, $(XENSTORE_WATCH_OBJS)))

.PHONY: lib-uninstall
lib-uninstall:
ocamlfind remove -destdir $(INSTALL_PATH) $(XENSTORE_WATCH_PACKNAME)
11 changes: 11 additions & 0 deletions xapi.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ Group: Development/Libraries
This package contains rrd functions as a library suitable for writing tools
related to rrd. Needed for rrd2csv and rrdd-plugins.

%package xenstore-watch-devel
Summary: xenstore-watch headers and libraries
Group: Development/Libraries

%description xenstore-watch-devel
This package contains a library of functions for watching xenstore.

%prep
%setup -q
%patch0 -p0 -b xapi-version.patch
Expand Down Expand Up @@ -387,6 +394,10 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
/usr/lib/ocaml/rrd-client/*

%files xenstore-watch-devel
%defattr(-,root,root,-)
/usr/lib/ocaml/xenstore-watch/*

%changelog


Expand Down

0 comments on commit 8463b12

Please sign in to comment.