File: rules

package info (click to toggle)
findlib 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,868 kB
  • sloc: ml: 6,006; xml: 3,085; sh: 1,490; makefile: 378
file content (69 lines) | stat: -rwxr-xr-x 1,890 bytes parent folder | download | duplicates (2)
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
#!/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

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	./configure \
		-config /etc/ocamlfind.conf \
		-bindir /usr/bin \
		-sitelib $(OCAML_STDLIB_DIR) \
		-mandir /usr/share/man \
		-no-camlp4 \
		-with-toolbox

.PHONY: override_dh_auto_build
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

export OCAMLINIT_SED

.PHONY: override_dh_auto_install
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

# do not strip executables on bytecode executables (is this still needed?)
ifneq ($(OCAML_HAVE_OCAMLOPT),yes)
.PHONY: override_dh_strip
override_dh_strip:
endif

.PHONY: override_dh_auto_clean
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/

override_dh_missing:
	dh_missing --fail-missing

override_dh_dwz:

override_dh_install:
# temporary hack to make the package work with both OCaml 4.05.0 and 4.08.0
	if ! [ -f $(CURDIR)/debian/tmp$(OCAML_STDLIB_DIR)/num/META ]; then \
	  sed -i /num/d debian/*.install; \
	fi
	dh_install