From 5abf4df5707dd66f6ff9a46d11ceb109f248120f Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Sat, 11 Jun 2005 19:25:43 +0000 Subject: [PATCH] rewritten makefile and debian packaging: .deb ready! --- .../lablgtksourceview/{ChangeLog => CHANGES} | 0 helm/DEVEL/lablgtksourceview/Changelog | 0 helm/DEVEL/lablgtksourceview/Makefile.in | 143 +++++++++++------- helm/DEVEL/lablgtksourceview/configure.ac | 7 +- helm/DEVEL/lablgtksourceview/debian/changelog | 2 +- helm/DEVEL/lablgtksourceview/debian/control | 16 +- .../liblablgtksourceview-ocaml-dev.dirs | 2 - ...cs => liblablgtksourceview-ocaml-dev.docs} | 1 + .../liblablgtksourceview-ocaml-dev.install | 7 + .../debian/liblablgtksourceview-ocaml.dirs | 1 - .../debian/liblablgtksourceview-ocaml.install | 3 +- helm/DEVEL/lablgtksourceview/debian/rules | 68 +-------- 12 files changed, 109 insertions(+), 141 deletions(-) rename helm/DEVEL/lablgtksourceview/{ChangeLog => CHANGES} (100%) create mode 100644 helm/DEVEL/lablgtksourceview/Changelog delete mode 100644 helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.dirs rename helm/DEVEL/lablgtksourceview/debian/{docs => liblablgtksourceview-ocaml-dev.docs} (78%) create mode 100644 helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.install delete mode 100644 helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml.dirs diff --git a/helm/DEVEL/lablgtksourceview/ChangeLog b/helm/DEVEL/lablgtksourceview/CHANGES similarity index 100% rename from helm/DEVEL/lablgtksourceview/ChangeLog rename to helm/DEVEL/lablgtksourceview/CHANGES diff --git a/helm/DEVEL/lablgtksourceview/Changelog b/helm/DEVEL/lablgtksourceview/Changelog new file mode 100644 index 000000000..e69de29bb diff --git a/helm/DEVEL/lablgtksourceview/Makefile.in b/helm/DEVEL/lablgtksourceview/Makefile.in index 0082f6e39..12dbc472a 100644 --- a/helm/DEVEL/lablgtksourceview/Makefile.in +++ b/helm/DEVEL/lablgtksourceview/Makefile.in @@ -2,45 +2,65 @@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ INCLUDEDIR = @OCAML_INCLUDE_DIR@ PROPCC = @OCAML_LIB_DIR@/lablgtk2/propcc -PREFIX = -OBJECTS_C = ml_gtk_sourceview.o -OBJECTS = gtkSourceViewProps.cmo ogtkSourceViewProps.cmo gtk_sourceview.cmo gtkSourceView.cmo gSourceView.cmo -OBJECTS_OPT = gtkSourceViewProps.cmx ogtkSourceViewProps.cmx gtkSourceView.cmx gtk_sourceview.cmx gSourceView.cmx -GENERATED_FILES = gtkSourceViewProps.ml ogtkSourceViewProps.ml +DESTDIR = NULL = -INST = \ - META gSourceView.mli gSourceView.cmi gtkSourceView.cmi gtk_sourceview.cmi \ - gtkSourceViewProps.cmi ogtkSourceViewProps.cmi \ +C_OBJECTS = ml_gtk_sourceview.o +ML_OBJECTS = \ + gtkSourceViewProps.cmo \ + ogtkSourceViewProps.cmo \ + gtk_sourceview.cmo \ + gtkSourceView.cmo \ + gSourceView.cmo \ + $(NULL) +ML_OBJECTS_OPT = $(patsubst %.cmo,%.cmx,$(ML_OBJECTS)) +GENERATED_FILES = gtkSourceViewProps.ml ogtkSourceViewProps.ml +EXTRA_INST = \ + META \ + gSourceView.mli \ + gSourceView.cmi \ + gtkSourceView.cmi \ + gtk_sourceview.cmi \ + $(NULL) +DIST_FILES = \ + Makefile.in \ + configure \ + gSourceView.ml \ + gSourceView.mli \ + gtkSourceView.ml \ + gtk_sourceview.ml \ + ml_gtk_sourceview.c \ + META.in \ + .depend \ + debian/ \ + test/ \ + gtkSourceView.props \ $(NULL) -DIST_FILES = \ - Makefile.in configure.in gSourceView.ml gSourceView.mli \ - gtkSourceView.ml \ - gtk_sourceview.ml ml_gtk_sourceview.c META.in .depend debian/ test/ \ - configure gtkSourceView.props DIST_DIR = $(PACKAGE)-$(VERSION) -DOC_FILES = AUTHORS COPYING ChangeLog NEWS README LICENSE +EXTRA_DIST = ACKNOWLEDGEMENTS AUTHORS CHANGES COPYING LICENSE NEWS README REQUIRES = lablgtk2 -PREDICATES = SHARED_LIBS = @GTKSOURCEVIEW_LIBS@ - OCAMLFIND = ocamlfind -OCAMLC = $(OCAMLFIND) ocamlc -OCAMLOPT = $(OCAMLFIND) ocamlopt +OCAMLC = $(OCAMLFIND) ocamlc -package "$(REQUIRES)" +OCAMLOPT = $(OCAMLFIND) ocamlopt -package "$(REQUIRES)" OCAMLDEP = ocamldep OCAMLMKLIB = ocamlmklib OCAML_STUB_DIR = @OCAML_STUB_DIR@ - ARCHIVE = $(PACKAGE) DLL = dll$(ARCHIVE).so - +NATIVE = @HAVE_OCAMLOPT@ TESTDIR = test +BYTE_INST = $(ARCHIVE).cma $(C_OBJECTS) $(DLL) +OPT_INST = $(BYTE_INST) $(ARCHIVE).a $(ARCHIVE).cmxa + +ifeq ($(NATIVE),yes) +world: all opt +else +world: all +endif all: $(ARCHIVE).cma $(TESTDIR)/test opt: $(ARCHIVE).cmxa $(TESTDIR)/test.opt -world: all opt - -.PHONY: test/test test/test.opt test/test.opt: $(MAKE) -C $(TESTDIR) test.opt test/test: @@ -48,63 +68,66 @@ test/test: dist: rm -rf $(DIST_DIR)/ - mkdir $(DIST_DIR)/ - cp -a $(DIST_FILES) $(DOC_FILES) $(DIST_DIR)/ + mkdir -p $(DIST_DIR)/ + cp -a $(DIST_FILES) $(EXTRA_DIST) $(DIST_DIR)/ -find $(DIST_DIR) -name CVS -type d -exec rm -rf {} \; -find $(DIST_DIR) -name .cvsignore -type f -exec rm {} \; tar cvfz $(DIST_DIR).tar.gz $(DIST_DIR)/ rm -rf $(DIST_DIR)/ deb: dist - if [ -d $(DIST_DIR)/ ]; then rm -rf $(DIST_DIR); else true; fi + rm -rf $(DIST_DIR) tar xvzf $(DIST_DIR).tar.gz (cd $(DIST_DIR)/ && debuild) rm -rf $(DIST_DIR) -$(GENERATED_FILES): gtkSourceView.props - ml_gtk_sourceview.o: ml_gtk_sourceview.c gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk2` @GTKSOURCEVIEW_CFLAGS@ $< -.SUFFIXES: .cmo .cmi .cmx .ml .mli +%.cmo: %.ml + $(OCAMLC) -c $< +%.cmi: %.mli + $(OCAMLC) -c $< +%.cmx: %.ml + $(OCAMLOPT) -c $< -.ml.cmo: - $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $< -.mli.cmi: - $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $< -.ml.cmx: - $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $< - -%Props.ml o%Props.ml: %.props $(PROPCC) +$(GENERATED_FILES): gtkSourceView.props +%Props.ml o%Props.ml: %.props $(PROPCC) $< depend: *.ml *.mli $(GENERATED_FILES) $(OCAMLDEP) *.ml *.mli >.depend include .depend -$(ARCHIVE).cma $(DLL): $(OBJECTS) $(OBJECTS_C) +$(ARCHIVE).cma $(DLL): $(ML_OBJECTS) $(C_OBJECTS) $(OCAMLMKLIB) -o $(ARCHIVE) -L$(OCAML_STUB_DIR) $^ $(SHARED_LIBS) -$(ARCHIVE).cmxa $(ARCHIVE).a: $(OBJECTS_OPT) - $(OCAMLMKLIB) -o $(ARCHIVE) -L$(OCAML_STUB_DIR) $^ $(OBJECTS_C) $(SHARED_LIBS) - -install: - test ! -f $(ARCHIVE).cmxa || extra="$(ARCHIVE).a $(ARCHIVE).cmxa" ; \ - if [ "$(PREFIX)" = "" ]; then \ - $(OCAMLFIND) install \ - $(PACKAGE) $(OBJECTS_C) $(ARCHIVE).cma $(DLL) $(INST) $$extra; \ - ln -fs $(DLL) $(shell $(OCAMLFIND) printconf destdir)/stublibs/lib$(ARCHIVE).so; \ - else \ - $(OCAMLFIND) install -destdir $(PREFIX) \ - $(PACKAGE) $(OBJECTS_C) $(ARCHIVE).cma $(DLL) $(INST) $$extra; \ - ln -fs $(DLL) $(PREFIX)/stublibs/lib$(ARCHIVE).so; \ - fi +$(ARCHIVE).cmxa $(ARCHIVE).a: $(ML_OBJECTS_OPT) + $(OCAMLMKLIB) -o $(ARCHIVE) -L$(OCAML_STUB_DIR) $^ $(C_OBJECTS) $(SHARED_LIBS) + +ifeq ($(DESTDIR),"") +INSTALLER = $(OCAMLFIND) install -ldconf /dev/null +UNINSTALLER = $(OCAMLFIND) remove -ldconf /dev/null +else +INSTALLER = $(OCAMLFIND) install -destdir $(DESTDIR) -ldconf /dev/null +UNINSTALLER = $(OCAMLFIND) remove -destdir $(DESTDIR) -ldconf /dev/null +install: installmkdir +installmkdir: + mkdir -p $(DESTDIR) +endif + +ifeq ($(NATIVE),yes) +install: installworld +else +install: installbyte +endif + +installbyte: + $(INSTALLER) $(PACKAGE) $(BYTE_INST) $(EXTRA_INST) +installworld: + $(INSTALLER) $(PACKAGE) $(OPT_INST) $(EXTRA_INST) uninstall: - if [ "$(PREFIX)" = "" ]; then \ - ocamlfind remove $(PACKAGE); \ - else \ - ocamlfind remove -destdir $(PREFIX) $(PACKAGE); \ - fi + $(UNINSTALLER) $(PACKAGE) clean: rm -f *.[ao] *.cm[iaxo] *.cmxa *.so $(GENERATED_FILES) @@ -112,4 +135,8 @@ clean: distclean: clean rm -f config.log config.cache config.status Makefile META - cd $(TESTDIR) ; make distclean + make -C $(TESTDIR) distclean + +.PHONY: world uninstall clean distclean test/test test/test.opt +.PHONY: install installmkdir installbyte installworld + diff --git a/helm/DEVEL/lablgtksourceview/configure.ac b/helm/DEVEL/lablgtksourceview/configure.ac index 144cf5466..bac74370d 100644 --- a/helm/DEVEL/lablgtksourceview/configure.ac +++ b/helm/DEVEL/lablgtksourceview/configure.ac @@ -11,11 +11,9 @@ PKG_CHECK_MODULES([GTKSOURCEVIEW], [gtksourceview-1.0 >= 1.2.0]) AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no) if test $HAVE_OCAMLFIND = "no"; then - AC_MSG_ERROR(could not find ocamlfind in PATH, please make sure findlib is installed) + AC_MSG_ERROR(could not find ocamlfind) fi - FINDLIB_REQUIRES="lablgtk2" - for r in $FINDLIB_REQUIRES do AC_MSG_CHECKING(for $r ocaml library) @@ -36,6 +34,8 @@ AC_CHECK_FILE(/usr/include/caml/mlvalues.h, AC_MSG_ERROR(could not find ocaml header files) ) +AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no) + AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_SUBST(GTKSOURCEVIEW_CFLAGS) @@ -43,6 +43,7 @@ AC_SUBST(GTKSOURCEVIEW_LIBS) AC_SUBST(OCAML_LIB_DIR) AC_SUBST(OCAML_STUB_DIR) AC_SUBST(OCAML_INCLUDE_DIR) +AC_SUBST(HAVE_OCAMLOPT) AC_OUTPUT([ test/Makefile diff --git a/helm/DEVEL/lablgtksourceview/debian/changelog b/helm/DEVEL/lablgtksourceview/debian/changelog index a87a0bb9d..5814ca096 100644 --- a/helm/DEVEL/lablgtksourceview/debian/changelog +++ b/helm/DEVEL/lablgtksourceview/debian/changelog @@ -2,5 +2,5 @@ lablgtksourceview (0.0.1-1) unstable; urgency=low * Initial release. - -- Stefano Zacchiroli Sat, 11 Jun 2005 12:07:13 +0200 zack + -- Stefano Zacchiroli Sat, 11 Jun 2005 12:07:13 +0200 diff --git a/helm/DEVEL/lablgtksourceview/debian/control b/helm/DEVEL/lablgtksourceview/debian/control index e5873371c..5ad4262c0 100644 --- a/helm/DEVEL/lablgtksourceview/debian/control +++ b/helm/DEVEL/lablgtksourceview/debian/control @@ -5,25 +5,25 @@ Maintainer: Stefano Zacchiroli Build-Depends: debhelper (>= 4.1.0), cdbs, ocaml-findlib, ocaml-nox-3.08.3, liblablgtk2-ocaml-dev (>= 2.4.0+2005.02.18-3+zack), libgtksourceview-dev (>= 1.2.0) Standards-Version: 3.6.1.1 -Package: liblablgtksourceview-ocaml +Package: liblablgtksourceview-ocaml-dev Architecture: any -Section: libs -Depends: ocaml-base-nox-3.08, liblablgtk2-ocaml (>= 2.4.0+2005.02.18-3+zack), ${shlibs:Depends}, ${misc:Depends} +Section: libdevel +Depends: ocaml-nox-3.08.3, ocaml-findlib, liblablgtksourceview-ocaml (= ${Source-Version}), liblablgtk2-ocaml-dev (>= 2.4.0+2005.02.18-3+zack), libgtksourceview-dev (>= 1.2.0), ${misc:Depends} Description: OCaml bindings for libgtksourceview, a source editor GTK widget This is the OCaml binding for the GtkSourceView widget, a text widget that extends the standard gtk+ 2.x text widget with syntax highlighting and other features typical of a source editor. . - This package contains the shared runtime stub libraries. + This package contains the development part of the lablgtksourceview package. -Package: liblablgtksourceview-ocaml-dev +Package: liblablgtksourceview-ocaml Architecture: any -Section: libdevel -Depends: ocaml-nox-3.08.3, ocaml-findlib, liblablgtksourceview-ocaml (= ${Source-Version}), liblablgtk2-ocaml-dev (>= 2.4.0+2005.02.18-3+zack), libgtksourceview-dev (>= 1.2.0), ${misc:Depends} +Section: libs +Depends: ocaml-base-nox-3.08.3, liblablgtk2-ocaml (>= 2.4.0+2005.02.18-3+zack), ${shlibs:Depends}, ${misc:Depends} Description: OCaml bindings for libgtksourceview, a source editor GTK widget This is the OCaml binding for the GtkSourceView widget, a text widget that extends the standard gtk+ 2.x text widget with syntax highlighting and other features typical of a source editor. . - This package contains the development part of the lablgtksourceview package. + This package contains the shared runtime stub libraries. diff --git a/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.dirs b/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.dirs deleted file mode 100644 index 7e66c4fb5..000000000 --- a/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/ocaml/3.08 -usr/lib/ocaml/3.08/stublibs diff --git a/helm/DEVEL/lablgtksourceview/debian/docs b/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.docs similarity index 78% rename from helm/DEVEL/lablgtksourceview/debian/docs rename to helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.docs index 4058ec2fd..5a9c30e60 100644 --- a/helm/DEVEL/lablgtksourceview/debian/docs +++ b/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.docs @@ -1,3 +1,4 @@ ACKNOWLEDGEMENTS +AUTHORS NEWS README diff --git a/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.install b/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.install new file mode 100644 index 000000000..ff039c3ef --- /dev/null +++ b/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml-dev.install @@ -0,0 +1,7 @@ +debian/tmp/lablgtksourceview/*.a usr/lib/ocaml/3.08.3/lablgtksourceview/ +debian/tmp/lablgtksourceview/*.cma usr/lib/ocaml/3.08.3/lablgtksourceview/ +debian/tmp/lablgtksourceview/*.cmi usr/lib/ocaml/3.08.3/lablgtksourceview/ +debian/tmp/lablgtksourceview/*.cmxa usr/lib/ocaml/3.08.3/lablgtksourceview/ +debian/tmp/lablgtksourceview/META usr/lib/ocaml/3.08.3/lablgtksourceview/ +debian/tmp/lablgtksourceview/*.mli usr/lib/ocaml/3.08.3/lablgtksourceview/ +debian/tmp/lablgtksourceview/*.o usr/lib/ocaml/3.08.3/lablgtksourceview/ diff --git a/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml.dirs b/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml.dirs deleted file mode 100644 index f552f091a..000000000 --- a/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib/ocaml/3.08 diff --git a/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml.install b/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml.install index 6657f706e..4565d7c33 100644 --- a/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml.install +++ b/helm/DEVEL/lablgtksourceview/debian/liblablgtksourceview-ocaml.install @@ -1,2 +1 @@ -usr/lib/ocaml/3.08/lablgtkmathview/*.so -usr/lib/ocaml/3.08/stublibs/* +debian/tmp/lablgtksourceview/*.so usr/lib/ocaml/3.08.3/stublibs/ diff --git a/helm/DEVEL/lablgtksourceview/debian/rules b/helm/DEVEL/lablgtksourceview/debian/rules index 8b6ed0bb5..f738c4d58 100755 --- a/helm/DEVEL/lablgtksourceview/debian/rules +++ b/helm/DEVEL/lablgtksourceview/debian/rules @@ -1,67 +1,3 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -TARGETDIR = debian/liblablgtkmathview-ocaml-dev -OCAML_STDLIB_DIR = $(shell ocamlc -where) - -configure: configure-stamp -configure-stamp: - dh_testdir - ./configure - - touch configure-stamp - -build: configure-stamp build-stamp -build-stamp: - dh_testdir - - $(MAKE) - if [ -x /usr/bin/ocamlopt ]; then $(MAKE) opt; else true; fi - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - -$(MAKE) distclean - - dh_clean -distclean: clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs -s - - $(MAKE) install PREFIX=$(TARGETDIR)$(OCAML_STDLIB_DIR) - -movefiles: install - dh_install -p liblablgtkmathview-ocaml --sourcedir=$(TARGETDIR) - -binary-arch: build install - dh_testdir - dh_testroot - dh_installdocs -s - dh_installexamples -s - dh_installmanpages -s - dh_installinfo -s - dh_installchangelogs -s ChangeLog - dh_link -s - dh_strip -s - dh_compress -s - dh_fixperms -s - dh_installdeb -s - dh_shlibdeps -s - dh_gencontrol -s - dh_md5sums -s - dh_builddeb -s - -binary: binary-arch -.PHONY: build clean binary-arch binary install configure +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk -- 2.39.2