1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/rules/dpatch.mk
include /usr/share/cdbs/1/class/ocaml.mk
PKGNAME = libpostgresql-ocaml-dev
# The examples patch needs to be patched since it contains hard coded ABI
# numbers.
OCAML_IN_FILES += debian/patches/03_examples.dpatch
# Since dpatch fails to deapply if a patch is not there we need to
# instantiate the patch before cleaning.
cleanbuilddir/$(PKGNAME):: ocamlinit
DEB_SRCDIR = $(CURDIR)/lib
DEB_MAKE_BUILD_TARGET = byte-code-library
CFLAGS += -I$(shell pg_config --includedir) -fPIC
DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/$(PKGNAME)$(OCAML_STDLIB_DIR)
ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
build/$(PKGNAME)::
$(MAKE) -C $(DEB_SRCDIR)/ native-code-library
endif
ifneq ($(OCAML_HAVE_OCAMLOPT),yes)
export LIBINSTALL_FILES = libpostgresql_stubs.a postgresql.cma postgresql.cmi postgresql.mli dllpostgresql_stubs.so
endif
binary-install/$(PKGNAME)::
mv $(CURDIR)/debian/$(PKGNAME)$(OCAML_STDLIB_DIR)/postgresql/*.so \
$(CURDIR)/debian/$(patsubst %-dev,%,$(PKGNAME))$(OCAML_STDLIB_DIR)/stublibs/
|