File: rules

package info (click to toggle)
elpi 2.0.7-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 50,296 kB
  • sloc: ml: 18,791; makefile: 229; python: 95; sh: 7
file content (48 lines) | stat: -rwxr-xr-x 1,448 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/pkg-info.mk
include /usr/share/ocaml/ocamlvars.mk

%:
	dh $@ --with ocaml --buildsystem ocaml_dune

execute_before_dh_auto_build:
	cp src/trace_atd.ts src/trace_atd.ts.orig
	if test -e .git; then \
	  echo "Found .git, ok"; \
        else \
          touch .false_git; \
          git init --initial-branch=main; \
	  git config user.email "foo@bar.baz"; \
	  git config user.name "Foo Bar"; \
          git add dune; \
          git commit -m foo; \
          git tag -a v$(DEB_VERSION_UPSTREAM) -m foo; \
        fi

override_dh_auto_test:
	make tests STACK=11141120

execute_after_dh_auto_install:
	# drop excess LICENSE files
	rm -f debian/tmp/usr/doc/elpi/LICENSE
	# don't declare the documentation files as part of the package
	find debian/tmp -name dune-package | xargs sed -i -e "s|(doc[^()]*([^()]*))||g"
	find debian/tmp -name dune-package | xargs sed -i -e "s|(doc[^()]*)||g"
	# we detect what to ship
	find debian/tmp -regextype posix-awk \
	  -regex '.*\.(cma|cmxs)$$' \
	  >> debian/libelpi-ocaml.install
	find debian/tmp -regextype posix-awk \
	  -regex '.*\.(a|cmi|cmo|cmt|cmti|cmx|cmxa|ml|mli|o])$$' \
	  >> debian/libelpi-ocaml-dev.install

execute_after_dh_auto_clean:
	rm -rf _log/ tests/test.exe data.csv*
	if test -f src/trace_atd.ts.orig; then \
	  mv src/trace_atd.ts.orig src/trace_atd.ts; \
	fi
	if test -f .false_git; then \
	  rm -rf .false_git .git; \
	fi