opam-version: "2.0"
maintainer: "Ivan Gotovchits <ivg@ieee.org>"
authors: "BAP Team"
homepage: "https://github.com/BinaryAnalysisPlatform/bap/"
bug-reports: "https://github.com/BinaryAnalysisPlatform/bap/issues"
dev-repo: "git://github.com/BinaryAnalysisPlatform/bap/"
license: "MIT"
build: [
  ["./configure"
                 "--prefix=%{prefix}%"
                 "--with-cxx=`which clang++`"
                 "--enable-docs"
                 "--docdir=%{doc}%/bap"
                 "--mandir=%{man}%"]
  [make]
  [make "doc"]
]
install: [
  [make "install"]
]

remove: [
  ["ocamlfind" "remove" "bap"]
  ["ocamlfind" "remove" "core_lwt"]
  ["rm" "-rf" bap:doc]
  ["rm" "-f" "%{prefix}%/share/bap/sigs.zip"]
  ["rm" "-f" "%{man}%/man1/bap-mc.1"]
  ["rm" "-f" "%{man}%/man1/bap-objdump.1"]
  ["rm" "-f" "%{man}%/man1/bap-byteweight.1"]
  ["rm" "-f" "%{bin}%/bap-mc"]
  ["rm" "-f" "%{bin}%/bap-objdump"]
  ["rm" "-f" "%{bin}%/bap-byteweight"]
  ["rm" "-f" "%{bin}%/bap-server"]
  ["rm" "-f" "%{bin}%/bapbuild"]
  ["rm" "-f" "%{bin}%/baptop"]
]

depends: [
  "ocaml" {>= "4.01"}
  "base-unix"
  "bitstring"
  "conf-time"
  "camlzip"
  "cmdliner" {= "0.9.6"}
  "cohttp" {= "0.15.0"}
  "core_kernel" {= "111.28.0"}
  "ezjsonm" {= "0.4.0"}
  "faillib"
  "fileutils"
  "lwt"
  "oasis" {build & >= "0.4.0" & < "0.4.7"}
  "ocamlgraph"
  "ocurl"
  "re"
  "uri"
  "utop"
  "zarith"
  "ocamlbuild" {build}
]
depexts:
  [
    "libgmp-dev"
    "libzip-dev"
    "libcurl4-gnutls-dev"
    "llvm-3.4-dev"
    "clang"
    "llvm"
    "m4"
  ] {os-distribution = "ubuntu"}
synopsis: "Binary Analysis Platform"
description: """
BAP library provides basic facilities for performing binary
analysis using OCaml, Python or other languages.

BAP uses LLVM library as a disassembling backend, and provide facilities to
parse files in ELF and DWARF formats."""
flags: light-uninstall
url {
  src: "https://github.com/BinaryAnalysisPlatform/bap/archive/v0.9.5.tar.gz"
  checksum: "md5=cd93875129d1d2c1f86fa05716c259d5"
}
