python: fix installer

test2
Nguyen Anh Quynh 10 years ago
parent 0498085a1c
commit 35ceed7b8f
  1. 39
      bindings/python/Makefile
  2. 14
      bindings/python/PKG-INFO.win
  3. 10
      bindings/python/setup.py

@ -44,34 +44,39 @@ install_cython:
mv $(OBJDIR)/build/lib/python/capstone/* capstone
cd $(OBJDIR) && python setup_cython.py build -b ./tmp install
# build Python package with source
# build & upload PyPi package with source code of the core
sdist:
rm -rf src/
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
rm -rf README
mv README.pypi-src README
python setup.py sdist
cp README.pypi-src README
cp PKG-INFO.src PKG-INFO
python setup.py sdist register upload
# build Python package with source
# build & upload PyPi package with source code of the core
sdist3:
rm -rf src/
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
rm -rf README
mv README.pypi-src README
python3 setup.py sdist
cp README.pypi-src README
cp PKG-INFO.src PKG-INFO
python3 setup.py sdist register upload
# build Python package with prebuilt core
sdist_bin:
# build & upload PyPi package with prebuilt core
# NOTE: be sure to have precompiled core under prebuilt/win*/ beforehand
sdist_win:
rm -rf src/
rm -rf README
mv README.pypi-win README
python setup.py sdist
cp README.pypi-win README
cp PKG-INFO.win PKG-INFO
python setup.py sdist register upload
# build Python package with prebuilt core
sdist3_bin:
# build & upload PyPi package with prebuilt core
# NOTE: be sure to have precompiled core under prebuilt/win*/ beforehand
sdist3_win:
rm -rf src/
mv README.pypi-win README
python3 setup.py sdist
cp README.pypi-win README
cp PKG-INFO.win PKG-INFO
python3 setup.py sdist register upload
clean:
rm -rf $(OBJDIR) src/ README

@ -0,0 +1,14 @@
Metadata-Version: 1.3
Name: capstone
Version: 3.0.1
Author: Nguyen Anh Quynh
Author-email: aquynh at gmail com
Maintainer: Nguyen Anh Quynh
Maintainer-email: aquynh at gmail com
Home-page: http://www.capstone-engine.org
Download-url: www.capstone-engine.org
Summary: Capstone disassembly framework
License: BSD
Description: Capstone is a lightweight multi-platform, multi-architecture disassembly framework with some advanced features. Further information is available at the homepage http://www.capstone-engine.org
Keywords: disassembly reverse binary arm arm64 aarch64 powerpc ppc mips x86 x86_64 sparc systemz xcore
Platform: Windows MacOSX Linux NetBSD FreeBSD OpenBSD Solaris Android iOS

@ -17,7 +17,11 @@ from distutils.sysconfig import get_python_lib
PATH_LIB64 = "prebuilt/win64/capstone.dll"
PATH_LIB32 = "prebuilt/win32/capstone.dll"
# platform description refers at https://docs.python.org/2/library/sys.html#sys.platform
# package name can be 'capstone' or 'capstone-win'
PKG_NAME = 'capstone'
if os.path.exists(PATH_LIB64) and os.path.exists(PATH_LIB32):
PKG_NAME = 'capstone-win'
SYSTEM = sys.platform
VERSION = '4.0'
@ -68,7 +72,7 @@ class custom_sdist(sdist):
def run(self):
# if prebuilt libraries are existent, then do not copy source
if os.path.exists(PATH_LIB64) and os.path.exists(PATH_LIB32):
return
return sdist.run(self)
copy_sources()
return sdist.run(self)
@ -146,7 +150,7 @@ def dummy_src():
setup(
provides=['capstone'],
packages=['capstone'],
name='capstone',
name=PKG_NAME,
version=VERSION,
author='Nguyen Anh Quynh',
author_email='aquynh@gmail.com',

Loading…
Cancel
Save