summaryrefslogtreecommitdiff
path: root/security/sqlmap/Makefile
blob: a66275e9256832105922ae4502fa64ef5f0a31c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# New ports collection makefile for:	sqlmap
# Date created:		2008-05-21
# Whom:			Tomoyuki Sakurai <cherry@trombik.org>
#
# $FreeBSD$
#

PORTNAME=	sqlmap
PORTVERSION=	0.8
CATEGORIES=	security python
MASTER_SITES=	SF

MAINTAINER=	niels@FreeBSD.org
COMMENT=	An automatic SQL injection tool

USE_PYTHON=	2.5+
USE_BZIP2=	YES
WRKSRC=		${WRKDIR}/${PORTNAME}
SUB_FILES=	${PORTNAME}.sh
SUB_LIST=	PYTHON_CMD=${PYTHON_CMD} \
		PATH=${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}

OPTIONS=	MSF "Enable Metasploit Framework integration" off \
		PSY "Enable Psyco optimizer (recommended)" on

.include <bsd.port.options.mk>

.if defined(WITH_MSF)
RUN_DEPENDS+=	${LOCALBASE}/bin/msfcli:${PORTSDIR}/security/metasploit
.endif
.if defined(WITH_PSY)
RUN_DEPENDS+=	${PYTHON_SITELIBDIR}/psyco/core.py:${PORTSDIR}/devel/py-psyco
.endif

post-patch:
	(cd ${WRKSRC} && ${RM} -rf `${FIND} . -type d -name .svn`)
	@${GREP} -lr '/usr/bin/env python' ${WRKSRC} | \
		${XARGS} ${REINPLACE_CMD} -i "" \
		-e "s!/usr/bin/env python!${PYTHON_CMD}!"

do-build:
	@${PYTHON_CMD} -m compileall ${WRKSRC}
	@${PYTHON_CMD} -O -m compileall ${WRKSRC}
	${MKDIR} ${WRKDIR}/build/extra/
	${MV} ${WRKSRC}/doc/ ${WRKDIR}/build/
.	for F in msfauxmod runcmd udfhack
		${MV} ${WRKSRC}/extra/${F} ${WRKDIR}/build/extra/${F}
.	endfor

do-install:
.	if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.	for F in AUTHORS COPYING ChangeLog README.html README.pdf THANKS
		${INSTALL_DATA} ${WRKDIR}/build/doc/${F} ${DOCSDIR}/
.	endfor
.endif

	${MKDIR} ${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}/extra
	( cd ${WRKDIR}/build/extra/ && ${COPYTREE_SHARE} . ${DATADIR} )
	( cd ${WRKSRC} && ${COPYTREE_SHARE} . ${PYTHONPREFIX_SITELIBDIR}/${PORTNAME} )

	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}.conf-dist
	${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh ${PREFIX}/bin/${PORTNAME}

.include <bsd.port.mk>