From 8250b2a192182e542e0c1455464a219f593db394 Mon Sep 17 00:00:00 2001 From: George Shammas Date: Mon, 24 Jul 2023 07:17:26 -0400 Subject: [PATCH] Use dune to generate opam files --- dune-project | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ rawlink-eio.opam | 49 ++++++++++++++++++------------ rawlink-lwt.opam | 49 ++++++++++++++++++------------ rawlink.opam | 51 ++++++++++++++++++------------- 4 files changed, 168 insertions(+), 59 deletions(-) diff --git a/dune-project b/dune-project index 0091654..eec0a2b 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,80 @@ (lang dune 3.2) (name rawlink) +(generate_opam_files) +(source (github haesbaert/rawlink)) +(homepage https://github.com/haesbaert/rawlink) +(bug_reports https://github.com/haesbaert/rawlink/issues) +(documentation https://haesbaert.github.io/rawlink/) +(authors "Christiano F. Haesbaert ") +(maintainers "Christiano F. Haesbaert ") +(license "ISC") + +(package + (name rawlink) + (synopsis "Portable library to read and write raw packets") + (description "Rawlink is an ocaml library for sending and receiving raw packets at the link +layer level. Sometimes you need to have full control of the packet, including +building the full ethernet frame. + +The API is platform independent, it uses BPF on real UNIXes and AF_SOCKET on +linux. Some functionality is sacrificed so that the API is portable enough. + +Currently BPF and AF_PACKET are implemented, including filtering capabilities. +Writing a BPF program is a pain in the ass, so no facilities are provided for +it. If you need a BPF filter, I suggest you write a small .c file with a +function that returns the BPF program as a string, check `rawlink_stubs.c` for +an example.") + (depends (ocaml (>= "4.09.0")) + (cstruct (>= "6.1.0")) + ppx_cstruct) +) + +(package + (name rawlink-eio) + (synopsis "Portable library to read and write raw packets with EIO bindings") + (description " +Rawlink is an ocaml library for sending and receiving raw packets at the link +layer level. Sometimes you need to have full control of the packet, including +building the full ethernet frame. + +The API is platform independent, it uses BPF on real UNIXes and AF_SOCKET on +linux. Some functionality is sacrificed so that the API is portable enough. + +Currently BPF and AF_PACKET are implemented, including filtering capabilities. +Writing a BPF program is a pain in the ass, so no facilities are provided for +it. If you need a BPF filter, I suggest you write a small .c file with a +function that returns the BPF program as a string, check `rawlink_stubs.c` for +an example. + +This version of Rawlink is to be used with Eio, the IO functions will produce +EIO effects. +") + (depends (ocaml (>= "5.0.0")) + (rawlink (>= "2.1")) + (eio (>= "0.4"))) +) + +(package + (name rawlink-lwt) + (synopsis "Portable library to read and write raw packets with Lwt bindings") + (description " +Rawlink is an ocaml library for sending and receiving raw packets at the link +layer level. Sometimes you need to have full control of the packet, including +building the full ethernet frame. + +The API is platform independent, it uses BPF on real UNIXes and AF_SOCKET on +linux. Some functionality is sacrificed so that the API is portable enough. + +Currently BPF and AF_PACKET are implemented, including filtering capabilities. +Writing a BPF program is a pain in the ass, so no facilities are provided for +it. If you need a BPF filter, I suggest you write a small .c file with a +function that returns the BPF program as a string, check `rawlink_stubs.c` for +an example. + +This version of Rawlink is to be used with Lwt, the IO functions will produce +Lwt threads (promises). +") + (depends (ocaml (>= "4.09.0")) + (rawlink (>= "2.1")) + (lwt (>= "2.4.7"))) +) diff --git a/rawlink-eio.opam b/rawlink-eio.opam index a298117..a4c4356 100644 --- a/rawlink-eio.opam +++ b/rawlink-eio.opam @@ -1,25 +1,8 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -maintainer: "Christiano F. Haesbaert " -authors: "Christiano F. Haesbaert " -license: "ISC" -homepage: "https://github.com/haesbaert/rawlink" -bug-reports: "https://github.com/haesbaert/rawlink/issues" -dev-repo: "git+https://github.com/haesbaert/rawlink.git" -doc: "https://haesbaert.github.io/rawlink/" -build: [ - [ "dune" "subst" ] {dev} - [ "dune" "build" "-p" name "-j" jobs ] ] -depends: [ - "ocaml" {>= "5.0.0"} - "dune" {>= "3.2"} - "rawlink" {>= "2.1"} - "eio" {>= "0.4"} -] -depexts: [ - ["linux-headers"] {os-distribution = "alpine"} -] synopsis: "Portable library to read and write raw packets with EIO bindings" description: """ + Rawlink is an ocaml library for sending and receiving raw packets at the link layer level. Sometimes you need to have full control of the packet, including building the full ethernet frame. @@ -36,3 +19,31 @@ an example. This version of Rawlink is to be used with Eio, the IO functions will produce EIO effects. """ +maintainer: ["Christiano F. Haesbaert "] +authors: ["Christiano F. Haesbaert "] +license: "ISC" +homepage: "https://github.com/haesbaert/rawlink" +doc: "https://haesbaert.github.io/rawlink/" +bug-reports: "https://github.com/haesbaert/rawlink/issues" +depends: [ + "dune" {>= "3.2"} + "ocaml" {>= "5.0.0"} + "rawlink" {>= "2.1"} + "eio" {>= "0.4"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/haesbaert/rawlink.git" diff --git a/rawlink-lwt.opam b/rawlink-lwt.opam index 7241a5b..1864095 100644 --- a/rawlink-lwt.opam +++ b/rawlink-lwt.opam @@ -1,25 +1,8 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -maintainer: "Christiano F. Haesbaert " -authors: "Christiano F. Haesbaert " -license: "ISC" -homepage: "https://github.com/haesbaert/rawlink" -bug-reports: "https://github.com/haesbaert/rawlink/issues" -dev-repo: "git+https://github.com/haesbaert/rawlink.git" -doc: "https://haesbaert.github.io/rawlink/" -build: [ - [ "dune" "subst" ] {dev} - [ "dune" "build" "-p" name "-j" jobs ] ] -depends: [ - "ocaml" {>= "4.09.0"} - "dune" {>= "3.2"} - "rawlink" {>= "2.1"} - "lwt" {>= "2.4.7"} -] -depexts: [ - ["linux-headers"] {os-distribution = "alpine"} -] synopsis: "Portable library to read and write raw packets with Lwt bindings" description: """ + Rawlink is an ocaml library for sending and receiving raw packets at the link layer level. Sometimes you need to have full control of the packet, including building the full ethernet frame. @@ -36,3 +19,31 @@ an example. This version of Rawlink is to be used with Lwt, the IO functions will produce Lwt threads (promises). """ +maintainer: ["Christiano F. Haesbaert "] +authors: ["Christiano F. Haesbaert "] +license: "ISC" +homepage: "https://github.com/haesbaert/rawlink" +doc: "https://haesbaert.github.io/rawlink/" +bug-reports: "https://github.com/haesbaert/rawlink/issues" +depends: [ + "dune" {>= "3.2"} + "ocaml" {>= "4.09.0"} + "rawlink" {>= "2.1"} + "lwt" {>= "2.4.7"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/haesbaert/rawlink.git" diff --git a/rawlink.opam b/rawlink.opam index 9c137cb..0e823ac 100644 --- a/rawlink.opam +++ b/rawlink.opam @@ -1,23 +1,5 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -maintainer: "Christiano F. Haesbaert " -authors: "Christiano F. Haesbaert " -license: "ISC" -homepage: "https://github.com/haesbaert/rawlink" -bug-reports: "https://github.com/haesbaert/rawlink/issues" -dev-repo: "git+https://github.com/haesbaert/rawlink.git" -doc: "https://haesbaert.github.io/rawlink/" -build: [ - [ "dune" "subst" ] {dev} - [ "dune" "build" "-p" name "-j" jobs ] ] -depends: [ - "ocaml" {>= "4.09.0"} - "dune" {>= "3.2"} - "cstruct" {>= "6.1.0"} - "ppx_cstruct" -] -depexts: [ - ["linux-headers"] {os-distribution = "alpine"} -] synopsis: "Portable library to read and write raw packets" description: """ Rawlink is an ocaml library for sending and receiving raw packets at the link @@ -31,5 +13,32 @@ Currently BPF and AF_PACKET are implemented, including filtering capabilities. Writing a BPF program is a pain in the ass, so no facilities are provided for it. If you need a BPF filter, I suggest you write a small .c file with a function that returns the BPF program as a string, check `rawlink_stubs.c` for -an example. -""" +an example.""" +maintainer: ["Christiano F. Haesbaert "] +authors: ["Christiano F. Haesbaert "] +license: "ISC" +homepage: "https://github.com/haesbaert/rawlink" +doc: "https://haesbaert.github.io/rawlink/" +bug-reports: "https://github.com/haesbaert/rawlink/issues" +depends: [ + "dune" {>= "3.2"} + "ocaml" {>= "4.09.0"} + "cstruct" {>= "6.1.0"} + "ppx_cstruct" + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/haesbaert/rawlink.git"