aboutsummaryrefslogtreecommitdiffstats
path: root/security/nmap-i18n-man/Makefile
blob: 73da3c42c87e6299e0ab0e2ca140c8ee41e17511 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Ports collection makefile for:  nmap-i18n-man
# Date created:           2006-02-19
# Whom:               Daniel Roethlisberger <daniel@roe.ch>
#
# $FreeBSD$
#

PORTNAME=   nmap-i18n-man
PORTVERSION=    4.01.20060302
CATEGORIES= security ipv6
MASTER_SITES=   http://www.insecure.org/nmap/data/man-xlate/ \
        http://home.tiscalinet.ch/~roe/distfiles/${DIST_SUBDIR}/
DISTFILES=  ${LANG_MAP:C/^/nmap-/:C/=[^=]*$/.1/}    # OPTIONS based
DIST_SUBDIR=    ${PORTNAME}-${PORTVERSION}

MAINTAINER= daniel@roe.ch
COMMENT=    Translated manual pages for nmap

BUILD_DEPENDS=  iconv:${PORTSDIR}/converters/libiconv

MAN1=       nmap.1
MANLANG=    ${LANG_MAP:C/^[^=]*=//}         # OPTIONS based

EXTRACT_CMD=    ${CP}
EXTRACT_BEFORE_ARGS=
EXTRACT_AFTER_ARGS= ${WRKDIR}
NO_WRKSUBDIR=   yes

OPTIONS=    MAN_ES "Spanish" On \
        MAN_FR "French" On \
        MAN_HR "Croatian" On \
        MAN_JP "Japanese" On \
        MAN_PL "Polish" On \
        MAN_PT_BR "Portuguese (Brazil)" On \
        MAN_PT_PT "Portuguese (Portugal)" On \
        MAN_RO "Romanian" On \
        MAN_SK "Slovak" On \
        MAN_ZH "Chinese" On

.include <bsd.port.pre.mk>

LANG_MAP=
.if !defined(WITHOUT_MAN_ES)
LANG_MAP+=  es=es.ISO8859-1
.endif
.if !defined(WITHOUT_MAN_FR)
LANG_MAP+=  fr=fr.ISO8859-1
.endif
.if !defined(WITHOUT_MAN_HR)
LANG_MAP+=  hr=hr.ISO8859-2
.endif
.if !defined(WITHOUT_MAN_JP)
LANG_MAP+=  jp=jp.eucJP
.endif
.if !defined(WITHOUT_MAN_PL)
LANG_MAP+=  pl=pl.ISO8859-2
.endif
.if !defined(WITHOUT_MAN_PT_BR)
LANG_MAP+=  pt-br=pt_BR.ISO8859-1
.endif
.if !defined(WITHOUT_MAN_PT_PT)
LANG_MAP+=  pt-pt=pt.ISO8859-1
.endif
.if !defined(WITHOUT_MAN_RO)
LANG_MAP+=  ro=ro.ISO8859-2
.endif
.if !defined(WITHOUT_MAN_SK)
LANG_MAP+=  sk=sk.ISO8859-2
.endif
.if !defined(WITHOUT_MAN_ZH)
LANG_MAP+=  zh=zh.Big5
.endif

ICONV?=${LOCALBASE}/bin/iconv

do-build:
    @for token in ${LANG_MAP}; do \
        lang="`expr $${token} : '\([^=]*\)'`"; \
        locale="`expr $${token} : '.*=\([^=]*\)'`"; \
        charset="`expr $${locale} : '[^.]*\.\([^.]*\)'`"; \
        ${ECHO_CMD} Converting nmap-$${lang}.1 from UTF-8 to $${charset}; \
        ${ICONV} -c -f UTF-8 -t $${charset} ${WRKSRC}/nmap-$${lang}.1 \
            > ${WRKSRC}/nmap-$${lang}.1.$${charset} || true; \
    done

do-install:
    @for token in ${LANG_MAP}; do \
        lang="`expr $${token} : '\([^=]*\)'`"; \
        locale="`expr $${token} : '.*=\([^=]*\)'`"; \
        charset="`expr $${locale} : '[^.]*\.\([^.]*\)'`"; \
        ${MKDIR} ${DESTDIR}${MAN1PREFIX}/man/$${locale}/man1; \
        ${ECHO_CMD} Installing man/$${locale}/man1/nmap.1; \
        ${INSTALL_MAN} ${WRKSRC}/nmap-$${lang}.1.$${charset} \
            ${DESTDIR}${MAN1PREFIX}/man/$${locale}/man1/nmap.1; \
    done

.include <bsd.port.post.mk>