aboutsummaryrefslogtreecommitdiffstats
path: root/devel/cons-test/Makefile
blob: 7f859875bc057299cdefdc0742d98b495f35d1c0 (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
# Created by: rv@FreeBSD.org
# $FreeBSD$

PORTNAME=   cons-test
PORTVERSION=    2.2.0
PORTREVISION=   3
CATEGORIES= devel
MASTER_SITES=   http://www.dsmit.com/cons/stable/ \
        http://www.gnu.org/software/cons/stable/ \
        ftp://ftp.gnu.org/pub/old-gnu/cons/ \
        http://www.baldmt.com/cons/stable/
EXTRACT_SUFX=   .tgz

MAINTAINER= ports@FreeBSD.org
COMMENT=    A test bed for `Cons' development

LICENSE=    GPLv2 # (or later)
LICENSE_FILE=   ${WRKSRC}/COPYING

RUN_DEPENDS=    ${LOCALBASE}/bin/cons:${PORTSDIR}/devel/cons

WRKSRC=     ${WRKDIR}/cons-${PORTVERSION}/test
NO_BUILD=   yes

USES=       perl5
PLIST_SUB=  CONS_VER="${PORTVERSION}" CONS_TEST="${CONS_TEST}"

DOCSDIR=    ${PREFIX}/share/doc/${PORTNAME:S/-test//}-${PORTVERSION}/test

MANCOMPRESSED=  yes
MAN1=       cons-test.1

CONS_TEST=  cons-${PORTVERSION}/test
DOCS=       CHANGES COPYRIGHT README TODO Tests.txt
TESTS=      1..83,101..147
TEST_LIBS=  Cmd.pm Cons.pm

post-patch:
    @${REINPLACE_CMD} -e 's:/usr/lib:${PREFIX}/lib:g' \
        ${WRKSRC}/cons-test

do-install:
#
# Install the script
#
    ${INSTALL_SCRIPT} ${WRKSRC}/cons-test \
        ${PREFIX}/bin
#
# Install the tests
#
    ${MKDIR} ${PREFIX}/lib/${CONS_TEST}/t
    ${PERL} -e 'for (${TESTS}) {$$f=sprintf "t%04d.t", $$_;\
            $$x= "${INSTALL_DATA} ${WRKSRC}/t/$$f \
                ${PREFIX}/lib/${CONS_TEST}/t";\
            printf "$$x\n"; system $$x;}'
#
# Install the test libraries
#
    ${MKDIR} ${PREFIX}/lib/${CONS_TEST}/Test/Cmd
    ${INSTALL_DATA} ${WRKSRC}/Test/Cmd.pm ${PREFIX}/lib/${CONS_TEST}/Test
    ${INSTALL_DATA} ${WRKSRC}/Test/Cmd/Cons.pm \
        ${PREFIX}/lib/${CONS_TEST}/Test/Cmd
#
# Install the man pages
#
    ${INSTALL_MAN} ${WRKSRC}/cons-test.1.gz \
        ${MANPREFIX}/man/man1
.if !defined(NOPORTDOCS)
#
# Install the documentation
#
    ${MKDIR} ${DOCSDIR}
.for f in ${DOCS}
    ${INSTALL_DATA} ${WRKSRC}/${f} \
        ${DOCSDIR}
.endfor
.endif

.include <bsd.port.mk>