2013-01-04 22:30:12 +00:00
|
|
|
# Created by: bf <bf2006a@yahoo.com>
|
2008-06-15 04:46:11 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2011-06-25 13:33:20 +00:00
|
|
|
PORTNAME?= distorm
|
2013-01-04 22:30:12 +00:00
|
|
|
DISTVERSION= 20121220-r230
|
2013-01-31 20:51:47 +00:00
|
|
|
PORTREVISION?= 1
|
2008-06-15 04:46:11 +00:00
|
|
|
CATEGORIES= devel
|
2011-06-25 13:33:20 +00:00
|
|
|
.if defined(PYTHON_SLAVEPORT)
|
|
|
|
CATEGORIES+= python
|
|
|
|
.endif
|
|
|
|
MASTER_SITES= LOCAL/bf
|
|
|
|
.if defined(PYTHON_SLAVEPORT)
|
|
|
|
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
|
|
|
.endif
|
|
|
|
.if defined(PYTHON_SLAVEPORT) || make(makesum)
|
|
|
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} dislib.py
|
|
|
|
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
.endif
|
2008-06-15 04:46:11 +00:00
|
|
|
|
2010-07-08 12:51:37 +00:00
|
|
|
MAINTAINER= bf@FreeBSD.org
|
2011-06-25 13:33:20 +00:00
|
|
|
COMMENT?= Fast x86 and x86-64 disassembler library
|
2008-06-15 04:46:11 +00:00
|
|
|
|
2010-10-05 04:38:36 +00:00
|
|
|
LICENSE= GPLv3
|
|
|
|
|
2014-02-18 18:55:49 +00:00
|
|
|
USES= dos2unix
|
2011-06-25 13:33:20 +00:00
|
|
|
USE_XZ = yes
|
|
|
|
|
|
|
|
.if defined(PYTHON_SLAVEPORT)
|
2014-01-13 21:00:02 +00:00
|
|
|
USE_PYTHON= 2
|
2011-06-25 13:33:20 +00:00
|
|
|
|
2014-02-18 18:55:49 +00:00
|
|
|
USE_PYDISTUTILS= yes
|
|
|
|
PYDISTUTILS_PKGNAME= distorm3
|
|
|
|
PYDISTUTILS_PKGVERSION= 3
|
2011-06-25 13:33:20 +00:00
|
|
|
|
|
|
|
PLIST_DIRS= %%PYTHON_SITELIBDIR%%/distorm3
|
|
|
|
|
2014-02-18 18:55:49 +00:00
|
|
|
PLIST_FILES= bin/dislib.py \
|
2011-06-25 13:33:20 +00:00
|
|
|
%%PYTHON_SITELIBDIR%%/distorm3/sample.py \
|
|
|
|
%%PYTHON_SITELIBDIR%%/distorm3/__init__.py \
|
|
|
|
%%PYTHON_SITELIBDIR%%/distorm3/libdistorm3.so \
|
|
|
|
%%PYTHON_SITELIBDIR%%/distorm3/sample.pyc \
|
|
|
|
%%PYTHON_SITELIBDIR%%/distorm3/__init__.pyc \
|
|
|
|
%%PYTHON_SITELIBDIR%%/distorm3/sample.pyo \
|
|
|
|
%%PYTHON_SITELIBDIR%%/distorm3/__init__.pyo
|
|
|
|
.else
|
2008-06-15 04:46:11 +00:00
|
|
|
USE_LDCONFIG= yes
|
|
|
|
|
2011-01-21 07:49:44 +00:00
|
|
|
BUILD_WRKSRC= ${WRKSRC}/make/linux
|
2011-06-25 13:33:20 +00:00
|
|
|
|
|
|
|
PLIST_FILES= bin/disasm \
|
|
|
|
include/distorm.h \
|
|
|
|
include/mnemonics.h \
|
|
|
|
lib/libdistorm3.a \
|
|
|
|
lib/libdistorm3.so \
|
|
|
|
lib/libdistorm3.so.1
|
|
|
|
.endif
|
2011-05-08 04:46:41 +00:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2012-02-07 01:44:42 +00:00
|
|
|
.if ${ARCH} == "sparc64"
|
2011-05-08 04:46:41 +00:00
|
|
|
PICFLAG?= -fPIC
|
|
|
|
.else
|
|
|
|
PICFLAG?= -fpic
|
|
|
|
.endif
|
|
|
|
|
2011-06-25 13:33:20 +00:00
|
|
|
.if defined(PYTHON_SLAVEPORT)
|
|
|
|
post-extract:
|
|
|
|
@${CP} ${_DISTDIR}/dislib.py ${WRKSRC}
|
|
|
|
|
|
|
|
post-patch:
|
|
|
|
@${REINPLACE_CMD} -e "1{x;s|^|#!${PYTHON_CMD}|;G;}" ${WRKSRC}/dislib.py
|
|
|
|
@${REINPLACE_CMD} -e "\|extra_compile_args=|s| '-O2',||" ${WRKSRC}/setup.py
|
|
|
|
|
|
|
|
post-install:
|
2014-02-18 18:55:49 +00:00
|
|
|
@${INSTALL_SCRIPT} ${WRKSRC}/dislib.py ${STAGEDIR}${PREFIX}/bin
|
2011-06-25 13:33:20 +00:00
|
|
|
|
|
|
|
.else
|
2011-05-08 04:46:41 +00:00
|
|
|
do-build:
|
|
|
|
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} \
|
|
|
|
EXTRAFLAGS="${PICFLAG} -DDISTORM_DYNAMIC" ${MAKE} ${_MAKE_JOBS} \
|
|
|
|
${MAKE_ARGS} clib clean)
|
|
|
|
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} \
|
|
|
|
EXTRAFLAGS="-DDISTORM_STATIC" ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} staticlib)
|
2012-05-21 05:03:09 +00:00
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} -o ${BUILD_WRKSRC}/disasm \
|
|
|
|
${WRKSRC}/examples/linux/main.c ${BUILD_WRKSRC}/libdistorm3.a
|
2008-06-15 04:46:11 +00:00
|
|
|
|
2013-01-04 22:30:12 +00:00
|
|
|
check regression-test test: build
|
|
|
|
@cd ${BUILD_WRKSRC}; ./disasm disasm
|
|
|
|
|
2008-06-15 04:46:11 +00:00
|
|
|
do-install:
|
2014-02-18 18:55:49 +00:00
|
|
|
@(cd ${BUILD_WRKSRC}; ${INSTALL_LIB} libdistorm3.a ${STAGEDIR}${PREFIX}/lib; \
|
|
|
|
${INSTALL_LIB} libdistorm3.so ${STAGEDIR}${PREFIX}/lib/libdistorm3.so.1; \
|
|
|
|
${LN} -sf libdistorm3.so.1 ${STAGEDIR}${PREFIX}/lib/libdistorm3.so; \
|
|
|
|
${INSTALL_PROGRAM} disasm ${STAGEDIR}${PREFIX}/bin)
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include
|
2008-06-15 04:46:11 +00:00
|
|
|
|
2011-06-25 13:33:20 +00:00
|
|
|
.endif
|
2011-05-08 04:46:41 +00:00
|
|
|
.include <bsd.port.post.mk>
|