diff --git a/Makefile b/Makefile
index 356e5655e75372d090093a664e8d3bfd6cd388a3..f816ffca7097642099063e798fc818251afd067c 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 all:build
 
 -include ./Makefile.version
-build:  lib/lutilsVersion.ml
+build: 
 	dune build @install
 
 install:
@@ -13,7 +13,6 @@ uninstall:
 
 clean:
 	dune clean
-	rm -f lib/lutilsVersion.ml
 
 odoc:
 	 dune build  @doc
diff --git a/Makefile.dev b/Makefile.dev
index e62ba31736ee59842fd9c9023b8736b5823360f5..1a5ecfd7ca2242462e9b1b8731d3751598629a7a 100644
--- a/Makefile.dev
+++ b/Makefile.dev
@@ -40,20 +40,12 @@ test:
 test-batch:
 	cd test ; make test-batch
 
-#############################
-# tags
-
-OTAGS=otags
-# otags don't manage to parse gnuplotRif.ml
-NO_TAGS=gnuplotRif.ml
-tags:
-	$(OTAGS) -v $(shell ocamlc -where)/*.mli  $(shell ls src/*.ml | grep -v $(NO_TAGS))
 
 ###############################
 # opam-ing
 
 NAME=lutils
-SRC=lib bin emacs README.org LICENSE Makefile Makefile.version *.opam
+SRC=lib bin emacs README.org LICENSE Makefile Makefile.version *.opam dune-project 
 
 
 $(NAME).$(VERSION).tgz: $(SRC)
@@ -65,13 +57,9 @@ opam-rel : $(NAME).$(VERSION).tgz
 opam-test : $(NAME).$(VERSION).tgz
 	make-opam-pack $(NAME).$(VERSION) $(NAME) -test
 
-
 ###############################
 # pushing onto the official repo
-WWW="/import/www/DIST-TOOLS/SYNCHRONE"
-OPAM_FILE=$(shell find  $(WWW)/opam-repository/packages/$(NAME) -name opam -cnewer opam | head -1 | sed -e 's/^./\U&/')
-OPAM_DIR=`dirname $(OPAM_FILE)`
-
+TGZ=http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/$(NAME).$(VERSION).tgz
 opam-pr:
-	cp -r $(OPAM_DIR) /home/jahier/local/opam-repository/packages/$(NAME)
+	echo "opam publish $(TGZ) ."
 
diff --git a/Makefile.version b/Makefile.version
index 5fdf1b181ab1d7ef870d33fe295084d224b93e8f..1b07c6885b86702d04a2d17e5d0f559d1d5d99bd 100644
--- a/Makefile.version
+++ b/Makefile.version
@@ -3,12 +3,3 @@
 SHA:=$(shell git log -1 --pretty=format:"%h" || echo "opam")
 BRANCH:=$(shell git branch | grep "*" | cut -d ' ' -f 2 || basename `pwd` | echo "opam")
 VERSION=$(shell git describe --tags || basename `pwd` | cut -d '.' -f2-4)
-
-del_version:
-	rm -f lib/lutilsVersion.ml
-
-gen_version: del_version src/lutilsVersion.ml 
-
-lib/lutilsVersion.ml:
-	echo "let str=\"$(VERSION)\"" > lib/lutilsVersion.ml ; \
-	echo "let sha=\"$(SHA)\"" >> lib/lutilsVersion.ml 
diff --git a/lib/dune b/lib/dune
index dcc4034c2a372d06b11912a7af6aa04ca1f9f7ec..40a5ffaa018ae61f159c8053b1ba945e19c4bbcb 100644
--- a/lib/dune
+++ b/lib/dune
@@ -1,7 +1,12 @@
 (library
-  (name lutils)
-  (public_name lutils)
-  (libraries unix str num)
-  (wrapped false)
-  (synopsis "A lib shared by Verimag/synchronous tools (lustre-v6, lutin, rdbg).")
-)
+ (name lutils)
+ (public_name lutils)
+ (libraries unix str num)
+ (wrapped false)
+ (synopsis "A lib shared by Verimag/synchronous tools (lustre-v6, lutin, rdbg).")
+ )
+
+(rule
+ (targets lutilsVersion.ml)
+ (deps generate-version.sh)
+ (action (run ./generate-version.sh)))
diff --git a/lib/generate-version.sh b/lib/generate-version.sh
new file mode 100755
index 0000000000000000000000000000000000000000..f8913bd0cc716805b7f2b1a6580cef5dce6b051c
--- /dev/null
+++ b/lib/generate-version.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+SHA=$(git log -1 --pretty=format:"%h" || echo "opam")
+VERSION=$(git describe --tags || echo "${1}")
+echo "let str=\"${VERSION}\"" > lutilsVersion.ml
+echo "let sha=\"${SHA}\"" >> lutilsVersion.ml 
\ No newline at end of file
diff --git a/lutils.opam b/lutils.opam
index e2accafa5fab514768c3cf7934cf3352db397a9e..21d91cafafc21c36d74103002f4128195868dc9c 100644
--- a/lutils.opam
+++ b/lutils.opam
@@ -1,7 +1,7 @@
 opam-version: "2.0"
 maintainer: "erwan.jahier@imag.fr"
 authors: "Erwan Jahier"
-license: "CeCILL"
+license: "CeCILL-2.1"
 homepage:
   "https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils/"
 bug-reports:
@@ -16,14 +16,15 @@ depends: [
   "num"
 ]
 build: [
-  [make "build"]
-]
+  [make "lib/lutilsVersion.ml"]
+  ["dune" "build" "-p" name "-j" jobs]
+  ]
 install: [make "install"]
 post-messages:
   "The last version can be obtained via (opam repo add) http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/opam-repository/"
 dev-repo:
   "git+https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils.git"
-synopsis: "Tools and libs shared by Verimag/synchronous tools (lustre, lutin, rdbg)."
+synopsis: "Tools and libs shared by Verimag/synchronous tools (lustre, lutin, rdbg)"
 description: """
 The lutils library contains various modules shared between tools developped at
 Verimag in the synchronous group. Those modules deal with: