aboutsummaryrefslogtreecommitdiffstats
path: root/devel/tcl-trf/Makefile
blob: faba66bdf3e7c708372b7f27f8bef665b51a5f98 (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
# Created by: Mikhail Teterin <mi@aldan.algebra.com>
# $FreeBSD$

PORTNAME=   Trf
PORTVERSION=    2.1.4
CATEGORIES= devel tcl
MASTER_SITES=   SF
MASTER_SITE_SUBDIR=tcltrf/tcltrf/${PORTVERSION}
PKGNAMEPREFIX=  tcl-
DISTNAME=   trf${PORTVERSION}

MAINTAINER= mi@aldan.algebra.com
COMMENT=    Data conversion, digests, compression, error-correction for Tcl

BUILD_DEPENDS=  ${LOCALBASE}/lib/Memchan2.3/pkgIndex.tcl:${PORTSDIR}/devel/tcl-memchan

USE_BZIP2=  yes

ALL_TARGET= all

USES+=      tcl
USE_LDCONFIG=   ${PREFIX}/lib/Trf
DDIR=       ${PREFIX}/lib/tcl${TCL_VER}/Trf
CFLAGS+=    -Wall -Werror

MAKE_ENV+=  TCL_VER=${TCL_VER} MKDIR="${MKDIR}" \
        INSTALL_DATA="${INSTALL_DATA}"

REINPLACE_ARGS= -i ""
HAS_CONFIGURE=  yes
CONFIGURE_ARGS= --with-tcl=${LOCALBASE}/lib/tcl${TCL_VER} \
        --with-tclinclude=${LOCALBASE}/include/tcl${TCL_VER} \
        --enable-static-zlib --enable-static-bzlib \
        --enable-static-md5

NO_STAGE=   yes

.include <bsd.port.options.mk>
post-patch:
.if defined(TRF_USE_MD) || ${OSREL} > 10
    #
    # Using FreeBSD's own -lmd instead of OpenSSL's -lcrypto
    #
    ${REINPLACE_CMD} -E -e 's,openssl/,,'       \
        -e 's,(MD[25])_([A-Z][a-z]),\1\2,g' \
        ${WRKSRC}/generic/*.[ch]
    ${REINPLACE_CMD} 's,-lcrypto,-lmd,' ${WRKSRC}/Makefile.in
.else
    #
    # Using OpenSSL's implementations of message digests (-lcrypto)
    # To use FreeBSD's own -lmd, stop now and restart make with:
    #
    #   -DTRF_USE_MD
    #
USE_OPENSSL=    yes
.endif

do-install:
    ${MKDIR} ${PREFIX}/lib/Trf
    ${INSTALL_DATA} ${WRKSRC}/libTrf${PORTVERSION}.so   \
        ${WRKSRC}/pkgIndex.tcl ${PREFIX}/lib/Trf/
    for m in ${WRKSRC}/doc/man/*.n  ;   \
    do  \
        ${INSTALL_MAN} $$m ${MANNPREFIX}/man/mann/ ;\
    done

check regression-test post-build test:
    cd ${WRKSRC}/tests && ${SETENV} TCLLIBPATH="${WRKSRC}" ${TCLSH} all

MANN=   adler.n ascii85.n base64.n bin.n bz2.n crc-zlib.n crc.n \
    crypt.n haval.n hex.n md2.n md5.n md5_otp.n md5crypt.n  \
    oct.n otp_words.n quoted-printable.n ripemd128.n ripemd160.n \
    rs_ecc.n sha.n sha1.n sha1_otp.n transform.n trf.n unstack.n \
    uuencode.n zip.n

.include <bsd.port.pre.mk>

PLIST_SUB+= TCL_DVER=${TCL_VER:C/\.//} VER=${PORTVERSION}

.if defined(OPENSSLBASE) && ${OPENSSLBASE} != "/usr"
MAKE_ENV+=  SSLINC=-I${OPENSSLINC} SSLLIB=-L${OPENSSLLIB}
.endif

.include <bsd.port.post.mk>