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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/ocaml/ocamlvars.mk
DESTDIR := $(CURDIR)/debian/tmp
export OCAMLOBJINFO := ocamlduceobjinfo
ifeq ($(OCAML_NATDYNLINK),yes)
OPT_CONFFLAGS := --enable-nativecode
else
OPT_CONFFLAGS := --disable-nativecode
endif
INSTALL_TARGET := $(if $(findstring libocsigen-ocaml-doc,$(shell dh_listpackages)),install,installnodoc)
%:
dh $@ --with ocaml
.PHONY: override_dh_auto_configure
override_dh_auto_configure:
chmod +x configure
./configure \
--temproot $(DESTDIR) \
--prefix /usr \
--bindir /usr/bin \
--libdir $(OCAML_STDLIB_DIR) \
--mandir /usr/share/man/man1 \
--docdir /usr/share/doc \
--staticpagesdir /usr/share \
--ocsigen-user ocsigen \
--ocsigen-group ocsigen \
--stubdir $(OCAML_DLL_DIR) \
$(OPT_CONFFLAGS) \
--enable-ocamlduce
cp -a examples debian
# Remove irrelevant files (incl. those installed in /usr/share or /var/lib)
mv debian/examples/miniwiki/files/miniwiki.conf debian/examples/miniwiki
rm -Rf \
debian/examples/miniwiki/wikidata \
debian/examples/miniwiki/files \
debian/examples/Makefile
.PHONY: override_dh_auto_install
override_dh_auto_install:
$(MAKE) $(INSTALL_TARGET) CHOWN=true STD_METAS_DIR=$(OCAML_STDLIB_DIR)/METAS
# For each installed .cmi file, install the corresponding .mli file next to it
find $(DESTDIR) -name '*.cmi' -printf '%h %f\n' | \
while read d f; do \
find . -name $${f%.cmi}.mli -exec cp '{}' $$d ';' -quit; \
done
find $(DESTDIR) -name '*.cmi' -exec touch '{}' ';'
$(MAKE) logrotate
rm -f $(DESTDIR)/var/run/ocsigen_command
rm -f $(DESTDIR)/usr/share/ocsigen/ocsigenstuff/LICENSE
.PHONY: override_dh_auto_build
override_dh_auto_build:
# This directory, present in .orig.tar.gz, is created here because
# git doesn't handle empty directories
mkdir -p doc
$(MAKE) depend
$(MAKE) all
.PHONY: override_dh_auto_clean
override_dh_auto_clean:
[ ! -f Makefile.config ] || $(MAKE) distclean
rm -Rf debian/examples xmlp4/newocaml/pp
mkdir xmlp4/newocaml/pp
.PHONY: override_dh_auto_clean
override_dh_compress:
dh_compress -X.ml
.PHONY: override_dh_install
override_dh_install:
dh_install --list-missing
.PHONY: override_dh_ocaml
override_dh_ocaml:
dh_ocaml \
--nodefined-map=libocsigen-ocaml-dev:Xmllexer \
--nodefined-map=libocsigen-xhtml-ocaml-dev:Xmllexer
|