summaryrefslogtreecommitdiffstats
path: root/security/zenmap/Makefile
blob: b39498149111bd9cb8162f2ee07abf3d6e530ec9 (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Created by: Daniel Roethlisberger <daniel@roe.ch>
# $FreeBSD$

PORTNAME=	zenmap
PORTVERSION=	6.47
PORTREVISION=	1
CATEGORIES=	security ipv6
MASTER_SITES=	http://nmap.org/dist/ \
		SF/nemysisfreebsdp/security/:icons
DISTNAME=	nmap-${PORTVERSION}
DISTFILES=	nmap-${PORTVERSION}${EXTRACT_SUFX} \
		${PORTNAME}.png:icons
EXTRACT_ONLY=	nmap-${PORTVERSION}${EXTRACT_SUFX}

MAINTAINER=	nemysis@FreeBSD.org
COMMENT=	GUI frontend for the Nmap scanning utility

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

RUN_DEPENDS=	nmap:${PORTSDIR}/security/nmap \
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3

WRKSRC_SUBDIR=	${PORTNAME}

USES=		dos2unix python tar:bzip2
DOS2UNIX_GLOB=	*.xml
USE_GNOME=	pygtk2
USE_PYTHON=	autoplist distutils
NO_ARCH=	yes

OPTIONS_DEFINE=	NLS
OPTIONS_SUB=	yes

NLS_CONFIGURE_ENABLE=	nls
NLS_USES=	gettext

SUB_FILES=	zenmap-root

post-extract:
	@${RM} -f ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh
	@${CP} -a ${FILESDIR}/pc-su ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh

post-patch:
	@${FIND} ${WRKSRC} -name '*.py' -or -name '*.pyw' | ${XARGS} \
		${REINPLACE_CMD} -e 's|^.*#!.*python.*$$|#!${PYTHON_CMD}|'
	@${REINPLACE_CMD} -e 's|^.*#!.*python.*$$|#!${PYTHON_CMD}|' \
		${WRKSRC}/zenmap
	@${FIND} ${WRKSRC}/../ndiff -name '*.py' | ${XARGS} \
		${REINPLACE_CMD} -e 's|^.*#!.*python.*$$|#!${PYTHON_CMD}|'
	@${REINPLACE_CMD} -e 's|su-to-zenmap.sh|zenmap-root|; \
		s| %F||' \
		${WRKSRC}/install_scripts/unix/zenmap-root.desktop
	@${REINPLACE_CMD} -e 's|Security;|Security;System;|' \
		${WRKSRC}/install_scripts/unix/zenmap-root.desktop \
		${WRKSRC}/install_scripts/unix/zenmap.desktop
	@${REINPLACE_CMD} \
		-e '/self.create_uninstaller/s|^|#|; \
		s|distutils\.command\.install |setuptools\.command\.install |; \
		s|self.saved_prefix, pixmaps_dir, ||' \
		${WRKSRC}/setup.py
	@${REINPLACE_CMD} \
		-e 's|share/man/man1|man/man1|; \
		s|"install": checked_install||' \
		${WRKSRC}/../ndiff/setup.py
	@${FIND} ${WRKSRC} -name "*.bak" -delete
	@${FIND} ${WRKSRC}/../ndiff -name "*.bak" -delete

post-patch-NLS-off:
	@${REINPLACE_CMD} -i '' '/locale_dir, mo_find, /d' ${WRKSRC}/setup.py

post-install:
	${INSTALL_SCRIPT} ${WRKDIR}/zenmap-root ${STAGEDIR}${PREFIX}/bin/
	 @(cd ${STAGEDIR}${DATADIR} && ${CHMOD} 754 su-to-zenmap.sh)
	${INSTALL_MAN} ${WRKSRC}/../docs/zenmap.1 \
		${STAGEDIR}${MAN1PREFIX}/man/man1/
	@(cd ${WRKSRC}/../ndiff \
		&& ${PYTHON_CMD} setup.py install --prefix=${STAGEDIR}${PREFIX})
	@(cd ${STAGEDIR}${PYTHON}${PYTHON_SITELIBDIR} && ${RM} ndiff.pyc)
	@(cd ${STAGEDIR}${PYTHON}${PYTHON_SITELIBDIR} && ${PYTHON_CMD} -m compileall .)
	@(cd ${STAGEDIR}${PYTHON}${PYTHON_SITELIBDIR} && ${PYTHON_CMD} -O -m compileall .)

	${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png \
		${STAGEDIR}${PREFIX}/share/pixmaps/

.include <bsd.port.mk>
OpenPOWER on IntegriCloud