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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/ocaml/ocamlvars.mk
%:
dh $@ --with ocaml,bash-completion
override_dh_auto_configure:
./configure \
-config /etc/ocamlfind.conf \
-bindir /usr/bin \
-sitelib $(OCAML_STDLIB_DIR) \
-mandir /usr/share/man \
-no-camlp4 \
-with-toolbox
sed -i '/INSTALLFILE/s/.*/INSTALLFILE = cp/' Makefile.config
override_dh_auto_build:
$(MAKE)
ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
$(MAKE) opt
endif
# Some platforms don't have raw_spacetime, do the same check as ./configure
ifeq (,$(wildcard $(OCAML_STDLIB_DIR)/raw_spacetime_lib.cmxa))
OCAMLINIT_SED += -e '\,raw_spacetime/META,d'
endif
# Adjustments for OCaml 5.x
ifeq (,$(filter 5.%,$(OCAML_ABI)))
OCAMLINIT_SED += -e 's/^META: //'
else
OCAMLINIT_SED += -e '/^META: /d'
dynlink_subdir = dynlink
export dynlink_subdir
endif
export OCAMLINIT_SED
override_dh_auto_install:
$(MAKE) install prefix=$(CURDIR)/debian/tmp
# rm ocamlc.opt and similar settings, they're not avail everywhere in debian
grep -v \\.opt debian/tmp/etc/ocamlfind.conf > debian/ocamlfind.conf.new
sed -i -e 's/@OCamlABI@/$(OCAML_ABI)/g' debian/ocamlfind.conf.new
mv debian/ocamlfind.conf.new debian/tmp/etc/ocamlfind.conf
# rm empty man3 dir
test -d $(CURDIR)/debian/tmp/usr/share/man/man3 && \
rmdir $(CURDIR)/debian/tmp/usr/share/man/man3
execute_after_dh_install:
# remove packages that are already provided by stdlib
for p in bytes; do \
if [ -d $(OCAML_STDLIB_DIR)/$$p ]; then \
rm -rf $(CURDIR)/debian/libfindlib-ocaml$(OCAML_STDLIB_DIR)/$$p; \
fi; \
done
# do not strip executables on bytecode executables (is this still needed?)
ifneq ($(OCAML_HAVE_OCAMLOPT),yes)
override_dh_strip:
endif
override_dh_auto_clean:
if [ -f Makefile.config ]; then $(MAKE) clean; fi
-rm -f Makefile.config ocargs.log src/findlib/ocaml_args.ml
-rm -Rf site-lib-src/camlp4/
|