| 1 | #!/usr/bin/make -f |
| 2 | |
| 3 | OCAMLABI := $(shell ocamlc -version) |
| 4 | |
| 5 | clean: |
| 6 | dh_testdir |
| 7 | dh_testroot |
| 8 | rm -f build-stamp |
| 9 | rm -rf $(CURDIR)/build |
| 10 | dh_clean |
| 11 | |
| 12 | build: build-arch |
| 13 | build-indep: |
| 14 | build-arch: build-stamp |
| 15 | |
| 16 | VENDOR := /tmp/0install-build-vendor |
| 17 | OCAMLPATH := $(VENDOR)/lib |
| 18 | |
| 19 | build-stamp: |
| 20 | dh_testdir |
| 21 | mv vendor/lwt_glib-1.1.1 . && dune build --release @lwt_glib-1.1.1/install && dune install --release --prefix=$(VENDOR) lwt_glib && rm -rf lwt_glib-1.1.1 |
| 22 | if [ -x /usr/bin/ocamlopt ]; then \ |
| 23 | make OCAMLPATH=$(OCAMLPATH) TYPE=native; \ |
| 24 | else \ |
| 25 | make OCAMLPATH=$(OCAMLPATH) all TYPE=byte; \ |
| 26 | fi |
| 27 | rm -rf /tmp/0install-build-vendor |
| 28 | touch $@ |
| 29 | |
| 30 | install: build-stamp |
| 31 | dh_testdir |
| 32 | dh_testroot |
| 33 | dh_prep |
| 34 | dh_installdirs |
| 35 | $(CURDIR)/dist/install.sh $(CURDIR)/debian/0install-core/usr |
| 36 | mkdir -p $(CURDIR)/debian/0install/usr/lib/0install.net |
| 37 | mkdir -p $(CURDIR)/debian/0install/usr/share/applications |
| 38 | mv $(CURDIR)/debian/0install-core/usr/lib/0install.net/gui_gtk.* $(CURDIR)/debian/0install/usr/lib/0install.net/ |
| 39 | mv $(CURDIR)/debian/0install-core/usr/share/applications/0install.desktop $(CURDIR)/debian/0install/usr/share/applications/ |
| 40 | rmdir $(CURDIR)/debian/0install-core/usr/lib/0install.net |
| 41 | rmdir $(CURDIR)/debian/0install-core/usr/lib |
| 42 | mv $(CURDIR)/debian/0install-core/usr/share/zsh/site-functions $(CURDIR)/debian/0install-core/usr/share/zsh/vendor-completions |
| 43 | rm -r $(CURDIR)/debian/0install-core/usr/share/doc/0install |
| 44 | if [ -x /usr/bin/ocamlopt ]; then \ |
| 45 | dh_strip; dh_shlibdeps; \ |
| 46 | fi |
| 47 | |
| 48 | binary-arch: build-stamp install |
| 49 | dh_testdir |
| 50 | dh_testroot |
| 51 | dh_installchangelogs -p 0install-core |
| 52 | dh_installdocs -a --link-doc=0install-core |
| 53 | dh_installman -a |
| 54 | dh_compress -a |
| 55 | dh_fixperms -a |
| 56 | #dh_ocaml (not for -custom bytecode) |
| 57 | dh_installdeb -a |
| 58 | dh_gencontrol -a |
| 59 | dh_md5sums -a |
| 60 | dh_builddeb -a |
| 61 | |
| 62 | binary-indep: |
| 63 | dh_testdir |
| 64 | dh_testroot |
| 65 | dh_installdocs -i --link-doc=0install-core |
| 66 | dh_fixperms -i |
| 67 | dh_installdeb -i |
| 68 | dh_gencontrol -i |
| 69 | dh_md5sums -i |
| 70 | dh_builddeb -i |
| 71 | |
| 72 | binary: binary-indep binary-arch |
| 73 | |
| 74 | .PHONY: build clean binary-indep binary-arch binary install |