aboutsummaryrefslogtreecommitdiffstats
path: root/math/libtommath/Makefile
blob: ee3a8eba8691f090fdaaea8bb3463197c64e299e (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
# $FreeBSD$

PORTNAME=   libtommath
PORTVERSION=    1.0.1
PORTREVISION=   1
CATEGORIES= math
MASTER_SITES=   https://github.com/libtom/libtommath/releases/download/v${PORTVERSION}/
DISTNAME=   ltm-${PORTVERSION}

MAINTAINER= gahr@FreeBSD.org
COMMENT=    Comprehensive, modular, and portable mathematical routines

LICENSE=    PD WTFPL
LICENSE_COMB=   dual

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}
USES=       gmake tar:xz
ALL_TARGET= default
CFLAGS+=    -fPIC
PORTDOCS=   *

PLIST_FILES=    include/tommath.h \
        include/tommath_class.h \
        include/tommath_superclass.h \
        lib/libtommath.a

OPTIONS_DEFINE= DOCS SHARED

SHARED_DESC=        Build shared library
SHARED_USES=        libtool:build
SHARED_USE=     LDCONFIG=yes
SHARED_PLIST_FILES= lib/libtommath.so \
            lib/libtommath.so.${PORTVERSION:R:R} \
                lib/libtommath.so.${PORTVERSION} \
            libdata/pkgconfig/libtommath.pc
SHARED_VARS=        MAKEFILE=makefile.shared
SHARED_VARS_OFF=    MAKEFILE=makefile

post-install:
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/bn.pdf ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/poster.pdf ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/tommath.pdf ${STAGEDIR}${DOCSDIR}

post-install-SHARED-on:
    @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libtommath.so.${PORTVERSION}

do-test:
    (cd ${WRKSRC}; \
     ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f ${MAKEFILE} mtest test; \
     ./mtest/mtest | ./test)

.include <bsd.port.mk>