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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/dpatch/dpatch.make
BUILD_LABLGTK2=yes
BUILD_LABLGTK =yes
OCAML_LIB_DIR := $(shell ocamlc -where)
ifeq ($(BUILD_LABLGTK2),yes)
LABLGTK2_DIR := $(shell ocamlfind query lablgtk2)
LABGTK2_CONF = --with-labgtk2=$(LABGTK2_DIR)
endif
ifeq ($(BUILD_LABLGTK),yes)
LABLGTK_DIR := $(shell ocamlfind query lablgtk)
LABGTK_CONF = --with-labgtk=$(LABGTK_DIR)
endif
DESTDIR = $(CURDIR)/debian/libcamlimages-ocaml
DESTDIR_DEV = $(CURDIR)/debian/libcamlimages-ocaml-dev
DESTDIR_DOC = $(CURDIR)/debian/libcamlimages-ocaml-doc
configure: configure-stamp
configure-stamp: patch-stamp
dh_testdir
./configure $(LABLGTK_CONF) $(LABLGTK2_CONF)
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp patch-stamp
dh_testdir
# Add here commands to compile the package.
$(MAKE) byt
if [ -x /usr/bin/ocamlopt ]; then $(MAKE) opt; else true; fi
touch build-stamp
clean: unpatch
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Clean documentation links
-test -L html && rm html
-test -L doc/index.html && rm doc/index.html
# Add here commands to clean up after the build process.
-$(MAKE) veryclean
-rm Makefile.config
-rm freetype
-mkdir freetype
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) install.byt DESTDIR=$(DESTDIR_DEV)
if [ -x /usr/bin/ocamlopt ]; then $(MAKE) install.opt DESTDIR=$(DESTDIR_DEV); else true; fi
mv -f $(DESTDIR_DEV)$(OCAML_LIB_DIR)/camlimages/*.so \
$(DESTDIR)$(OCAML_LIB_DIR)/stublibs/
cp debian/META \
$(DESTDIR_DEV)$(OCAML_LIB_DIR)/METAS/META.camlimages
chrpath -d $(DESTDIR)$(OCAML_LIB_DIR)/stublibs/*.so
# binary-indep: build install
# dh_installdocs -p libcamlimages-ocaml-doc
# dh_installexamples -p libcamlimages-ocaml-doc
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_link -i
# Set up documentation links
# Install documentation
cp -rf doc/* \
$(DESTDIR_DOC)/usr/share/doc/libcamlimages-ocaml-doc/html
$(RM) $(DESTDIR_DOC)/usr/share/doc/libcamlimages-ocaml-doc/html/LICENSE
$(RM) $(DESTDIR_DOC)/usr/share/doc/libcamlimages-ocaml-doc/html/README
$(RM) $(DESTDIR_DOC)/usr/share/doc/libcamlimages-ocaml-doc/html/INSTALL
dh_installdocs -i
dh_installchangelogs -i CHANGES
dh_installexamples -i
# remove Makefile and .depend files (because they are relative to source
# tree of camlimages)
-find \
debian/libcamlimages-ocaml-doc \
\( -name .depend -or -name Makefile \) -exec rm {} \;
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installdocs -a
dh_installchangelogs -a CHANGES
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
|