aboutsummaryrefslogtreecommitdiffstats
path: root/security/gnupg-idea/Makefile
blob: ae652351e4c0aa9c2307cb2975a47f258cebb44f (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
# New ports collection makefile for:    gnupg-idea
# Date created:     10 May, 2000
# Whom:         dirk.meyer@dinoex.sub.org
#
# $FreeBSD$
#

PORTNAME=   gnupg-idea
PORTVERSION=    1.0.3
CATEGORIES= security
MASTER_SITES=   ftp://ftp.gnupg.org/pub/gcrypt/%SUBDIR%/ \
        http://www.gnupg.dk/contrib-dk/ \
        ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/gnupg/&,}
MASTER_SITE_SUBDIR= contrib
DISTFILES=  # later
DIST_SUBDIR=    ${PORTNAME}
EXTRACT_ONLY=   # none
EXTRACT_AFTER_ARGS= > ${WRKSRC}/idea.c

MAINTAINER= dinoex@FreeBSD.org

RUN_DEPENDS=    ${LOCALBASE}/bin/gpg:${PORTSDIR}/security/gnupg

RESTRICTED= "IDEA is Patented in the USA and many European countries"

NO_WRKSUBDIR=   yes
CFLAGS+=    -shared -fPIC -DIS_MODULE
CFLAGS+=    -Wall -Wcast-align -Wshadow -Wstrict-prototypes
PLIST=      ${WRKDIR}/.PLIST.more

.if !defined(USA_RESIDENT) || ${USA_RESIDENT} != YES && ${USA_RESIDENT} != NO
pre-fetch:
    @${ECHO_MSG}
    @${ECHO_MSG} You must set variable USA_RESIDENT to YES, if you are USA resident
    @${ECHO_MSG} or to NO, if you aren\'t USA resident to build this package
    @${FALSE}

.include <bsd.port.mk>

.elif defined(USA_RESIDENT)

.if ${USA_RESIDENT} == NO || defined(MAKE_IDEA)
CONTRIB=    idea rsa
DISTFILES=  idea.c.gz rsa.c
EXTRACT_ONLY=   idea.c.gz
.else
CONTRIB=    rsa
DISTFILES=  rsa.c

pre-fetch:
    @${ECHO_MSG}
    @${ECHO_MSG} You must set variable MAKE_IDEA to YES, only rsa is build now.
.endif

.include <bsd.port.pre.mk>

pre-extract:
    @${SED} -e s!%%PREFIX%%!${PREFIX}!g ${PKGMESSAGE}

post-extract:
.for i in ${DISTFILES}
    @tr -d '\r' <${_DISTDIR}/${i} >${WRKSRC}/${i}
.endfor

do-patch:
.for i in ${CONTRIB}
    @${ECHO_MSG} "===>  Applying extra patch ${i}.c"
    @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/patch-${i}.c
.endfor

do-build:
.for i in ${CONTRIB}
    ${CC} ${CFLAGS} -o ${WRKSRC}/${i} ${WRKSRC}/${i}.c
    ${ECHO_CMD} "lib/gnupg/${i}" >>${PLIST}
.endfor
    ${ECHO_CMD} "@dirrm lib/gnupg" >>${PLIST}

do-install:
    ${MKDIR} ${PREFIX}/lib/gnupg
.for i in ${CONTRIB}
    ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${PREFIX}/lib/gnupg/${i}
.endfor

.include <bsd.port.post.mk>

.else

.endif