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++`"
                 "--mandir=%{man}%"]
  [make]
]
install: [
  [make "install"]
  ["bap-byteweight" "update"]
]

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

depends: [
  "ocaml" {>= "4.02.1" & < "4.03"}
  "base-unix"
  "conf-time"
  "bitstring"
  "camlzip"
  "cmdliner" {= "0.9.6"}
  "cohttp" {= "0.15.0"}
  "core_kernel" {>= "111.28.0" & < "112.35.0"}
  "ezjsonm" {= "0.4.0"}
  "faillib"
  "fileutils"
  "lwt"
  "oasis" {build & >= "0.4.0" & < "0.4.7"}
  "ocamlgraph"
  "ocurl"
  "re"
  "uri"
  "utop"
  "zarith"
  "piqi" {>= "0.7.4"}
  "uuidm"
  "ocamlbuild"
]
depexts: [
  [
    "libgmp-dev"
    "libzip-dev"
    "libcurl4-gnutls-dev"
    "llvm-3.4-dev"
    "clang"
    "llvm"
    "m4"
  ] {os-distribution = "ubuntu"}
  ["gmp" "llvm-3.4" "graphviz" "curl" "libzip"]
    {os = "macos" & os-distribution = "macports"}
]
synopsis: "Binary Analysis Platform"
description: """
BAP is platform for binary analysis. It provides an OCaml library, 
a set of tools and Python bindings. It also has a JSON API, exposed with 
bap-server utility.

BAP uses LLVM library as a disassembling backend, and provide facilities to
parse files in ELF, MACH-O, COFF and PE formats. It has a basic support for 
all LLVM architectures, but first tier platforms are:

  - ARM
  - IA32 aka x86
  - AMD64 aka x86-64"""
flags: light-uninstall
url {
  src: "https://github.com/BinaryAnalysisPlatform/bap/archive/v0.9.8.tar.gz"
  checksum: "md5=a0a2a91dc1aec506d240e5ac4300b046"
}
