python-bindings: fix setup.py for wheel installation

When the python bindings are installed using the new wheels
infrastructure, data_files are relative to the site-packages directory
even if using absolute paths.

The following example demonstrates the bug fixed by this commit: (ran on archlinux)

```bash
$ pip install wheel       # if this package is installed, wheel installation is made the default
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 71kB 124kB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0

$ pip install capstone    # this will use the wheel installation method now
Collecting capstone
  Using cached capstone-3.0.4.tar.gz
Building wheels for collected packages: capstone
  Running setup.py bdist_wheel for capstone ... done
  Stored in directory: /root/.cache/pip/wheels/7c/d1/d0/db6e2c5ef1063aabb9de2dd8b92b4c27ee6f9fd213240099b8
Successfully built capstone
Installing collected packages: capstone
Successfully installed capstone-3.0.4

$ find /usr/lib/ -name "libcapstone.so"
/usr/lib/python3.5/site-packages/usr/lib/python3.5/site-packages/capstone/libcapstone.so
```

So the path `SITE_PACKAGES` in the `data_files` specification of the
setup.py file was interpreted relative to the python site-packages
directory. The fix for this is simple: use `/capstone` instead of an
absolute path for `SITE_PACKAGES`.
1 file changed
tree: 299dc061f4e17a596356ee1c4ab9c8f69945746d
  1. arch/
  2. bindings/
  3. contrib/
  4. docs/
  5. include/
  6. msvc/
  7. packages/
  8. suite/
  9. tests/
  10. windows/
  11. windowsce/
  12. xcode/
  13. .appveyor.yml
  14. .gitignore
  15. .travis.yml
  16. ChangeLog
  17. CMakeLists.txt
  18. COMPILE.TXT
  19. COMPILE_CMAKE.TXT
  20. COMPILE_MSVC.TXT
  21. config.mk
  22. CREDITS.TXT
  23. cs.c
  24. cs_priv.h
  25. functions.mk
  26. HACK.TXT
  27. LEB128.h
  28. LICENSE.TXT
  29. LICENSE_LLVM.TXT
  30. make.sh
  31. Makefile
  32. MathExtras.h
  33. MCDisassembler.h
  34. MCFixedLenDisassembler.h
  35. MCInst.c
  36. MCInst.h
  37. MCInstrDesc.c
  38. MCInstrDesc.h
  39. MCRegisterInfo.c
  40. MCRegisterInfo.h
  41. pkgconfig.mk
  42. README.md
  43. RELEASE_NOTES
  44. SStream.c
  45. SStream.h
  46. TODO
  47. utils.c
  48. utils.h
README.md

Capstone Engine

Build Status Build status

Capstone is a disassembly framework with the target of becoming the ultimate disasm engine for binary analysis and reversing in the security community.

Created by Nguyen Anh Quynh, then developed and maintained by a small community, Capstone offers some unparalleled features:

  • Support multiple hardware architectures: ARM, ARM64 (ARMv8), M68K, Mips, PPC, Sparc, SystemZ, XCore and X86 (including X86_64).

  • Having clean/simple/lightweight/intuitive architecture-neutral API.

  • Provide details on disassembled instruction (called “decomposer” by others).

  • Provide semantics of the disassembled instruction, such as list of implicit registers read & written.

  • Implemented in pure C language, with lightweight wrappers for C++, C#, Go, Java, Lua, NodeJS, Ocaml, Python, Ruby, Rust & Vala ready (available in main code, or provided externally by the community).

  • Native support for all popular platforms: Windows, Mac OSX, iOS, Android, Linux, *BSD, Solaris, etc.

  • Thread-safe by design.

  • Special support for embedding into firmware or OS kernel.

  • High performance & suitable for malware analysis (capable of handling various X86 malware tricks).

  • Distributed under the open source BSD license.

Further information is available at http://www.capstone-engine.org

Compile

See COMPILE.TXT file for how to compile and install Capstone.

Documentation

See docs/README for how to customize & program your own tools with Capstone.

Hack

See HACK.TXT file for the structure of the source code.

License

This project is released under the BSD license. If you redistribute the binary or source code of Capstone, please attach file LICENSE.TXT with your products.