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
|
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/dpatch.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/ocaml.mk
include /usr/share/cdbs/1/class/makefile.mk
PKGNAME = ocaml-findlib
DEB_MAKE_INSTALL_TARGET = install prefix=$(CURDIR)/debian/tmp
OCAML_IN_FILES += debian/patches/stddirs.dpatch
configure/$(PKGNAME)::
rm -f README # just a symlink, the good one is doc/README
./configure \
-config /etc/ocamlfind.conf \
-bindir /usr/bin \
-sitelib $(OCAML_STDLIB_DIR) \
-mandir /usr/share/man \
-with-toolbox
ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
build/$(PKGNAME)::
$(MAKE) opt
else
DEB_STRIP_EXCLUDE += usr/bin/ocamlfind
DEB_STRIP_EXCLUDE += $(OCAML_STDLIB_DIR)/findlib/make_wizard
endif
install/$(PKGNAME)::
# 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
mv debian/ocamlfind.conf.new debian/tmp/etc/ocamlfind.conf
# mv METAs from empty directories to the /META directory
mkdir -p $(CURDIR)/debian/tmp$(OCAML_STDLIB_DIR)/METAS
for p in `ls site-lib-src/`; do \
mv $(CURDIR)/debian/tmp$(OCAML_STDLIB_DIR)/$$p/META \
$(CURDIR)/debian/tmp$(OCAML_STDLIB_DIR)/METAS/META.$$p; \
rmdir $(CURDIR)/debian/tmp$(OCAML_STDLIB_DIR)/$$p/; \
done
# rm empty man3 dir
test -d $(CURDIR)/debian/tmp/usr/share/man/man3 && \
rmdir $(CURDIR)/debian/tmp/usr/share/man/man3
clean::
ln -sf doc/README README
-find . -name META -delete
-rm -f src/findlib/depend src/findlib/fl_metascanner.ml
-rm -f Makefile.config ocargs.log src/findlib/ocaml_args.ml
-rm -Rf site-lib-src/camlp4/
|