diff --git a/Makefile.config b/Makefile.config deleted file mode 100644 index 998989d..0000000 --- a/Makefile.config +++ /dev/null @@ -1,4 +0,0 @@ -OCAML_STDLIB=/home/xleroy/.opam/4.03.0/lib/ocaml -DBM_INCLUDES= -DBM_LINK=-lgdbm_compat -lgdbm -DBM_DEFINES=-DDBM_USES_GDBM_NDBM diff --git a/Makefile b/Makefile.old similarity index 100% rename from Makefile rename to Makefile.old diff --git a/README.md b/README.md index da9e7c6..747c94e 100644 --- a/README.md +++ b/README.md @@ -8,27 +8,29 @@ See the file `dbm.mli` for documentation of the programming inteface. This library used to be included in the standard OCaml distribution. This is the standalone distribution of this library, with the same functionalities. - ## REQUIREMENTS * OCaml * Either the GDBM library or any NDBM-compatible library. Make sure to install the development files as well. For Debian or Ubuntu, install the package `libgdbm-dev`. - ## INSTALLATION * Run the "configure" script by typing ./configure * Build the library: - make all + jbuilder build @install * Test the library: - make test + jbuilder build testdbm.exe + ./_build/default/testdbm.exe * Install the library: - sudo make install + jbuilder install +* Uninstall the library: + jbuilder build @install # if not done previously + jbuilder uninstall ## USAGE @@ -38,10 +40,6 @@ In bytecode: In native code: ocamlopt dbm.cmxa - ## LICENSE This Library is distributed under the terms of the GNU Library General Public License version 2, with a special exception allowing unconstrained static linking. See file LICENSE for details. - - - diff --git a/configure b/configure index 9a3d094..20bee19 100755 --- a/configure +++ b/configure @@ -92,6 +92,29 @@ echo echo "Configuration successful" echo +# jbuilder config file generation +cat < jbuild +(jbuild_version 1) + +(library + ((name dbm) + (public_name dbm) + (modules (dbm)) + (c_names (cldbm)) + (c_flags ($dbm_defines -I$dbm_include)) + (c_library_flags ($dbm_link)))) + +(executables + ((names (testdbm)) + (modules (testdbm)) + (libraries (dbm)))) + +(alias + ((name runtest) + (deps (testdbm.exe)) + (action (run \${<})))) +EOF + if test "$dbm_include" = "/usr/include"; then dbm_include="" else @@ -102,4 +125,3 @@ echo "OCAML_STDLIB=$stdlib" > Makefile.config echo "DBM_INCLUDES=$dbm_include" >> Makefile.config echo "DBM_LINK=$dbm_link" >> Makefile.config echo "DBM_DEFINES=$dbm_defines" >> Makefile.config - diff --git a/dbm.opam b/dbm.opam new file mode 100644 index 0000000..b50b384 --- /dev/null +++ b/dbm.opam @@ -0,0 +1,26 @@ +opam-version: "1.2" +maintainer: "https://github.com/ocaml/opam-repository/issues" +authors: "Francois Rouaix et. al." +license: "LGPL-v2 with OCaml linking exception" +homepage: "https://github.com/ocaml/dbm" +bug-reports: "https://github.com/ocaml/dbm/issues" +dev-repo: "https://github.com/ocaml/dbm.git" +build: [ + ["./configure"] + ["jbuilder" "build" "-p" name "-j" jobs] +] +build-test: [ + ["jbuilder" "runtest" "-p" name "-j" jobs] +] +depends: ["jbuilder" {build}] +depexts: [ + [["debian"] ["libgdbm-dev"]] + [["ubuntu"] ["libgdbm-dev"]] + [["nixos"] ["gdbm"]] + [["centos"] ["gdbm-devel"]] + [["rhel"] ["gdbm-devel"]] + [["fedora"] ["gdbm-devel"]] + [["alpine"] ["gdbm-dev"]] + [["homebrew"] ["gdbm"]] + [["archlinux"] ["gdbm"]] +]